Repository navigation
fix(server): return delegated waits on pending approvals - #20037
gustavonline wants to merge 2 commits into
Conversation
Return task-bound approval attention without changing approval authority. Preserve the task result and normal parent completion delivery. Refs pingdotgg#15082. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped delegated-wait bug fix that reports approval identity and returns control without deciding approvals, cancelling child work, or changing defaults. Extensive unit and integration coverage exercises ownership, stale-request, cancellation, retry, and eventual completion behavior. You can add or adjust custom eligibility rules. Learn more. |
|
I verified this PR at
The combined branch passed 104 focused server/contract/client tests plus both MCP toolkit integration tests (106 total), and scoped repository TypeScript/Effect checks. Approval decisions above came from the test client, through the same public RPC used by clients; the parent was not given approval authority. This was one-host provider/API acceptance, not interactive web, Electron, native-mobile, or remote acceptance. For the sign-in remainder of #15082: an actual delegation to a configured Codex instance with an empty auth home returned Verification performed with GPT-6.1-Sol through the Codex harness. |
Merge official main86534db4 and resolve its comment-pruning conflicts without changing the reviewed task approval binding, wait predicate or completion gates. Fresh41focused tests, server/contracts types, scoped lint and formatting pass. Independent GPT-6.1-Sol Max source review accepts the exact candidate. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Problem
A child approval can leave
delegate_task(mode: "wait")waiting while the child cannot progress. Questions already return control to the parent; approvals do not.Change
Return
pendingApprovalwith the request ID, kind and task-owned run ID. Require a pending, live record on that task’s unfinished run; exclude unrelated tasks, settled requests and stopped/disposed work. Preserve the task’s normal result and completion delivery.Approval authority stays with the existing holder, who must inspect the fresh full request in the child thread. A pending record can outlive its provider callback.
Scope and approval
Focused blocking-wait bug from the maintainer-triaged remainder of #15082, submitted under the focused-bug exception.
This complements Lenoridev’s approval-notice offer and client attention #19630. It changes neither reactor/UI notices nor approval decisions, sign-in or remote delegation.
Verification
Native event/SQLite integration checks approval at entry and during a wait, task/run ownership, stale/other-task/Stop exclusions, and the same task’s later result with one parent delivery. The new completion wait uses an exact
Deferredsignal.After resolving the comment-pruning conflicts with main
86534db4:Deferredsynchronization.Node 24.13.1 / pnpm 11.10.0, updated frozen dependencies including Effect 4.0.5. These checks use synthetic approval events and fake providers.
Lenoridev’s real Codex verification covers the previous head
1babdc3combined with the separate approval-notice patch. Decisions came from a test client, not the parent. Real-provider or interactive-client acceptance of this merged head is not claimed. No runtime deployment.Written with Claude Opus 5.5 (High, Fast off) through Claude Code in T3 Code. Independently reviewed with GPT-6.1-Sol (Max) through Codex in T3 Code.