Repository navigation
Keep the typed answer deadline when an answer wait starts after recovery's budget - #22
Merged
Merged
Conversation
…ery's budget An answer wait reached just before the recovery episode ended reported the typed answer deadline. Reached just after it, the shared budget guard returned an untyped error without polling the wait. Provider eligibility depends on the type, so the same expiry withheld the Grok fallback on one side of that instant. The answer wait now always runs. Its limit is zero once the episode has ended, so it mints its own typed deadline. The acknowledgement keeps the guard: an acknowledgement that does not land stays ineligible.
Tokio polls a timeout's future before its deadline, so the wait could still run after expiry. A wait whose limit predated the expiry then went Pending and returned the untyped timeout instead of the answer deadline. Return the typed deadline without polling the wait. A wait still unsettled when the deadline passes stays ineligible, as a hung read says nothing of the provider.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
An answer wait reached just after the bounded original-target observation ended gave an untyped error, whereas just before the same limit it gave
Failure::AnswerDeadline.switch_failureonly accepts typed failures, so a user with Grok fallback consent lost the fallback over a few milliseconds. The wait now returns the typed deadline without polling once the budget has expired.Evidence
Original-target observation budget expired; recovery retained, 3 of 3. An expired budget with a pending future gavedid not settle before its deadline, also untyped.After: both regression tests pass, 5 rounds plus 1, with zero polls of the expired wait.
Target disposition deadline reachedona5ff8be: with an injected 150 ms slow write it failed 3 of 3 ona5ff8beand passed 3 of 3 on6c58009, so Record a decided tab retirement even when the write outlasts its budget #20 already fixed its likely cause. No change here.cargo fmt --check,cargo build --lockedandcargo clippy --all-targets --locked -- -D warningspass.cargo test --lib, one thread: 671 passed, 0 failed, 14 ignored.bounded_provider_readtests pass 3 of 3 rounds.Merge danger
Door: two-way. Blast radius: answer fallback
A wait reached after expiry can now be fallback eligible. It runs only after the send succeeded and the acknowledgement landed, and
observerechecks identity, receipt, dispatch and authority before the typed error leaves. That is from reading the code, not running the Grok switch end to end.Unverified
bridge_doctor_accepts_and_ignores_verbose_like_commanderandlocal_browser_cli_and_mcp_admit_foreground_and_detached_rust_workersfailed locally, and both also fail onmain.CHANGELOG.md,src/browser_runner.rsandsrc/browser_runner_tests.rs.