Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped provenance correction for existing automatic quota-reset continuations, preserving timing, identity, prompt text, and deduplication. It adds focused regression coverage without changing product defaults, schemas, enforcement, or deployment behavior. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Recovery continuation dispatch apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.ts, apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.test.ts |
Recovery dispatches use agent attribution. The test checks that dispatch waits for quota reset, verifies its fields, and confirms the command ID remains the same after reset. |
Continuation follow-up intake apps/server/src/orchestration-v2/Orchestrator.ts, apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts |
The orchestrator admits usage-limit continuations as subagent follow-ups. Tests cover quota-recovery continuations with completed and stopped outcomes. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Possibly related issues
- pingdotgg/t3code#21716: This change updates continuation attribution, but does not address the issue's stale overdue arming.
- pingdotgg/t3code#21837: This change admits quota continuations into follow-up handling, but the issue's final-result delivery defect remains separate.
- pingdotgg/t3code#27037: This change adds parent-tracked replacement follow-ups for quota recovery, but does not address child-result aggregation.
Possibly related PRs
- pingdotgg/t3code#27711: Both changes modify the usage-limit recovery command lifecycle.
- pingdotgg/t3code#24511: Both changes modify usage-limit recovery continuations and their provenance.
- pingdotgg/t3code#27000: This PR supplies recovery timing for the continuation path changed here.
Suggested reviewers: juliusmarminge
Merge Risk: 
Minimal · up to bc9e9
-
No actionable issue is established that would prevent merging. Live provider quota-reset recovery has not been exercised.
Security architecture risk: 
Low · up to 6aa0e
-
The correction preserves quota eligibility and recovery identity checks and introduces no new endpoint. However, automated authorship also bypasses child-task coordination used for parent tracking. The resulting lifecycle effect needs resolution for automatically resumed child work.
Retained concerns
- Medium · reliability · inferred: Quota recovery can lose parent task ownership when resuming an app-owned child thread after its original task has produced a result. Previously, user/server provenance entered parent serialization and follow-up registration. Agent/server now skips both paths, while delegatedTaskId inheritance applies only to restart continuations. A newly started quota-recovery run can therefore lack the replacement parent task record and completion tracking that the previous provenance supplied. This is a lifecycle-containment concern; its complete effect on parent Stop remains unverified.
Security review details
-
Security Blast Radius
- inferred — The identified exposure is existing automatic recovery within a thread and, conditionally, its app-owned parent-child execution tree. The inspected change does not establish new cross-tenant reachability, credentials, or provider privileges.
Security Findings and Attack Paths
- inferred — No attacker-controlled authorization bypass was established. The supported concern is an internal execution-ownership transition: automatic recovery can stop entering parent follow-up bookkeeping. Whether this also allows recovered child work to escape parent Stop requires further evidence.
Trust Boundaries and Controls
- observed — Thread-local dispatch locking remains in place. Provider-native subagent threads also retain their read-only dispatch rejection; that control does not resolve the separate app-owned child-thread ownership question.
Resilience and Maintainability Implications
- observed — Repeated recovery construction retains identifiers derived from thread, run, reset, and recovery request identity. Dispatch-time revalidation rejects stale recovery state, including cancellation and snooze changes, rather than trusting the earlier sweep snapshot.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "fix(server): attribute quota continuations to the agent" matches the main change. The diff sets the usage-limit continuation message
createdByfrom"user"to"agent"in UsageLimitRecoveryWorker.ts. It also updates the Orchestrator follow-up eligibility for continuations, which is a related part of the same attribution behavior. The title is concise, uses a conventional commit format, and names the affected component.
Full details: Description check
-
Explanation
The description follows the repository template's main sections. The Problem section explains that quota-reset recovery records a machine-generated continuation as user-authored, and it gives a reproduction. The Change section explains the one-line actor change and what stays the same. The Scope and approval section cites the obvious-bug exception and a related discussion, and it explains why the change qualifies. The Verification section lists focused tests, typecheck, and lint with observed results, and it states what was not checked, such as live provider quota exhaustion. The description does not include an explicit approval comment link for the bug. It also does not state the agent model and harness in the required closing line, although it does mention the GPT-6.1 Sol model and Codex harness. The PR objectives also describe a later child-task ownership change, which the description does not mention, so the description may not match the full PR scope.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Note Written by Verified in a real dev environmenttested exact head created a project pointing at short runtime transcript from read-only inspection of the running servers' persisted projections: reran the existing focused quota regression and scheduled-continuation race cases through the nine-second recording shows a real codex follow-up streaming and completing on the pr. uploaded playback and seeking were checked in t3's browser. Not verifiedthe behavior changed by this pr remains unverified in the real app. the original quota-continuation bug could not be reproduced on main, and automatic reset continuation could not be exercised on the pr. both revisions report the existing discussion's child-task ownership concern also remains unverified at runtime. source inspection confirms that changing the continuation to native ios/android, electron-specific behavior, remote/relay/tunnel connections, other providers, and real quota cancellation/snooze/reset timing were not exercised. main's quota lookup blocker: the same blocker on the exact pr head: no source changes or pushes were made. this is an incomplete live verification, not approval based on passing checks. |
|
Note Written by addressed the child-task ownership finding in the two quota cases failed on the missing real provider quota-reset recovery remains unverified. the earlier live verification could not obtain quota metadata from the provider proxy; passing orchestration checks do not prove that live path. no client presentation files changed. |
|
Note Written by addressed the child-task ownership concern in extended the existing follow-up table with quota completion and parent-stop cases. both first failed because the recovered run lacked blacksmith verification on this tree: merged live provider quota reset remains unverified; the earlier runtime report's proxy could not supply quota metadata. these automated checks do not claim live quota recovery. no client renderer or layout changes. |
|
Note Written by addressed the child-task ownership concern in extended the existing follow-up table with quota completion and parent-stop cases. both first failed because the recovered run lacked blacksmith verification on this tree: merged live provider quota reset remains unverified; the earlier runtime report's proxy could not supply quota metadata. these automated checks do not claim live quota recovery. no client renderer or layout changes. |
…tribution-20261018 # Conflicts: # apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.test.ts
|
Note Written by merged current main (
live provider quota-reset recovery remains unverified because the prior provider proxy lacked quota metadata. this pass makes no new claim of live provider verification. waiting for the new head's CI and mergeability result. |


Quota-reset recovery currently dispatches its automatic continuation with
createdBy: "user". This records a machine-generated prompt as human-authored, despitecreationSource: "server". The existing shared user-message presenter only attributes server messages to T3 Code when the actor isagent, so this path also misses that existing attribution.Set the recovery actor to
agent, retainingcreationSource: "server". Existing reset timing, recovery identity, command/message deduplication and continuation text are preserved.This is a small, focused origin-metadata bug fix under the obvious-bug exception. It corrects who authored an existing automatic message. Presentation-default changes are proposed separately in discussion #21320.
Reproduction: pass a failed usage-limit candidate with an armed recovery and a due reset to
limitRecoveryCommand; inspect the returnedmessage.dispatch.createdBy. Before:user. After:agent, with server source and the original continuation-of-run identity.Validation on upstream base
d8e9fd267e26b7680f035edc0b40db09d2685dbb:vp test run apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.test.ts apps/server/src/orchestration-v2/runtimeLayer.test.ts -t "quota reset continuation provenance|guards a scheduled usage-limit continuation",pnpm --filter t3 typecheck, and targetedvp lint, all through the local machine-wide build lock.This was tested without exhausting a live provider quota or changing an installed client's recovery preferences. No client renderer/layout files change in this PR.
Written with GPT-6.1 Sol through the Codex harness.