This commit is contained in:
ed
2026-06-06 00:40:07 -04:00
parent 053f5d867a
commit e670fc1c3e
6 changed files with 60 additions and 102 deletions
-29
View File
@@ -1,29 +0,0 @@
"""Minimal reproducer for the auto_switch_sim GUI crash."""
import sys
import time
import os
sys.path.insert(0, 'C:/projects/manual_slop')
sys.path.insert(0, 'C:/projects/manual_slop/src')
from src.api_hook_client import ApiHookClient
client = ApiHookClient()
if not client.wait_for_server(timeout=15):
print('FAIL: server not up')
sys.exit(1)
print('OK: server up')
print('Step 1: click btn_reset')
client.click('btn_reset')
time.sleep(1.0)
print('Step 1 done, status=', client.get_value('ai_status'))
print('Step 2: set_value current_provider gemini_cli')
client.set_value('current_provider', 'gemini_cli')
time.sleep(1.0)
print('Step 2 done')
print('Step 3: set_value gcli_path')
mock_path = os.path.abspath('tests/mock_concurrent_mma.py')
client.set_value('gcli_path', '"' + sys.executable + '" "' + mock_path + '"')
time.sleep(1.0)
print('Step 3 done')
+6 -12
View File
@@ -1,3 +1,4 @@
import difflib
import shutil
import os
@@ -25,12 +26,10 @@ def parse_hunk_header(line: str) -> Optional[tuple[int, int, int, int]]:
"""
[C: tests/test_diff_viewer.py:test_parse_hunk_header]
"""
if not line.startswith("@@"):
return None
if not line.startswith("@@"): return None
parts = line.split()
if len(parts) < 2:
return None
if len(parts) < 2: return None
old_part = parts[1][1:]
new_part = parts[2][1:]
@@ -117,20 +116,15 @@ def get_line_color(line: str) -> Optional[str]:
"""
[C: tests/test_diff_viewer.py:test_get_line_color]
"""
if line.startswith("+"):
return "green"
elif line.startswith("-"):
return "red"
elif line.startswith("@@"):
return "cyan"
if line.startswith("+"): return "green"
elif line.startswith("-"): return "red"
elif line.startswith("@@"): return "cyan"
return None
def apply_patch_to_file(patch_text: str, base_dir: str = ".") -> Tuple[bool, str]:
"""
[C: src/gui_2.py:App._apply_pending_patch, tests/test_diff_viewer.py:test_apply_patch_simple, tests/test_diff_viewer.py:test_apply_patch_with_context]
"""
import difflib
diff_files = parse_diff(patch_text)
if not diff_files:
return False, "No valid diff found"
+4 -9
View File
File diff suppressed because one or more lines are too long
-2
View File
@@ -196,8 +196,6 @@ class GeminiCliAdapter:
def count_tokens(self, contents: list[str]) -> int:
"""
Provides a character-based token estimation for the Gemini CLI.
Uses 4 chars/token as a conservative average.
[C: tests/test_gemini_cli_adapter_parity.py:TestGeminiCliAdapterParity.test_count_tokens_fallback]