Repository navigation
Description
Found
Live web-UI test 2026-09-20, session ses_f4104e6d4ffe7HrL3x8VDcqsgA, project C:\GitHub\opencode.
Prompt: "Use keystone-dynamic_search-tools to find the list-orgs tool, then run it via keystone-dynamic_execute-tool..."
The request went through the REST path (static API key) with 119 native tools provided (diagnostics: INFERENCE_REQUEST msgs=2 tools=119). Instead of a native tool_calls response, the model (qwen3.8-27b-dflash2, on-prem) returned finish_reason=stop with assistant TEXT containing a pseudo tool call:
Bonjour ... <tool_call>
<{"name": "keystone-dynamic", "arguments": {"action": "search-tools", "query": "list-orgs"}}
</tool_call>
No tool executed; the turn "succeeded" showing raw markup to the user.
Why it is not covered by #19
#19 fixed the MCP bridge path (text protocol is the only mechanism there, so the tolerant brace-matching extractor parses it). On the REST path native function calling is used and the plugin fetch wrapper never inspects the streamed assistant text, so drift is invisible: not executed, not charged to the escalation tracker, no human-gate.
Options (needs a design decision - out of plugin scope)
- Session-processor hook: after a text-only final assistant message, run the (now shared) tolerant extractor; if it finds calls, either synthesize tool parts or re-prompt with a "use native tools" correction.
- Wire the existing-but-unused
experimental.text.toolplugin hook in core so a plugin can convert assistant text into tool parts. - Accept: rely on the model; the human-gate already covers repeated bridge-path failures.
Notes
- Intermittent: the same prompt succeeded with native search-tools earlier the same day; the model also emitted a hallucinated subcommand shape (name="keystone-dynamic", action="search-tools") that is not a real tool.
- The extractor is exported from plugin/synapse.ts (extractToolCallsFromModelOutput) and unit-tested (test/plugin/synapse-drift.test.ts) - reusable for option 1/2.
- Related: Release EscalationTracker session state on session.deleted #15 (closed), fix(synapse): catch malformed tool calls + release session tracker slots #16/fix(synapse): recover mismatched-close tool calls + charge drift as malformed-output #19 (bridge-path drift + mismatched-close, merged).
Activity
Alter-Igor commentedon Sep 20, 2026
Additional evidence (same session, next turn)
The model emitted another malformed variant:
<tool_callwith NO closing>before the payload:Verified directly against the shipped extractor (
extractToolCallsFromModelOutput, post-#19): returns 0 calls. #19's tolerant scanner keys on the full<tool_call>open tag, so the missing->shape slips through.This is the argument for the structural fix over more regex: the on-prem model produces an open-ended set of malformed text tool calls (wrong close tag, stray
<, missing>, hallucinated subcommand names likekeystone-dynamic+action). Each is individually parseable but collectively unbounded. Option 1/2 in the body (session-processor hook or wiringexperimental.text.tool) is the right layer.Also observed (separate, filed as #21): the model falsely refused, claiming
synapse_probeandcoder_lesson_listwere "not available" when both were present in the 119-tool list — likely confused by thesynapse_probe(plugin) vssynapse-probe(CAS bridge) name collision.Alter-Igor commentedon Sep 21, 2026
Third drift family observed (2026-09-21)
While testing multiple models through the web UI (opencode serve + packages/app), deepseek/deepseek-v4-flash-0731 emitted its NATIVE tool-call markup as assistant text:
The user's session (C:\GitHub\proto-app-sharedo-audit) showed the raw block as the assistant reply; the grep never ran.
Why this matters for the design decision
Related
Alter-Igor commentedon Nov 3, 2026
Project Manager Board Registration (OPS-006-00 / WT-PM-01..07):
Alter-Igor commentedon Nov 3, 2026
ARCH-GATE-01: PASS | model=google/gemini-3.8-flash (served=google/gemini-3.8-flash) | workstream=WS-07 | branch=synapse-worker-auth | scope=alterspective/sandbox-worker/**, packages/opencode/src/plugin/{synapse,synapse-models}.ts, src/session/prompt.ts, .opencode/tool/synapse-probe.ts$(System.Collections.Hashtable.ws), worktree $ (System.Collections.Hashtable.worktree)).
🔒 HELD by Program Director (
OPS-006-00 Checkpoint: Status=In Progress, Stage=Current.
fix(synapse): address CodeRabbit review feedback on PR #281 (#123, #257…
fix(synapse): pkce auth fallback, served-model sideband, and lockdown…