Repository navigation
Description
Retitled 2026-08-07. The original framing ("blocked on a harness declaring needsApproval tools") is stale — first-party tools now declare
approval: 'ask'. The underlying gap is unchanged and still open.
What is stale
The blocker named in the original body is gone. server.reload and server.restart declare approval: 'ask' (packages/tools/src/builtins/server-tools.ts:105,120), and the gate reads that axis across surfaces (packages/core/src/chat/gate.ts:62,115, capabilities.ts:42,63, code-mode.ts:148,167) after #292.
What is still true
chat.send cannot carry an approval continuation. ChatSendInput still requires non-empty text or content (packages/contract/src/contract.ts:28-32, the .refine(...)), so a content-less tool-result continuation has no way through.
Approvals today ride a separate RPC — chat.permissionDecision (packages/contract/src/contract.ts:109) — an out-of-band decide flow, distinct from the ai-client's native checkForContinuation / streamResponse path this issue is about. That works for RPC-boundary tools like server.restart, but it is not the native surface.
PR #292's own body states the gap explicitly: TanStack-native needsApproval on the chat surface is blocked because there is no addToolApprovalResponse / interrupt-resume path anywhere in the repo, so the native swap needs a resume pipeline through the rpc contract, run lifecycle, and client — its own work item.
Acceptance
- A continuation carrying tool results can be delivered without a synthetic user turn (either a content-less send variant or approval state riding the send body)
- The client steer skips the stop-then-send for a continuation, so
chat.stopdoes not release an awaiting-approval turn - A harness declaring native
needsApprovaltools completes an approve → continue → finish cycle end to end
Original body
Found during T5 (#198) audit. The library's tool-approval continuation is itself a connection.send (ai-client chat-client.ts:1554-1558 → checkForContinuation → streamResponse), but our wire's chat.send requires non-empty text/content — a continuation carries tool results, not a user turn. Worse, the client's unconditional stop-then-send steer would hit chat.stop, and core's stopSession releases an awaiting-approval turn that spec #190 says the claim should span (core run.ts turn registry revives it via begin()).
Blocked on: a harness with needsApproval tools. Not part of the rewrite plan (#183).
Activity
[-]Approval continuation cannot ride chat.send[/-][+]Native TanStack approval continuation: no resume pipeline through the rpc contract[/+]omridevk commentedon Oct 29, 2026
#597 (d07737b) moved the chat plane onto the native @tanstack/ai stream, run store and sandbox middleware; the approval continuation now rides the native run lifecycle. The remaining item here is the resume pipeline through the rpc contract for a reconnecting client.