Skip to content

fix(plugin): dedupe final thinking snapshots#59

Open
qyhfrank wants to merge 1 commit intoNomadcxx:mainfrom
qyhfrank:fix/stream-partial-snapshots
Open

fix(plugin): dedupe final thinking snapshots#59
qyhfrank wants to merge 1 commit intoNomadcxx:mainfrom
qyhfrank:fix/stream-partial-snapshots

Conversation

@qyhfrank
Copy link

What

  • fix non-stream extractCompletionFromStream() so thinking partial deltas followed by a final accumulated event do not get duplicated
  • export and cover extractCompletionFromStream() with focused unit tests
  • include the new regression test in test:ci:unit

Why

The streaming converters already avoid duplicating final accumulated thinking frames after timestamped partial deltas, but the non-stream aggregation path in src/plugin.ts still appended the final accumulated thinking text unconditionally. That left /chat/completions non-stream responses inconsistent with the streaming path and could duplicate reasoning text.

Verification

  • bun test tests/unit/plugin-stream-extraction.test.ts
  • bun run test:ci:unit
  • bun run build

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