Skip to content

fix(coding-agent): support OpenAI tool schemas - #61

Merged
Issacboy123 merged 3 commits into
mainfrom
fix/openai-update-plan-schema
Aug 15, 2026
Merged

Issacboy123 merged 3 commits into
mainfrom
fix/openai-update-plan-schema

Conversation

@Issacboy123

Copy link
Copy Markdown
Contributor

Summary

This PR fixes OpenAI Responses requests that reject update_plan and agent_action because their parameter schemas use anyOf at the object root. Both tools now publish plain object schemas that remain valid after OpenAI payload conversion.

Reasoning

OpenAI does not accept composition keywords at the function-parameter root, so the schemas cannot express operation unions there. Plain object properties preserve provider compatibility, while runtime validation continues to enforce the exclusive update-or-clear and message-or-interrupt contracts.

Checking the serialized OpenAI payload and every built-in schema root covers the provider boundary where the failures occurred without making a real provider request or requiring credentials.

Changes

  • Replaced the top-level anyOf schema with a plain object containing optional plan, clear, and explanation properties.
  • Replaced the agent_action union with a plain object schema and preserved message and interrupt semantics in runtime validation.
  • Added direct assertions that prohibited composition keywords are absent from the schema root.
  • Added a mocked OpenAI Responses interaction that verifies the serialized tool schema remains compatible.
  • Added coverage enforcing compatible roots across every built-in coding and subagent tool schema.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/update-plan-tool.test.ts test/tool-schema-compat.test.ts test/suite/subagent-actions.test.ts
  • npm run check

@Issacboy123 Issacboy123 self-assigned this Aug 15, 2026
@Issacboy123
Issacboy123 requested a review from Pepps233 August 15, 2026 22:45

@Pepps233 Pepps233 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm; tested with deepseek & codex auth

@Issacboy123
Issacboy123 merged commit 8d4741f into main Aug 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants