checkpoint: finished test curation
This commit is contained in:
@@ -24,6 +24,7 @@ class GeminiCliAdapter:
|
||||
command += f' --resume {self.session_id}'
|
||||
|
||||
accumulated_text = ""
|
||||
tool_calls = []
|
||||
|
||||
env = os.environ.copy()
|
||||
env["GEMINI_CLI_HOOK_CONTEXT"] = "manual_slop"
|
||||
@@ -59,14 +60,22 @@ class GeminiCliAdapter:
|
||||
|
||||
elif msg_type == "result":
|
||||
# Capture final usage and session persistence
|
||||
self.last_usage = data.get("usage")
|
||||
# Support both mock ('usage') and real ('stats') keys
|
||||
self.last_usage = data.get("usage") or data.get("stats")
|
||||
self.session_id = data.get("session_id")
|
||||
|
||||
elif msg_type in ("status", "tool_use"):
|
||||
elif msg_type == "tool_use":
|
||||
# Collect tool_use messages
|
||||
tool_calls.append(data)
|
||||
# Log status/tool_use to stderr for debugging
|
||||
sys.stderr.write(f"GeminiCliAdapter [{msg_type}]: {line}\n")
|
||||
sys.stderr.flush()
|
||||
|
||||
elif msg_type == "status":
|
||||
# Log status to stderr for debugging
|
||||
sys.stderr.write(f"GeminiCliAdapter [{msg_type}]: {line}\n")
|
||||
sys.stderr.flush()
|
||||
|
||||
except json.JSONDecodeError:
|
||||
# Skip lines that are not valid JSON
|
||||
continue
|
||||
@@ -78,4 +87,7 @@ class GeminiCliAdapter:
|
||||
finally:
|
||||
self.last_latency = time.time() - start_time
|
||||
|
||||
return accumulated_text
|
||||
return {
|
||||
"text": accumulated_text,
|
||||
"tool_calls": tool_calls
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user