# fix\(server\): notify parents when delegated children need approval · PR \#20928 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/20928)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: open

Source repository: Unavailable fork

Source branch: fix/delegated-approval-notices

Target branch: main

Head commit: 8aadcc59a93e1a59936b7ae3a936d3fcaf41f4c6

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/20928)

[Commits](https://git.cafe/pingdotgg/t3code/pull/20928/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/20928/diffs?format=markdown)

## Description

---

## Problem

An asynchronous delegated child can pause for approval after its parent finishes without notifying the parent. Reproduced with the real web dev server on Linux and Claude Opus 5.5: the child showed a pending command approval while the parent remained completed.

## Change

Extend the existing delegated-question reactor to notify parents about live child approval requests. Notices link to the child thread and tell the parent to ask the user to handle the approval there; approval authority stays unchanged.

Reuse existing request IDs for deduplication. Withdraw queued notices when requests end or tasks stop, reject stale dispatch after disposal, and preserve blocking-wait delivery without announcing the same returned request twice. Update the existing delegation guide to match blocking-wait behavior. Contributor and maintainer history from this PR is preserved.

## Scope and approval

Fixes #22925
GitCafe: https://git.cafe/pingdotgg/t3code/issues/22925
Triaged bug via the automated issue flow; [issue #22925](https://git.cafe/pingdotgg/t3code/issues/22925).

## Verification

Behavior checked at: [152bad3669](https://github.com/Lenoridev/t3code/commit/152bad3669958524f826400d319848dacd7501d5).

- Baseline regression failed with `expected +0 to equal 1` for the missing parent notice. Cancellation/expiry regressions also failed before their fix (`queued` instead of `cancelled`).
- `Orchestrator.control-reads.test.ts`: **18 passed** at the final head, covering approval notices, questions, live-only routing, withdrawal, deduplication and blocking-wait catch-up.
- `DelegatedCompletionDelivery.test.ts` and `ThreadStop.test.ts`: **65 passed** at the final head.
- Server package typecheck passed at the behavior-checked head. Targeted lint passed with no errors; the pre-existing unused `layerUnavailable` warning remains. `git diff --check` passed.

| Evidence | Result |
| --- | --- |
| [Before: real-app reproduction](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/90a8d48c46ddac29/22925-reproduction.md) | Parent completed before the child approval appeared; no parent wake followed. The full-access control did not prompt. |
| [After: final-head runtime transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d8cbb94222981c0c/22925-runtime-proof-v2.md) | Ten scenarios passed using the real event subscriber, isolated SQLite projections and orchestrator. Provider requests and parent completion events were synthetic; effect worker disabled. Covers all five approval kinds, guidance/link, internal exclusions, resolution/disposal, catch-up, returned-wait deduplication, cancellation and expiry. |

The subsequent [8aadcc59a9](https://github.com/Lenoridev/t3code/commit/8aadcc59a93e1a59936b7ae3a936d3fcaf41f4c6) adds only an explanation of the existing tracing boundary; targeted formatting and diff checks passed. Runtime code is unchanged.

The visual fixture matrix is empty: no client render paths change. No real-provider after-fix acceptance is claimed; that attempt failed before delegation. macOS Electron, iOS, Android, and remote/tunnel acceptance remain unverified. The runtime transcript retains a trailing warning from the isolated fixture closing SQLite after assertions; the proof audit independently reproduced cancellation and identified this teardown race. No clean-shutdown claim is made.

Models/harness: GPT-6.1 Sol through Codex and Claude Opus 5.5 through Claude Agent, orchestrated in T3 Code.

