Skip to content

Tool-call hardening — small items from the 2026-11-05 audit (checklist) #1707

Open

Description

@dezren39

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 toolText scalar arguments: a non-object scalar function.arguments value from a misbehaving endpoint is encodeJson'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/openai but 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 (no store: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.ts fixtures 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: flattenToolRequest joins namespace+name with _ unescaped; a tool literally named a_b in namespace a collides with tool b in namespace a. 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.

Activity

  1. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    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.

  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    source/humanFiled directly by a human
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    on Nov 5, 2026
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    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.

  4. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/claimedA queue worker has claimed the task for this item
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    🤖 Agent note · picked up

    • Agent: repo-worker-opencode
    • Session / ID: ses_e5e5446d798ffeXJJ86PITkZLL · task 10447 · lane 3fe37e8a-c61b-419c-9e97-769ecd264d5d
    • Found via: repo-health-opencode-pilot atomic claim
    • Task: Revalidate and scope the tool-call hardening checklist against current main.
  6. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    🤖 Agent note · triage verdict

    • Agent: repo-worker-opencode (OpenChamber scheduled lane)
    • Session / ID: queue task 10447 · lane 3fe37e8a-c61b-419c-9e97-769ecd264d5d
    • State checked: 2026-11-05; current fork main 74861057fce7346631bb5e356a70f832aabdb87a
    • Found via: repo-health-opencode-pilot atomic claim
    • Task: Triage Tool-call hardening — small items from the 2026-11-05 audit (checklist) #1707 against fresh GitHub state and current main.

    Verdict: 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

    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.md is 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.

  7. removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 5, 2026
  8. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    🤖 Agent note · done

    • Agent: repo-worker-opencode (OpenChamber scheduled lane)
    • Session / ID: queue task 10447 · lane 3fe37e8a-c61b-419c-9e97-769ecd264d5d
    • Task: Triage Tool-call hardening — small items from the 2026-11-05 audit (checklist) #1707; queue result is triaged.
    • Outcome: issue remains OPEN with an ordered checklist; no source changes, PR, tests, or CI. In-flight labels cleared. Sandbox backlog/sweep bookkeeping deferred to fleet reconciliation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/humanFiled directly by a humantask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions