Skip to content

Fail runs when tool repair budget is exhausted - #969

Merged
Y1fe1Zh0u merged 1 commit into
dataelement:v1.11.4from
Y1fe1Zh0u:fix/tool-repair-limit-fails-run
Aug 14, 2026
Merged

Fail runs when tool repair budget is exhausted#969
Y1fe1Zh0u merged 1 commit into
dataelement:v1.11.4from
Y1fe1Zh0u:fix/tool-repair-limit-fails-run

Conversation

@Y1fe1Zh0u

Copy link
Copy Markdown
Collaborator

What changed

  • Change Tool repair-budget exhaustion from waiting_user to terminal failed.
  • Clear pending Tool calls and waiting state when the limit is reached.
  • Preserve the specific repair-limit reason as a structured Runtime error.
  • Update the Runtime regression test to require terminal failure and prevent another model call.

Why

The previous behavior left the Run parked in waiting_user. The backend delivered a plain assistant message, while the UI could continue looking active and the Run retained its lane. A depleted repair budget is an execution failure and should use the existing run_failed and frontend runtime-error path.

Compatibility

The legacy resume handler remains in place so already-persisted repair-limit waiting_user checkpoints can still be resumed. New runs terminate instead.

Validation

  • 62 Runtime node, checkpoint, chat stream, and repair-budget tests passed
  • Scoped Ruff passed
  • git diff --check passed

Known gap

Live WebSocket rendering against the deployed frontend was not exercised.

A depleted Tool repair budget previously parked the Run in waiting_user, leaving users with an apparently active task and only a plain assistant message. Treat the exhausted budget as a structured terminal failure so the existing run_failed delivery and frontend error paths are used.

Constraint: Historical waiting_user checkpoints for repair exhaustion must remain resumable.

Rejected: Add a special frontend waiting card | the exhausted repair budget is not recoverable without starting a new turn and should release the Run lane.

Confidence: high

Scope-risk: narrow

Directive: Keep repair-budget exhaustion terminal unless a bounded automatic recovery mechanism is introduced.

Tested: 62 Runtime node, checkpoint, chat stream, and repair budget tests; scoped Ruff; git diff --check.

Not-tested: Live WebSocket rendering against the deployed frontend.
@Y1fe1Zh0u
Y1fe1Zh0u merged commit a0bc539 into dataelement:v1.11.4 Aug 14, 2026
1 check was pending
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