Skip to content

fix(openai): preserve final arguments and suppress duplicate completions - #94

Merged
Kinfe123 merged 2 commits into
mainfrom
fix/openai-completion-events
Oct 30, 2026
Merged

Kinfe123 merged 2 commits into
mainfrom
fix/openai-completion-events

Conversation

@Kinfe123

Copy link
Copy Markdown
Collaborator

The OpenAI Responses adapter restarted completed IDs before checking duplicate suppression and ignored final arguments when a call was already active. Replaying a completion emitted a second result; missing or incomplete deltas could fail even when the completion supplied valid JSON.

Route completion events through the shared completion handler with the provider's final arguments. This preserves implicit starts, manual history, explicit ID reuse, and snapshot behavior while applying the existing byte/depth limits to final replacements.

Added regression coverage for manual and managed readers, both snapshot modes, duplicate events, matching/replaced final inputs, EOF finalization, and terminal failure cleanup. All four new tests fail against the previous implementation.

Validation: pnpm check (201 JavaScript tests, 11 Rust tests, type/syntax checks, Rust formatting and clippy), pnpm pack:check, and pnpm test:browser using the documented installed-Chrome override.

@Kinfe123
Kinfe123 merged commit 6788e24 into main Oct 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant