Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions openzero/brain/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4931,8 +4931,8 @@ def browser_inspection_final_reply(result: str) -> str:
visible = blocks[1] if len(blocks) == 2 else ""
visible = visible.rsplit("\n```", 1)[0]
visible = re.sub(r"\s+", " ", visible).strip(" `")
if len(visible) > 900:
visible = visible[:900].rsplit(" ", 1)[0].rstrip() + "..."
if len(visible) > 600:
visible = visible[:600].rsplit(" ", 1)[0].rstrip() + "..."
url = str(url_match.group(1) if url_match else "").strip()
title = str(title_match.group(1) if title_match else "").strip()
lines = ["I inspected the live page with OpenZero's Moltbot browser."]
Expand Down Expand Up @@ -5371,7 +5371,6 @@ def execute_autonomous_run(
if action.get("retryable_model_error"):
emit_agent_log("The local model requested an unknown tool, so OpenZero is retrying cleanly.", session_id)
continue
emit_run_reply(session_id, action_result, "system")

if completion_evidence is not None and tool_name == "moltbot_browse":
completion_reason = required_operator_evidence_reason(
Expand All @@ -5392,6 +5391,8 @@ def execute_autonomous_run(
emit_run_reply(session_id, final_reply, agent_mode)
break

emit_run_reply(session_id, action_result, "system")

if action.get("ambiguous_action"):
final_status = "error"
final_reply = action_result
Expand Down
3 changes: 3 additions & 0 deletions openzero/tests/test_autonomous_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,9 @@ def test_plain_conversation_and_model_format_recovery_are_guarded(self):
self.assertIn("browser result compacted for local summary", self.source)
self.assertIn("def browser_inspection_final_reply(", self.source)
self.assertIn('"deterministic_browser_completion"', self.source)
completion = self.source.index('if completion_evidence is not None and tool_name == "moltbot_browse"')
raw_emit = self.source.index('emit_run_reply(session_id, action_result, "system")')
self.assertLess(completion, raw_emit)
self.assertIn("required_operator_evidence_reason(", self.source)
self.assertIn("max_predict=local_reply_token_budget(prompt, agent_mode)", self.source)
self.assertIn('"think": False', self.source)
Expand Down
Loading