Repository navigation
Open
Labels
effort/mMedium: expected under 1 day of workMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/humanFiled directly by a humanFiled directly by a humantask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Description
Tool-call hardening — small items from the 2026-11-05 audit (checklist)
Each item is small, precisely located, and evidenced in ~/workspace/scratch/toolcall-audit-2026-11-04/code-inventory.md (section refs below). They share one theme: silent degradation at the tool-call layer. Fix opportunistically; check items off here.
- §0/§15-2 — Error tool results carry no wire-level error marker in the chat, responses, mistral, or antigravity lowerings (
ProviderShared.toolResultText, protocols/shared.ts): a failed tool is indistinguishable from a successful text result except by reading the text. Decide a convention (e.g. a stable error prefix or structured wrapper per protocol that supports one) and apply it consistently, or record here why text-only is the accepted end state. - §0/§15-3 — Invalid/truncated JSON arguments at stream finish are fatal (shared
parseToolInput, protocols/shared.ts:190-191): no protocol attempts repair. At minimum, the error should name the tool + carry the raw argument text for diagnosis; consider a bounded repair (balanced-brace completion) behind a flag with tests. - §2-G1 — Mistral tool-id hash collisions across requests: the 9-char FNV normalizer (
protocols/utils/mistral-tool-id.ts) is per-request; two different long ids in different requests of one session can hash to the same 9-char id across requests. Persist the mapping in providerMetadata so a session's mapping is stable. - §2-G3 — Mistral
toolTextscalar arguments: a non-object scalarfunction.argumentsvalue from a misbehaving endpoint isencodeJson'd into a quoted string and fails downstream object expectations. Coerce or error explicitly at the protocol boundary. - §5-G1 — Meta config/provider ambiguity: the config block spells
@ai-sdk/openaibut lands on fork-native Meta Responses via the aisdk-native HOSTS rewrite; a raw AI-SDK load path (packages/core/src/aisdk.ts:481) would speak generic OpenAI Responses to api.meta.ai with different defaults (nostore:false, no encrypted-content include, no hosted-tool adapter). Make the config comment + the rewrite coverage explicit so the two paths can't diverge silently. (Provider is currently disabled deliberately; this is about the flip being safe when it happens.) - §11-G1 — No DeepSeek-specific tool fixtures: fork-native deepseek rides the shared openai-chat tests; add
deepseek.test.tsfixtures for its real stream quirks (reasoning_content interleaved with tool deltas, usage placement). - §1-G2 — No vibe-specific tool-call test: vibe-direct inherits Mistral protocol coverage by reference; add one fixture exercising the Vibe presets (
reasoningEffort:"high"+ a tool call) so a preset/protocol interaction regression is caught. - §0 — Namespaced tool-name collision:
flattenToolRequestjoins namespace+name with_unescaped; a tool literally nameda_bin namespaceacollides with toolbin namespacea. Theoretical today; add a guard or a test pinning the behavior.
Acceptance criteria
- Each checklist item is either landed with tests or explicitly deferred on this issue with a reason — no item silently dropped.
- Error tool results are distinguishable from successful text results on the wire under the chosen convention, across the chat/responses/mistral/antigravity lowerings named in the first item.
- The audit inventory's section references are resolved item by item as the boxes are checked.
Metadata
Metadata
Assignees
Labels
effort/mMedium: expected under 1 day of workMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)Ordinary priority (the default)source/humanFiled directly by a humanFiled directly by a humantask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Activity
dezren39 commentedon Nov 5, 2026
Cross-link: #1684/#1685 (disposition tables + one fidelity corpus for the three tool-schema translators) is the natural home for the schema-side items on this checklist — the fidelity corpus should pin the error-marker and schema-projection behaviors decided here rather than duplicating them as one-off tests. Also related: #1557 (antigravity convertSchema drops const) is the same converter family as the items the antigravity residual audit is checking.
dezren39 commentedon Nov 5, 2026
Intake review
Related: audit inventory at
~/workspace/scratch/toolcall-audit-2026-11-04/code-inventory.md(named in the body). No merged PR referencing #1707 was found in a title/body search this run.Notes: a checklist issue — the acceptance criteria are about closure discipline (land-or-defer per item) plus the wire-level error marker, which is the item with protocol-wide blast radius. Suggested approach: the error-marker convention first, since other items may depend on it.
— Fleet monitor intake (repo-fleet-monitor), 2026-11-05. Merged-PR title/body search count for this issue number at intake: 0.
dezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 5, 2026
🤖 Agent note · triage verdict
3fe37e8a-c61b-419c-9e97-769ecd264d5d74861057fce7346631bb5e356a70f832aabdb87aVerdict: keep #1707 open as an actionable checklist; no matching PR exists. Source inspection confirms several items, while test coverage is partial for DeepSeek and Vibe. No code changes or runtime tests were in scope for this triage.
Current-main findings
packages/ai/src/protocols/shared.tsserializes error tool results without a wire-level marker (around 244–254), andparseToolInputomits raw arguments from its error (190–191). These are shared protocol helpers and should be resolved before provider-specific work.protocols/utils/mistral-tool-id.ts;mistral-chat.ts), and scalar non-string arguments are JSON-encoded bytoolText(595–599). Keep these as separate Mistral fixes with explicit collision and scalar-input oracles.packages/core/src/aisdk-native.tshas a provider-host rewrite, while the generic AI-SDK mapping path can still resolve differently. Add an explicit config comment and test before enabling that provider; no flip is proposed here.packages/ai/test/provider/openai-compatible-chat.test.tsincludes a DeepSeek tool-request lowering fixture. It does not cover the cited stream interaction (reasoning_contentwith tool deltas and usage placement). Vibe has outbound tool lowering invibe.test.tsand a separate high-reasoning default test, but no combined preset + streamed tool-call assertion.flattenToolsjoins namespace paths with_and leaves root tool names unchanged. The actual collision is root toola_bversus leafbin namespacea; the issue's stated same-namespacea_a_bvsa_bexample does not collide. The collision concept is valid, but decide/test the actual case or explicitly defer it.Recommended order: (1) choose and test the cross-protocol error marker; (2) improve invalid/truncated-JSON diagnostics with a bounded raw excerpt (repair is a separate policy choice); (3) handle the Mistral ID and scalar-input cases; (4) add the DeepSeek/Vibe interaction fixtures with those changes; (5) document/test Meta routing before enablement; (6) decide whether the corrected namespace collision gets a guard or an explicit defer. Keep per-item acceptance honest—land with tests or record a reason here.
The referenced scratch audit file
~/workspace/scratch/toolcall-audit-2026-11-04/code-inventory.mdis absent on this laptop; the issue body and current source refs were enough to scope this triage. Attach a durable copy/link if later work depends on audit evidence beyond the checklist. Priority remains normal; no hard-stop label or Drew-only decision was found.dezren39 commentedon Nov 5, 2026
🤖 Agent note · done
3fe37e8a-c61b-419c-9e97-769ecd264d5dtriaged.