Botched: Need to do a higher reaosning model to fix this mess.
This commit is contained in:
67
run_repro.py
Normal file
67
run_repro.py
Normal file
@@ -0,0 +1,67 @@
|
||||
import time
|
||||
import requests
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Ensure src/ is in path
|
||||
project_root = os.path.dirname(os.path.abspath(__file__))
|
||||
src_path = os.path.join(project_root, "src")
|
||||
sys.path.insert(0, src_path)
|
||||
|
||||
from api_hook_client import ApiHookClient
|
||||
|
||||
def run_repro():
|
||||
client = ApiHookClient("http://127.0.0.1:8999")
|
||||
if not client.wait_for_server(timeout=15):
|
||||
print("Failed to connect to GUI Hook Server.")
|
||||
return
|
||||
|
||||
print("[REPRO] Connected to GUI.")
|
||||
|
||||
# 1. Reset and Setup
|
||||
client.click("btn_reset")
|
||||
time.sleep(1)
|
||||
client.set_value("auto_add_history", True)
|
||||
client.set_value("manual_approve", False) # Auto-approve for simulation
|
||||
client.set_value("current_provider", "gemini_cli")
|
||||
|
||||
mock_script = os.path.abspath("tests/mock_gemini_cli.py")
|
||||
client.set_value("gcli_path", f'"{sys.executable}" "{mock_script}"')
|
||||
|
||||
# 2. Trigger Chat
|
||||
msg = "What is the current date and time? Answer in one sentence."
|
||||
print(f"[REPRO] Sending message: {msg}")
|
||||
client.set_value("ai_input", msg)
|
||||
client.click("btn_gen_send")
|
||||
|
||||
# 3. Wait and Monitor
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < 30:
|
||||
status = client.get_value("ai_status")
|
||||
print(f"[REPRO] Status: {status}")
|
||||
|
||||
if status == "error":
|
||||
print("[REPRO] DETECTED ERROR STATUS!")
|
||||
# Try to get more info if possible
|
||||
break
|
||||
|
||||
if status == "done":
|
||||
print("[REPRO] Success! Status is done.")
|
||||
break
|
||||
|
||||
# Check events
|
||||
events = client.get_events()
|
||||
for ev in events:
|
||||
print(f"[REPRO] Received Event: {ev.get('type')}")
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
# 4. Check Session
|
||||
session = client.get_session()
|
||||
entries = session.get('session', {}).get('entries', [])
|
||||
print(f"[REPRO] History Entries: {len(entries)}")
|
||||
for i, entry in enumerate(entries):
|
||||
print(f" {i}: [{entry.get('role')}] {entry.get('content')[:100]}...")
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_repro()
|
||||
Reference in New Issue
Block a user