Skip to content

fix(ai): restore Responses tool input semantics - #40553

Merged
rekram1-node merged 1 commit into
v2from
tool-input-finish
Aug 5, 2026
Merged

fix(ai): restore Responses tool input semantics#40553
rekram1-node merged 1 commit into
v2from
tool-input-finish

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • restore malformed Responses function calls as a tool-calls finish boundary
  • retain tool-input-error as the precise non-executable outcome
  • remove the separate parser-level error finish classification

Why

Malformed function arguments are a recoverable tool-level failure, not a provider or transport failure. The model attempted tool use, the runtime records a non-executed tool.input-json failure, and the enclosing agent can return that failure for correction.

The common finish reason has no dedicated tool-error value. tool-calls marks the model tool boundary while tool-input-error carries the exact failure. This matches the existing Chat, Anthropic, and Bedrock behavior. Explicit provider truncation and content-filter reasons retain precedence.

This is a direct restoration of the previous Responses behavior with no additional refactor.

Tests

  • bun test test/provider/openai-responses.test.ts
  • bun typecheck
  • bun x prettier --check packages/ai/src/protocols/open-responses.ts packages/ai/test/provider/openai-responses.test.ts

Requested by: @rekram1-node (Aiden Cline via Slack)

@opencode-agent
opencode-agent Bot force-pushed the tool-input-finish branch from 722177a to 70f51a0 Compare August 5, 2026 01:45
@opencode-agent opencode-agent Bot changed the title fix(ai): retain Responses tool boundary on input errors fix(ai): restore Responses tool input semantics Aug 5, 2026
@rekram1-node
rekram1-node merged commit f9ac6f3 into v2 Aug 5, 2026
6 checks passed
@rekram1-node
rekram1-node deleted the tool-input-finish branch August 5, 2026 01:46
github-actions Bot pushed a commit to ReStranger/opencode that referenced this pull request Aug 5, 2026
* upstream/v2: (28 commits)
  refactor(app): gate unsupported v2 capabilities (anomalyco#40381)
  fix(app): show active search details (anomalyco#40597)
  refactor(app): migrate supported v2 APIs (anomalyco#40378)
  fix(app): reconcile v2 session projections (anomalyco#40376)
  refactor(app): own rendering contracts (anomalyco#40375)
  fix(core): make xAI OAuth device-only (anomalyco#40538)
  test(app): migrate e2e fixtures to v2 (anomalyco#40374)
  fix(core): report missing shell workdir (anomalyco#40542)
  fix(ai): restore Responses tool input semantics (anomalyco#40553)
  fix(ai): classify malformed Responses tool calls (anomalyco#40549)
  feat(tui): streamline tab navigation shortcuts (anomalyco#40551)
  fix(ai): preserve Gemini tool finish semantics (anomalyco#40546)
  fix: retry empty incomplete streams (anomalyco#40535)
  fix(app): finish tool call ID rename (anomalyco#40539)
  refactor: rename tool call ID fields
  fix(client): wait for live service contenders (anomalyco#40515)
  chore(core): drop unreachable AI SDK provider packages (anomalyco#40504)
  fix(tui): update tab titles immediately (anomalyco#40318)
  fix(tui): show branch beside directory (anomalyco#40500)
  feat(vcs): publish branch updates (anomalyco#40371)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant