Skip to content

fix(providers): integrate streaming correctness and golden coverage - #105

Merged
PsiACE merged 4 commits into
mainfrom
fix/responses-lifecycle-replacements
Nov 13, 2026
Merged

PsiACE merged 4 commits into
mainfrom
fix/responses-lifecycle-replacements

Conversation

@PsiACE

@PsiACE PsiACE commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Integrate the provider correctness stack:

  • Chat streams isolate choice zero using a pinned SDK fixture.
  • Six real provider recordings extend the existing Goose/Fantasy golden suite.
  • Empty Responses output-item events preserve subsequent output in the pinned SDK case.
  • Snapshot-only Responses messages/calls retain lifecycle replacements until terminal output, while ordinary text/argument deltas and streamed tool completion remain live.

Stable message IDs and stable call_id values identify snapshot replacements. First-appearance order survives reordered and partial lifecycle lists. There is no identity inference from text contents, output-list positions or provider-specific ID rewriting.

Evidence and scope

The lifecycle input serializes openai-python@59738a2, test_final_output_keeps_completed_lifecycle_replacements, with terminal="null", duplicate=False and tool_id="null". It preserves the upstream event order and sequence numbers. The shared golden README records the exact SHA-256 and license.

This SDK synthetic robustness case covers sparse item indices, reordered/partial lifecycle snapshots, replacement text/tool arguments and null terminal output. It is not a production recording and does not establish support for changing/absent message IDs or combinations involving Copilot. Unsupported hypothetical combinations are not acceptance criteria.

Golden assertions use public responses and the existing streamed/final consistency helper, not parser internals.

Stack

Commit ancestry: main (including #102) → #101 → #103 → #104 → #105.

#103 and #104 target their preceding layer for incremental review. #105 targets main and integrates all four layer commits. Merge #105 with a merge commit only after all four current heads have passing native checks and a matching Landing allow. Preserving ancestry lets GitHub mark the lower layers as indirectly merged. Do not squash/rebase the integration merge.

Validation

  • Candidate: d37984b9040fc8f6da8ae1845c59fd10c395ec2f.
  • uv run pytest -q — 598 passed.
  • uv run prek run --all-files — passed.
  • uv run ty check — passed.
  • Native CI runs on this candidate; Landing is a separate merge gate.
  • The exact upstream lifecycle input fails before the lifecycle fix (empty answer) and passes here (Updated result, one lookup call with {"answer":5}).
  • main and all three preceding layer commits are ancestors of this candidate.

@github-actions github-actions Bot 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.

One blocking finding: message text is reconciled by exact item id, so stream dialect ids that vary between events duplicate the assistant answer. Reproduction and repair direction are in the inline thread.

Comment thread src/republic/formats/responses.py Resolved
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Landing: allow · d37984b

No blocking findings.

@github-actions github-actions Bot 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.

One blocking finding: with an id-less or per-event re-encoded message id, a replacement lifecycle snapshot lands in a second message slot and the stale text is emitted alongside the replacement. Reproduction and repair direction are in the inline thread.

Comment thread src/republic/formats/responses.py Resolved

@github-actions github-actions Bot 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.

One residual gap in the new message-slot reconciliation: with two message items it attaches a partial lifecycle snapshot to the wrong slot and both drops and duplicates text.

Comment thread src/republic/formats/responses.py Resolved

@github-actions github-actions Bot 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.

One remaining duplicate-text path in the new snapshot reconciliation; inline thread below.

Comment thread src/republic/formats/responses.py Resolved
@PsiACE
PsiACE force-pushed the fix/responses-lifecycle-replacements branch from 77348fe to a5fa85d Compare November 13, 2026 16:08
@PsiACE PsiACE changed the title fix(responses): preserve lifecycle output replacements fix(providers): integrate streaming correctness and golden coverage Nov 13, 2026
@PsiACE
PsiACE force-pushed the fix/responses-lifecycle-replacements branch from a5fa85d to d37984b Compare November 13, 2026 16:19

@github-actions github-actions Bot 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.

One blocking finding: Copilot Responses streams duplicate the whole answer when message IDs are re-encoded per event. This re-lands the duplicate-text defect recorded as fixed in #105 (discussion_r4564455101); main and a5fa85d both return the single answer. Detail in the inline thread.

Comment thread src/republic/formats/responses.py Resolved
@PsiACE
PsiACE merged commit 02ab861 into main Nov 13, 2026
10 of 11 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