Skip to content

feat(agent,cli): recognize load-timing races as a distinct repair category - #551

Merged
HappyDevs1 merged 1 commit into
mainfrom
feat/007-timing-race-repair
Sep 6, 2026
Merged

feat(agent,cli): recognize load-timing races as a distinct repair category#551
HappyDevs1 merged 1 commit into
mainfrom
feat/007-timing-race-repair

Conversation

@HappyDevs1

Copy link
Copy Markdown
Collaborator

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

  • Adds a third patch option, widen_timeout_seconds, alongside step_yaml/engine_gap.
  • widen_timeout applies it via a narrower path than a full step rewrite: it 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 — the same scenario that used to end in budget-exhausted now passes.

Test plan

  • cargo fmt --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — green except the same pre-existing doctor_ai_e2e failure
  • Live re-run of the multi-drift scenario against the real Fiori tenant, described above

Base automatically changed from feat/007-repair-loop-base to main September 6, 2026 20:32
…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
HappyDevs1 force-pushed the feat/007-timing-race-repair branch from 09c8f37 to 78d6650 Compare September 6, 2026 20:32
@HappyDevs1
HappyDevs1 merged commit 161fd5a into main Sep 6, 2026
9 checks passed
@HappyDevs1
HappyDevs1 deleted the feat/007-timing-race-repair branch September 6, 2026 20:38
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