Repository navigation
fix(openai-chat): recover complete tool calls at EOF on the opencode-go lane - #2271
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe OpenAI Chat adapter now validates tool-call arguments and supports opt-in clean EOF handling. The ChangesOpenAI Chat EOF handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client as /goal client
participant Router as router
participant Registry as opencode-go registry
participant Adapter as openai-chat adapter
participant Upstream as chat-completions upstream
Client->>Router: POST /v1/responses with update_plan
Router->>Registry: resolve provider policy
Registry-->>Router: openaiChatEofTolerance=true
Router->>Adapter: process OpenAI Chat stream
Adapter->>Upstream: send declared tool definitions
Upstream-->>Adapter: tool-call argument deltas
Upstream-->>Adapter: EOF without terminal marker
Adapter-->>Client: completed function call and response.completed
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66d0b660fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * when every pending call has a non-empty name and complete JSON-object arguments; | ||
| * incomplete JSON, missing arguments, and empty streams remain truncation errors. | ||
| */ | ||
| openaiChatEofTolerance?: boolean; |
There was a problem hiding this comment.
Document the new EOF-tolerance provider option
This adds a public OcxProviderConfig option and changes the built-in opencode-go streaming behavior, but the provider configuration reference does not mention openaiChatEofTolerance alongside the analogous anthropicEofTolerance. Operators of other affected OpenAI-compatible gateways therefore cannot discover the opt-in or its fail-closed constraints; add it to the English configuration table and keep the translated references consistent.
AGENTS.md reference: src/AGENTS.md:L28-L28
Useful? React with 👍 / 👎.
Summary
Fixes the two #2260 stream-drop symptoms on the opencode-go lane (Codex App /goal against opencode-go/deepseek-v4-flash):
openaiChatEofToleranceon the provider contract, enabled for opencode-go in the registry: EOF is accepted only when every pending call has a non-empty name and complete JSON-object arguments; partial JSON, missing arguments, and empty streams still fail as truncation.Verification
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Tests