gitarsenal-cli 1.9.28 ā 1.9.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.venv_status.json +1 -1
- package/package.json +1 -1
- package/python/command_manager.py +120 -60
- package/python/llm_debugging.py +84 -80
- package/python/test_modalSandboxScript.py +25 -103
- package/python/api_integration.py +0 -0
- package/python/modal_container.py +0 -722
|
@@ -31,6 +31,7 @@ parser.add_argument('--gpu', default='A10G', help='GPU type to use')
|
|
|
31
31
|
parser.add_argument('--repo-url', help='Repository URL')
|
|
32
32
|
parser.add_argument('--volume-name', help='Volume name')
|
|
33
33
|
parser.add_argument('--use-api', action='store_true', help='Use API to fetch setup commands')
|
|
34
|
+
parser.add_argument('--yes', action='store_true', help='Automatically confirm prompts (non-interactive)')
|
|
34
35
|
|
|
35
36
|
# Parse only known args to avoid conflicts with other arguments
|
|
36
37
|
args, unknown = parser.parse_known_args()
|
|
@@ -435,7 +436,7 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
435
436
|
print(f"š Executing main command {cmd_index + 1}/{cmd_manager.total_commands}: {cmd_text}")
|
|
436
437
|
|
|
437
438
|
start_time = time.time()
|
|
438
|
-
success, stdout, stderr = shell.execute(cmd_text, timeout=
|
|
439
|
+
success, stdout, stderr = shell.execute(cmd_text, timeout=100)
|
|
439
440
|
execution_time = time.time() - start_time
|
|
440
441
|
|
|
441
442
|
# Check if the command was aborted due to waiting for input and an alternative was suggested
|
|
@@ -521,7 +522,7 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
521
522
|
# Retry the original command
|
|
522
523
|
print(f"š Retrying original command: {cmd_text}")
|
|
523
524
|
retry_start_time = time.time()
|
|
524
|
-
retry_success, retry_stdout, retry_stderr = shell.execute(cmd_text, timeout=
|
|
525
|
+
retry_success, retry_stdout, retry_stderr = shell.execute(cmd_text, timeout=100)
|
|
525
526
|
retry_execution_time = time.time() - retry_start_time
|
|
526
527
|
|
|
527
528
|
# Update the original command status
|
|
@@ -540,93 +541,10 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
540
541
|
print(f"ā ļø Original command still failed after fix, continuing...")
|
|
541
542
|
else:
|
|
542
543
|
print(f"ā Fix command failed: {fix_stderr}")
|
|
543
|
-
print(f"
|
|
544
|
+
print(f"ā ļø First fix attempt failed; continuing without web search...")
|
|
544
545
|
|
|
545
|
-
#
|
|
546
|
-
|
|
547
|
-
retry_fix_command = call_llm_for_debug(
|
|
548
|
-
cmd_text, stderr,
|
|
549
|
-
current_dir=current_dir,
|
|
550
|
-
sandbox=shell,
|
|
551
|
-
use_web_search=True
|
|
552
|
-
)
|
|
553
|
-
|
|
554
|
-
if retry_fix_command:
|
|
555
|
-
# Get the current debug model to show the correct provider name
|
|
556
|
-
from llm_debugging import get_current_debug_model
|
|
557
|
-
current_model = get_current_debug_model()
|
|
558
|
-
print(f"š§ {current_model.capitalize()} suggested web-enhanced fix: {retry_fix_command}")
|
|
559
|
-
|
|
560
|
-
# Add the web-enhanced fix to the command list manager
|
|
561
|
-
retry_fix_index = cmd_manager.add_suggested_fix(cmd_text, retry_fix_command, "Web-enhanced LLM fix")
|
|
562
|
-
|
|
563
|
-
# Execute the web-enhanced fix command
|
|
564
|
-
print(f"š Running web-enhanced fix command: {retry_fix_command}")
|
|
565
|
-
retry_fix_start_time = time.time()
|
|
566
|
-
retry_fix_success, retry_fix_stdout, retry_fix_stderr = shell.execute(retry_fix_command, timeout=120)
|
|
567
|
-
retry_fix_execution_time = time.time() - retry_fix_start_time
|
|
568
|
-
|
|
569
|
-
# Mark web-enhanced fix command as executed
|
|
570
|
-
cmd_manager.mark_command_executed(
|
|
571
|
-
retry_fix_index, 'fix', retry_fix_success, retry_fix_stdout, retry_fix_stderr, retry_fix_execution_time
|
|
572
|
-
)
|
|
573
|
-
|
|
574
|
-
if retry_fix_success:
|
|
575
|
-
print(f"ā
Web-enhanced fix command succeeded!")
|
|
576
|
-
|
|
577
|
-
# Check if we should skip the original command
|
|
578
|
-
api_key = os.environ.get("OPENAI_API_KEY")
|
|
579
|
-
should_skip, skip_reason = cmd_manager.should_skip_original_command(
|
|
580
|
-
cmd_text, retry_fix_command, retry_fix_stdout, retry_fix_stderr, api_key
|
|
581
|
-
)
|
|
582
|
-
|
|
583
|
-
if should_skip:
|
|
584
|
-
print(f"š Skipping original command: {skip_reason}")
|
|
585
|
-
|
|
586
|
-
# Mark the original command as successful without running it
|
|
587
|
-
cmd_manager.mark_command_executed(
|
|
588
|
-
cmd_index, 'main', True,
|
|
589
|
-
f"Command skipped after successful web-enhanced fix: {skip_reason}",
|
|
590
|
-
"", time.time() - start_time
|
|
591
|
-
)
|
|
592
|
-
|
|
593
|
-
print(f"ā
Original command marked as successful (skipped)")
|
|
594
|
-
|
|
595
|
-
# After a successful web-enhanced fix and skipping the original command,
|
|
596
|
-
# analyze and update the entire command list
|
|
597
|
-
print("\nš Analyzing and updating remaining commands based on web-enhanced fix results...")
|
|
598
|
-
cmd_manager.update_command_list_with_llm(api_key)
|
|
599
|
-
else:
|
|
600
|
-
# Retry the original command
|
|
601
|
-
print(f"š Retrying original command: {cmd_text}")
|
|
602
|
-
retry_start_time = time.time()
|
|
603
|
-
retry_success, retry_stdout, retry_stderr = shell.execute(cmd_text, timeout=300)
|
|
604
|
-
retry_execution_time = time.time() - retry_start_time
|
|
605
|
-
|
|
606
|
-
# Update the original command status
|
|
607
|
-
cmd_manager.mark_command_executed(
|
|
608
|
-
cmd_index, 'main', retry_success, retry_stdout, retry_stderr, retry_execution_time
|
|
609
|
-
)
|
|
610
|
-
|
|
611
|
-
if retry_success:
|
|
612
|
-
print(f"ā
Original command succeeded after web-enhanced fix!")
|
|
613
|
-
|
|
614
|
-
# After a successful web-enhanced fix and successful retry,
|
|
615
|
-
# analyze and update the entire command list
|
|
616
|
-
print("\nš Analyzing and updating remaining commands based on web-enhanced fix results...")
|
|
617
|
-
cmd_manager.update_command_list_with_llm(api_key)
|
|
618
|
-
else:
|
|
619
|
-
print(f"ā ļø Original command still failed after web-enhanced fix, continuing...")
|
|
620
|
-
else:
|
|
621
|
-
print(f"ā Web-enhanced fix command also failed: {retry_fix_stderr}")
|
|
622
|
-
print(f"ā ļø Continuing with remaining commands...")
|
|
623
|
-
else:
|
|
624
|
-
print(f"ā No web-enhanced fix suggested")
|
|
625
|
-
print(f"ā ļø Continuing with remaining commands...")
|
|
626
|
-
|
|
627
|
-
except Exception as web_debug_e:
|
|
628
|
-
print(f"ā Web-enhanced debugging failed: {web_debug_e}")
|
|
629
|
-
print(f"ā ļø Continuing with remaining commands...")
|
|
546
|
+
# No web-search retry; continue
|
|
547
|
+
print(f"ā ļø Continuing with remaining commands...")
|
|
630
548
|
else:
|
|
631
549
|
# Get the current debug model to show the correct provider name
|
|
632
550
|
from llm_debugging import get_current_debug_model
|
|
@@ -644,7 +562,7 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
644
562
|
print(f"š§ Executing fix command {cmd_index + 1}: {cmd_text}")
|
|
645
563
|
|
|
646
564
|
start_time = time.time()
|
|
647
|
-
success, stdout, stderr = shell.execute(cmd_text, timeout=
|
|
565
|
+
success, stdout, stderr = shell.execute(cmd_text, timeout=100)
|
|
648
566
|
execution_time = time.time() - start_time
|
|
649
567
|
|
|
650
568
|
# Check if the fix command was aborted due to waiting for input and an alternative was suggested
|
|
@@ -679,8 +597,8 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
679
597
|
current_model = get_current_debug_model()
|
|
680
598
|
api_key = get_api_key(current_model)
|
|
681
599
|
|
|
682
|
-
# Use batch analysis to get additional fixes
|
|
683
|
-
additional_fixes = cmd_manager.analyze_failed_commands_with_llm(api_key, current_dir, shell
|
|
600
|
+
# Use batch analysis to get additional fixes
|
|
601
|
+
additional_fixes = cmd_manager.analyze_failed_commands_with_llm(api_key, current_dir, shell)
|
|
684
602
|
|
|
685
603
|
if additional_fixes:
|
|
686
604
|
print(f"š§ Executing {len(additional_fixes)} additional fix commands...")
|
|
@@ -692,7 +610,7 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
|
|
|
692
610
|
print(f"š§ Executing additional fix: {cmd_text}")
|
|
693
611
|
|
|
694
612
|
start_time = time.time()
|
|
695
|
-
success, stdout, stderr = shell.execute(cmd_text, timeout=
|
|
613
|
+
success, stdout, stderr = shell.execute(cmd_text, timeout=100)
|
|
696
614
|
execution_time = time.time() - start_time
|
|
697
615
|
|
|
698
616
|
# Check if the fix command was aborted due to waiting for input and an alternative was suggested
|
|
@@ -1782,8 +1700,8 @@ def get_setup_commands_from_gitingest(repo_url):
|
|
|
1782
1700
|
# Prompt user for the API key
|
|
1783
1701
|
try:
|
|
1784
1702
|
import getpass
|
|
1785
|
-
print(f"\nPlease enter your {key_name}:")
|
|
1786
|
-
new_key = getpass.getpass("API Key (hidden): ").strip()
|
|
1703
|
+
print(f"\nPlease enter your {key_name} for {service}:")
|
|
1704
|
+
new_key = getpass.getpass(f"{key_name} ({service}) API Key (hidden): ").strip()
|
|
1787
1705
|
|
|
1788
1706
|
if new_key:
|
|
1789
1707
|
# Save to credentials file
|
|
@@ -2174,7 +2092,8 @@ if __name__ == "__main__":
|
|
|
2174
2092
|
parser.add_argument('--show-examples', action='store_true', help='Show usage examples')
|
|
2175
2093
|
parser.add_argument('--list-gpus', action='store_true', help='List available GPU types with their specifications')
|
|
2176
2094
|
parser.add_argument('--interactive', action='store_true', help='Run in interactive mode with prompts')
|
|
2177
|
-
|
|
2095
|
+
parser.add_argument('--yes', action='store_true', help='Automatically confirm prompts (non-interactive)')
|
|
2096
|
+
|
|
2178
2097
|
parser.add_argument('--proxy-url', help='URL of the proxy server')
|
|
2179
2098
|
parser.add_argument('--proxy-api-key', help='API key for the proxy server')
|
|
2180
2099
|
parser.add_argument('--gpu', default='A10G', help='GPU type to use')
|
|
@@ -2293,15 +2212,18 @@ if __name__ == "__main__":
|
|
|
2293
2212
|
else:
|
|
2294
2213
|
print("Setup Commands: Auto-detect from repository")
|
|
2295
2214
|
|
|
2296
|
-
# Confirm settings
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2215
|
+
# Confirm settings (skip if --yes specified)
|
|
2216
|
+
if not getattr(args, 'yes', False):
|
|
2217
|
+
try:
|
|
2218
|
+
proceed = input("Proceed with these settings? (Y/n): ").strip().lower()
|
|
2219
|
+
if proceed in ('n', 'no'):
|
|
2220
|
+
print("š Operation cancelled by user.")
|
|
2221
|
+
sys.exit(0)
|
|
2222
|
+
except KeyboardInterrupt:
|
|
2223
|
+
print("\nš Operation cancelled by user.")
|
|
2301
2224
|
sys.exit(0)
|
|
2302
|
-
|
|
2303
|
-
print("
|
|
2304
|
-
sys.exit(0)
|
|
2225
|
+
else:
|
|
2226
|
+
print("š Debug: yes parameter = true")
|
|
2305
2227
|
|
|
2306
2228
|
# Interactive mode or missing required arguments
|
|
2307
2229
|
if args.interactive or not args.repo_url or not args.volume_name:
|
|
File without changes
|