feat(agent,cli): recognize load-timing races as a distinct repair category - #551
Merged
Conversation
4 tasks
…egory
The repair loop had two moves: rewrite a step's text, or declare it an
engine gap. That meant a genuine timing race — the target was right,
the page just hadn't settled — burned an attempt guessing new (wrong)
text instead of just waiting longer, since there was no way to say
"the target is fine, give it more time."
Adds a third option to the patch contract: widen_timeout_seconds. It
takes a narrower apply path than a full step rewrite (widen_timeout
regex-replaces only the `within Ns` window, capped at 120s) so a
timing-race fix can't also change what the step is waiting for.
AgentError::PreviousStepIncomplete ("the page reports: still loading")
now gets its own diagnosis category, page-not-ready-transient, instead
of falling into the generic engine-gap bucket, so the prompt can ask
the model to distinguish "wrong target" from "right target, not
settled yet".
Verified live: replayed the exact multi-drift scenario that previously
exhausted its attempt budget on a real Fiori tenant. This time the
timing-race step got its wait window widened (60s -> 120s) instead of
a text guess, and the flow converged to a pass within budget.
HappyDevs1
force-pushed
the
feat/007-timing-race-repair
branch
from
September 6, 2026 20:32
09c8f37 to
78d6650
Compare
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
Stacked on #550 (the base repair loop) — this is PR 3/4.
The repair loop had two moves: rewrite a step's text, or declare it an engine gap. That meant a genuine timing race — the target was right, the page just hadn't settled — burned an attempt guessing new (wrong) text instead of just waiting longer, since there was no way to say "the target is fine, give it more time."
widen_timeout_seconds, alongsidestep_yaml/engine_gap.widen_timeoutapplies it via a narrower path than a full step rewrite: it regex-replaces only thewithin Nswindow, capped at 120s, so a timing-race fix can't also change what the step is waiting for.AgentError::PreviousStepIncomplete("the page reports: still loading") now gets its own diagnosis category,page-not-ready-transient, instead of falling into the genericengine-gapbucket, so the prompt can ask the model to distinguish "wrong target" from "right target, not settled yet."Verified live
Replayed the exact multi-drift scenario that previously exhausted its attempt budget on a real Fiori tenant. This time the timing-race step got its wait window widened (60s → 120s) instead of a text guess, and the flow converged to a pass within budget — the same scenario that used to end in
budget-exhaustednow passes.Test plan
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace— green except the same pre-existingdoctor_ai_e2efailure