Skip to content

feat(opencode): declare toolCallSpans on /v1/capabilities so agent-runtime can bound a silent model call - #267

Merged
drewstone merged 1 commit into
mainfrom
fix/opencode-tool-call-spans
Oct 20, 2026
Merged

drewstone merged 1 commit into
mainfrom
fix/opencode-tool-call-spans

Conversation

@drewstone

Copy link
Copy Markdown
Owner

Problem. agent-runtime runs modelSilenceMs (cut a silent model call, never a running tool) only on a bridge route whose GET /v1/capabilities?model= answer says toolCallSpans: true (tangle-network/agent-runtime#1885). No backend declared it, so the bound was refused on every route. Baseline, served disco bridge :8899 at cdf9292, 2026-10-20 01:08Z: /v1/capabilities?model=opencode/... has no toolCallSpans.

Change. #266 made opencode report each tool call at its start, and its finished part already carries the outcome. Backend.toolCallSpans is a new optional field; OpencodeBackend sets it, and the capabilities answer includes toolCallSpans: true for a backend that sets it. Other backends are unchanged: claude reports a call at start but never its result, and codex reports calls only when they finish.

Condition. The start signal comes from the plugin in the turn's private config directory, which every turn with an AgentProfile has. agent-runtime's bridge executor always sends agent_profile.

Proof. tests/retained-sessions.test.ts: the route serves toolCallSpans: true for a backend that declares it, and not for the generic backends. Live proof after the disco bridges roll: /v1/capabilities on :8899 answers toolCallSpans: true for an opencode model, and agent-runtime's route preflight admits modelSilenceMs.

Cost / rollback. Adds one field to the JSON answer. Older runtimes ignore unknown keys. Fix forward.

Run ID: run_0692ee937793d1d6d1ea72517f5a9ee7

…ntime can bound a silent model call

#266 made opencode report each tool call at its start; its finished part already
carried the outcome. agent-runtime (#1885) runs modelSilenceMs only on a route that
declares toolCallSpans: true, and no backend declared it, so the bound was off on
every route. The opencode backend now declares it and /v1/capabilities serves it.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-20T01:12:18.385563Z caf32c3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@tangletools tangletools left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved PR — caf32c33

Blanket team auto-approval is intentional. This is not a code review.
No automated review runs on this PR. This approval rests on the rule above alone.

tangletools · auto-approval · reason: blanket_auto_approve · 2026-10-20T01:13:04Z

@drewstone
drewstone merged commit 77c020d into main Oct 20, 2026
1 check passed
@drewstone

Copy link
Copy Markdown
Owner Author

Live proof after merge (01:40Z). discovery-lab moved disco-bridge@8899/8900/8901 to 77c020d at 01:35:44Z. Authenticated GET /v1/capabilities?model=opencode/glm-5.3 on :8899 and :8900 now answers toolCallSpans: true (at cdf9292 the field was absent). agent-runtime 0.335.0's bridgeModelRouteRefusal, run verbatim from the published tarball against :8899 with modelSilenceMs: 900000, returns no refusal. :8901 answers 404 because it has no opencode backend, which is expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants