Skip to content

fix: match v0 fallback retry and streamed completion behavior - #5056

Closed
sxlijin wants to merge 4 commits into
sam/v1-fallback-correctnessfrom
sam/v1-fallback-parity
Closed

sxlijin wants to merge 4 commits into
sam/v1-fallback-correctnessfrom
sam/v1-fallback-parity

Conversation

@sxlijin

@sxlijin sxlijin commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Makes v1 reliability policies select providers at the same wire boundary as v0: typed HTTP deadlines and explicit stream failures can retry/fall back even after a visible prefix. A reset event discards the failed attempt’s accumulated text, metadata and parser state, so the final result contains only the selected attempt.

Successful wire responses stop provider fallback before parsing and finish-reason filtering. Schema correction defaults to one attempt, graceful EOF after a decoded text or metadata event accepts partial output, and max-token termination is accepted by default. Agent and typed streaming runners expose explicit finish-reason allow/deny policies. Cancellation and unsafe tool effects remain non-recoverable.

Converts the nine v0-parity expected failures into passing assertions and adds deadline exhaustion, nested recovery, idle-after-prefix, metadata reset and finish-policy ordering coverage. Depends on the duration-valued HTTP options in #5054; stacked using gh stack.

Validation: all 50 focused reliability tests passed; the full native corpus passed 4,984 tests with 2 intentionally tolerated failures before the final finish-policy ordering fix; compiler snapshots, formatter, CLI builtin listing and changed-file pre-commit hooks passed on the final source. Broad Rust tests and GitHub CI are running.

@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
developer-docs Ready Ready Preview Oct 1, 2026 12:03am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 7a5b5a55-78ce-446a-9ec3-edaf0b5077f4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T23:33:53.829173Z e610519 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e61051986a

ℹ️ 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".

@sxlijin
sxlijin removed this pull request from stack #5055 September 30, 2026 23:59
@sxlijin
sxlijin force-pushed the sam/v1-http-timeouts branch from ec43556 to c530262 Compare September 30, 2026 23:59
@sxlijin
sxlijin force-pushed the sam/v1-fallback-parity branch from 07de3c2 to 1ad33ad Compare September 30, 2026 23:59
@sxlijin
sxlijin changed the base branch from sam/v1-http-timeouts to sam/v1-fallback-correctness September 30, 2026 23:59
@sxlijin
sxlijin added this pull request to stack #5057 September 30, 2026 23:59
@sxlijin
sxlijin removed this pull request from stack #5057 October 1, 2026 00:00
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@blacksmith-sh

blacksmith-sh Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
baml_cli::baml_corpus/baml_test View Logs
baml_tests/corpus::corpus_snapshots View Logs
baml_tests/type_spec::sweep::s15_sweep_baml_src View Logs
baml_tests::streaming_composite_clients/retry_does_not_reopen_after_visible_prefix View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Binary size checks failed

❌ 2 violations · ✅ 1 passed

⚠️ Please fix the size gate issues or acknowledge them by updating baselines.

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 61.5 MB 25.6 MB file 73.1 MB -11.6 MB (-15.8%) OK
❌ packed-program Linux 🔒 40.8 MB 16.1 MB file 28.9 MB +11.8 MB (+40.9%) FAIL
❌ bridge_wasm WASM 28.7 MB 🔒 8.0 MB gzip 5.8 MB +2.2 MB (+38.3%) FAIL

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.

Details & how to fix

Violations:

  • packed-program (Linux) file_bytes: 40.8 MB exceeds limit of 29.8 MB (exceeded by +11.0 MB, policy: max_file_bytes)
  • packed-program (Linux) file_delta_pct: +40.9% exceeds limit of 3.0% (exceeded by +37.9pp, policy: max_delta_pct)
  • bridge_wasm (WASM) gzip_bytes: 8.0 MB exceeds limit of 5.9 MB (exceeded by +2.1 MB, policy: max_gzip_bytes)
  • bridge_wasm (WASM) gzip_delta_pct: +38.3% exceeds limit of 3.0% (exceeded by +35.3pp, policy: max_delta_pct)

Add/update baselines:

.ci/size-gate/wasm32-unknown-unknown.toml:

[artifacts.bridge_wasm]
file_bytes = 28679122
gzip_bytes = 7974453

.ci/size-gate/x86_64-unknown-linux-gnu.toml:

[artifacts.packed-program]
file_bytes = 40767288
gzip_bytes = 16082158

Generated by cargo size-gate · workflow run

This branch was successfully deployed

1 active deployment
Preview – developer-docs — 1ad33ad5 Deployed Oct 1, 2026 by vercel[bot]
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