Skip to content

docs(mantis): script catalog-tool turns through Code Mode exec - #127878

Merged
obviyus merged 2 commits into
mainfrom
t3code/mantis-codemode-tools
Aug 22, 2026
Merged

obviyus merged 2 commits into
mainfrom
t3code/mantis-codemode-tools

Conversation

@obviyus

@obviyus obviyus commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Mantis proof run 32570733988 on #127770 (native PDF input) blocked both lanes with the SUT replying Tool pdf not found: the proof agent scripted a top-level pdf function call, but the harness SUT agent runs Code Mode — its top-level tools are only exec, computer, view_image, sessions_yield, wait, and catalog tools like pdf execute from JavaScript inside exec. Nothing in the proof prompt or recipes says so, making every tool-driven proof scenario impossible to script correctly.

Why This Change Was Made

Scenario authoring is owned by the proof prompt and recipes, so the fix is documentation at that owner: the prompt gains three lines stating the Code Mode contract and pointing at the recipe; mantis-recipes/staged-media-provider-proof.md gains a complete working example — the exact scripted response-event array for an exec call invoking pdf(...), the two-response mock script installing it, and the configPatch allowing the bundled document-extract plugin so the pdf tool registers (without a PDF route, createPdfTool returns null, which is precisely the observed Tool pdf not found). One canonical route only; no classic-mode alternative documented.

User Impact

Mantis proof agents can now exercise agent tools (pdf, and the same pattern for any catalog tool) in scripted provider turns, unlocking tool-behavior PRs — starting with the planned #127770 re-dispatch — instead of producing vacuous "tool not found" comparisons.

Evidence

  • Claims verified against source: exec accepts language/code (src/agents/code-mode.ts:207), tool name pdf (src/agents/tools/pdf-tool.ts:427), createPdfTool null-gate without a resolvable PDF route (src/agents/tools/pdf-tool.ts:369-405), document-extract bundled plugin declares documentExtractors: ["pdf"].
  • TMPDIR=/var/tmp node scripts/run-vitest.mjs test/scripts/mantis-telegram-desktop-proof-workflow.test.ts — 31/31 pass, including the new prompt pin.
  • TMPDIR=/var/tmp node scripts/check-changed.mjs -- <changed files> green.
  • Structured autoreview (Codex gpt-5.6-sol, high): clean, patch is correct (0.99).
  • Live proof: the post-land Mantis re-dispatch on feat(pdf): add explicit OpenAI native document opt-in #127770 executes the new recipe end-to-end.

Review Dispositions

  • ClawSweeper round 1 at 5b5d9113ebc (P2, confirmed): the recipe's tool-driven turn called finish straight after send, racing lane teardown against the exec/pdf round trip. Fixed in 88553dbb3c1: the recipe now observes until the cumulative provider-request count includes the function_call_output follow-up and asserts it structurally before finish; the workflow test pins the wait, the assertion, and their ordering relative to finish (both rank-up moves applied).

Run 32570733988 blocked both lanes with 'Tool pdf not found': the proof
agent scripted a top-level pdf function_call, but the SUT agent runs Code
Mode where catalog tools execute from JavaScript inside exec. Document the
canonical route in the proof prompt, add a complete exec(pdf) scripted-event
example plus the document-extract configPatch to the staged-media recipe,
and pin the new guidance in the workflow test.
@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@obviyus
obviyus marked this pull request as ready for review August 22, 2026 12:06
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 22, 2026
ClawSweeper P2: send releases the mock response once the outbound message
is visible, and finish tears the lane down, so a slow exec/pdf round trip
could lose its function_call_output follow-up. Observe until the cumulative
provider-request count covers the follow-up and assert the recorded
function_call_output before finish; pin the contract in the workflow test.
@obviyus
obviyus merged commit f4cb545 into main Aug 22, 2026
138 of 140 checks passed
@obviyus
obviyus deleted the t3code/mantis-codemode-tools branch August 22, 2026 12:17
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 23, 2026
…law#127878)

* docs(mantis): script catalog-tool turns through Code Mode exec

Run 32570733988 blocked both lanes with 'Tool pdf not found': the proof
agent scripted a top-level pdf function_call, but the SUT agent runs Code
Mode where catalog tools execute from JavaScript inside exec. Document the
canonical route in the proof prompt, add a complete exec(pdf) scripted-event
example plus the document-extract configPatch to the staged-media recipe,
and pin the new guidance in the workflow test.

* docs(mantis): wait for the exec round trip before finish

ClawSweeper P2: send releases the mock response once the outbound message
is visible, and finish tears the lane down, so a slow exec/pdf round trip
could lose its function_call_output follow-up. Observe until the cumulative
provider-request count covers the follow-up and assert the recorded
function_call_output before finish; pin the contract in the workflow test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant