Repository navigation
Conversation
Port of Cockpit's providerVerdict, kept rule for rule: overloaded, rate limited, a dropped connection and a 5xx pass; signed out, out of allowance, a refused request and anything unrecognised do not. Adds the 1, 2, 4 and 8 minute waits and the carry-on message that lists the outward steps a cut-off turn already took.
…failing the task A delegated child whose run failed on a passing provider error (overload, dropped connection, rate limit, 5xx) used to fail its task and wake the parent at once. Now the task and the parent's wake are held, as they are for a restart continuation, and a provider-runtime.retry effect continues the child with the same delegatedTaskId after 1, 2, 4 and 8 minutes. A lasting or unrecognised error, a fifth cut in a row, or Stop releases the hold and fails the task with the provider's reason; a later success reaches the parent as a normal completion. Before continuing, the worker runs the workspace's .agents/scripts/resume-guard.ts arm when the project has one, so the continued turn is told which outward steps it already completed and the workspace hook blocks exact repeats. If arm fails the turn is not continued and the task fails as it is.
…ettles The resume-guard marker armed before a provider-retry carry-on stayed until its 24-hour TTL, so a later turn in that thread could not repeat an outward step it was asked to. When a task whose child a provider retry touched settles (success, final failure, Stop or task_cancel), the orchestrator now writes a provider-runtime.retry-release effect, and the worker runs resume-guard.ts disarm with the same root and T3_STATE_PATH as arm. A failed disarm is logged and never fails the task.
Thread transfer impact
This comment will update automatically after the next completed run. |
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.
Problem
When a provider cut a delegated child's run short with an error that clears up by itself (overloaded, rate limited, dropped connection, 5xx), T3 marked the parent's delegated task failed and woke the parent right away. The parent then had to notice the failure and start the work again itself.
Solution
providerFailureVerdictis a rule-for-rule port of Cockpit'sproviderVerdict(jagadhis/cockpit Guard git quick actions for diverged or stale branch status pingdotgg/t3code#47/Update cached branch list immediately after checkout pingdotgg/t3code#48) and uses the same categories. These pass: Provider overloaded, Model at capacity, Rate limited, Connection dropped, Provider server error. These do not, and fail the task at once: Signed out, Out of allowance (T3's usage-limit recovery handles that case), Context window full, Model not available, Provider refused it, and any error it does not recognise.provider-runtime.retryoutbox effect is written. It becomes due 1, 2, 4 and 8 minutes after each cut in a row. While the effect is pending or running, the task status and the parent's wake are held by the same path that holds them across a T3 restart (childAwaitsRestartContinuation). When the wait ends, the child is sent a carry-on message as a new run. That run keeps the samedelegatedTaskId. If the continued run succeeds, the parent gets a normal completion.thread.stopandtask_cancelboth end a pending wait at once..agents/scripts/resume-guard.ts(as~/agentsdoes), the worker runsresume-guard.ts armbefore the carry-on, the same way Cockpit does. It points the script at this server's own state database. The stepsarmreturns are listed in the carry-on message, and the workspace hook blocks an exact repeat. Ifarmfails, the turn is not continued and the task fails as it is. When the task settles (success, final failure, Stop ortask_cancel), aprovider-runtime.retry-releaseeffect runsresume-guard.ts disarmwith the same root and state database, so later turns in that thread are not blocked. A failed disarm is logged and does not fail the task. A workspace without the script still gets a carry-on message that tells the child to check what it already did before repeating any comment, review, PR, Linear or Slack write, or thread launch.Size of the change
Anything to be aware of
Warning
feat/sidebar-session-groups, the branch the live T3 checkout runs. The fork'smainis far behind upstream.Note
armboth listing steps and failing, and a disarm being written on every settle after a retry (none after a lasting error), with a failed disarm only logged. The tests write the failure events directly. No real provider overload has gone through a built T3 yet.resume-guard.ts armanddisarmhave not been run from T3 against a real thread; the tests use stubs.Ada, from Jags's crew