robustness: vision/depth render off the event loop (deepcopy snapshot), chat auto-reconnect + friendly errors, demo catches connection failures

This commit is contained in:
opencode
2026-08-08 12:33:30 +03:00
parent 346d918118
commit f4cb04a47f
5 changed files with 54 additions and 13 deletions
+11 -2
View File
@@ -152,7 +152,9 @@ async def run_llm_agent(
log=lambda role, msg: print(f"[{role}] {msg}"),
)
try:
return await run_llm_agent_loop(controller, max_steps, log=print_log, recorder=recorder)
return await run_llm_agent_loop(
controller, max_steps, log=print_log, recorder=recorder
)
except RuntimeError as exc:
return {"steps": 0, "tool_calls": 0, "result": str(exc), "interacted": False}
@@ -398,7 +400,14 @@ def main() -> int:
"into this directory, plus demo.gif animation and demo_summary.png",
)
args = parser.parse_args()
summary = asyncio.run(run_demo(args))
try:
summary = asyncio.run(run_demo(args))
except KeyboardInterrupt:
return 2
except Exception as exc: # noqa: BLE001 - friendly failure instead of a traceback
print(f"\n[demo] failed: {type(exc).__name__}: {exc}")
print("[demo] is the bridge running? scripts/run_bridge.sh")
return 1
return 0 if summary.get("interacted") else 1