Skip to content

fix(platform): back off harness rate limits - #4952

Merged
yannickmonney merged 4 commits into
mainfrom
fix/harness-429-capacity
Oct 13, 2026
Merged

yannickmonney merged 4 commits into
mainfrom
fix/harness-429-capacity

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Problem

A Codex process that exited after exhausting its provider retry loop (exceeded retry limit, last status: 429 …) could end without a turn-ended event. Tale recorded it as a generic harness_error, immediately re-kicked it, and amplified provider pressure.

Change

  • Preserve the exact runner 429 envelope at the harness boundary and classify it as model_capacity.
  • Apply the existing 60-second model-capacity retry floor to task runs and workflow agent steps.
  • Keep status and broker-failure evidence on the run, while unknown exit messages retain the existing crash behavior.

Validation

  • 134 focused Vitest tests passed across Codex parsing, external-turn classification, task-host settlement, automation retry, and workflow host paths.
  • @tale/platform typecheck passed with an 8 GiB Node heap.
  • Affected-file Oxlint, formatting hooks, conflict guard, SAST hook, and git diff --check passed.

@yannickmonney
yannickmonney added this pull request to the merge queue Oct 13, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 13, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a manual request Oct 13, 2026
@yannickmonney yannickmonney reopened this Oct 13, 2026
@yannickmonney
yannickmonney merged commit c77c44f into main Oct 13, 2026
@yannickmonney
yannickmonney deleted the fix/harness-429-capacity branch October 13, 2026 18:46
tale-code-bot added a commit that referenced this pull request Oct 30, 2026
A workflow agent step that Codex ended on its terminal "Selected model is
at capacity" refusal already settled as model_capacity and held its
re-kick for a minute (#4952), but the retry plan still burned the account
the model refused, so the re-kick vended past a healthy account. The plan
now counts the failure as before and keeps the account in the pool, as
the task lane does.

The held start re-checked only the run's status and cursor, and accepted
a cursor that still named the settled predecessor. A walker that lost the
run between its kick and its park left a start that launched an unwaited
turn once the hold ended. The kick now hands its walker's claim to a held
start, readAgentCursor answers the run's claim and lease, and a held start
runs only while its run is parked on it or that claim still holds the run.
Starts at once keep the lenient gate.
tale-code-bot added a commit that referenced this pull request Oct 30, 2026
A workflow agent step that Codex ended on its terminal "Selected model is
at capacity" refusal already settled as model_capacity and held its
re-kick for a minute (#4952), but the retry plan still burned the account
the model refused, so the re-kick vended past a healthy account. The plan
now counts the failure as before and keeps the account in the pool, as
the task lane does.

The held start re-checked only the run's status and cursor, and accepted
a cursor that still named the settled predecessor. A walker that lost the
run between its kick and its park left a start that launched an unwaited
turn once the hold ended. The kick now hands its walker's claim to a held
start, readAgentCursor answers the run's claim and lease, and a held start
runs only while its run is parked on it or that claim still holds the run.
Starts at once keep the lenient gate.
tale-code-bot added a commit that referenced this pull request Oct 30, 2026
A workflow agent step that Codex ended on its terminal "Selected model is
at capacity" refusal already settled as model_capacity and held its
re-kick for a minute (#4952), but the retry plan still burned the account
the model refused, so the re-kick vended past a healthy account. The plan
now counts the failure as before and keeps the account in the pool, as
the task lane does.

The held start re-checked only the run's status and cursor, and accepted
a cursor that still named the settled predecessor. A walker that lost the
run between its kick and its park left a start that launched an unwaited
turn once the hold ended. The kick now hands its walker's claim to a held
start, readAgentCursor answers the run's claim and lease, and a held start
runs only while its run is parked on it or that claim still holds the run.
Starts at once keep the lenient gate.
tale-review-bot pushed a commit that referenced this pull request Oct 30, 2026
A workflow agent step that Codex ends on its terminal "Selected model is
at capacity. Please try a different model." already settled as
model_capacity from the shared parser's typed kind, also after an exec
checkpoint is restored, and held its re-kick for a minute (#4952). Its
retry plan still burned the account the model refused, so the re-kick
stepped past a healthy account. The plan now counts the failure as
before and keeps the account in the pool, as the task lane does. Real
account failures still burn theirs.

A held start rechecked only the run's status and cursor, and it accepted
a cursor that still named the settled predecessor. So a start held by a
walker that lost the run launched a turn nobody waits on once the hold
ended. The retry kick now hands its walker's claim to the start it
holds, readAgentCursor answers the run's claim and lease, and a held
start runs only while its run is parked on it or that claim still holds
the run. Starts at once keep the lenient gate.

Unit tests drive the pinned Codex lines through the real drive window
(initial, resumed and checkpoint-restored refusals, and incidental
text), and through the retry plan, the stepper and the start gate. A
backend integration lane proves the persisted path on PostgreSQL:
- one exec-fenced settle;
- one start held a minute on the same conversation and account;
- no second kick from a duplicate step;
- a resumed retry that the model refused again;
- a cancelled run and a lost walker, both refused before any sandbox
  work;
- an ordinary failure that still burns its account.
The run docs (EN/DE/FR) say how an agent step retries a model at
capacity.

Closes #4530
Task: TALE-90
tale-code-bot added a commit that referenced this pull request Oct 30, 2026
A workflow agent step that Codex ends on its terminal "Selected model is
at capacity. Please try a different model." already settled as
model_capacity from the shared parser's typed kind, also after an exec
checkpoint is restored, and held its re-kick for a minute (#4952). Its
retry plan still burned the account the model refused, so the re-kick
stepped past a healthy account. The plan now counts the failure as
before and keeps the account in the pool, as the task lane does. Real
account failures still burn theirs.

A held start rechecked only the run's status and cursor, and it accepted
a cursor that still named the settled predecessor. So a start held by a
walker that lost the run launched a turn nobody waits on once the hold
ended. The retry kick now hands its walker's claim to the start it
holds, readAgentCursor answers the run's claim and lease, and a held
start runs only while its run is parked on it or that claim still holds
the run. Starts at once keep the lenient gate.

Unit tests drive the pinned Codex lines through the real drive window
(initial, resumed and checkpoint-restored refusals, and incidental
text), and through the retry plan, the stepper and the start gate. A
backend integration lane proves the persisted path on PostgreSQL:
- one exec-fenced settle;
- one start held a minute on the same conversation and account;
- no second kick from a duplicate step;
- a resumed retry that the model refused again;
- a cancelled run and a lost walker, both refused before any sandbox
  work;
- an ordinary failure that still burns its account.
The run docs (EN/DE/FR) say how an agent step retries a model at
capacity.

Closes #4530
Task: TALE-90
tale-code-bot added a commit that referenced this pull request Oct 31, 2026
A workflow agent step that Codex ends on its terminal "Selected model is
at capacity. Please try a different model." already settled as
model_capacity from the shared parser's typed kind, also after an exec
checkpoint is restored, and held its re-kick for a minute (#4952). Its
retry plan still burned the account the model refused, so the re-kick
stepped past a healthy account. The plan now counts the failure as
before and keeps the account in the pool, as the task lane does. Real
account failures still burn theirs.

A held start rechecked only the run's status and cursor, and it accepted
a cursor that still named the settled predecessor. So a start held by a
walker that lost the run launched a turn nobody waits on once the hold
ended. The retry kick now hands its walker's claim to the start it
holds, readAgentCursor answers the run's claim and lease, and a held
start runs only while its run is parked on it or that claim still holds
the run. Starts at once keep the lenient gate.

Unit tests drive the pinned Codex lines through the real drive window
(initial, resumed and checkpoint-restored refusals, and incidental
text), and through the retry plan, the stepper and the start gate. A
backend integration lane proves the persisted path on PostgreSQL:
- one exec-fenced settle;
- one start held a minute on the same conversation and account;
- no second kick from a duplicate step;
- a resumed retry that the model refused again;
- a cancelled run and a lost walker, both refused before any sandbox
  work;
- an ordinary failure that still burns its account.
The run docs (EN/DE/FR) say how an agent step retries a model at
capacity.

Closes #4530
Task: TALE-90
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