Skip to content

Commit 7c05350

Browse files
yyq1025claude
andcommitted
daemon: hide AskUserQuestion from sidecode-driven turns
disallowedTools removes the tool from the model's context entirely (not just permission-denied): V0 iOS has no answer UI, so a turn that called AskUserQuestion would sit waiting on input the app can't deliver. With the tool hidden the model phrases questions as plain text instead. The ask_user detail/render path stays — resumed Desktop sessions can still contain historical AskUserQuestion calls. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 7927e7a commit 7c05350

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

packages/daemon/src/runtime/run-query.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,9 @@ describe("ensureSessionLoop — mode parameter passes correct option to SDK", ()
14391439
sessionId: "created-uuid",
14401440
cwd: "/proj",
14411441
includePartialMessages: true,
1442+
// V0 has no iOS answer UI — the tool is hidden from the model so a
1443+
// turn never blocks on a question the app can't deliver.
1444+
disallowedTools: ["AskUserQuestion"],
14421445
});
14431446
expect((capturedOptions as { resume?: string }).resume).toBeUndefined();
14441447
});
@@ -1461,6 +1464,7 @@ describe("ensureSessionLoop — mode parameter passes correct option to SDK", ()
14611464
expect(capturedOptions).toMatchObject({
14621465
resume: "existing-uuid",
14631466
includePartialMessages: true,
1467+
disallowedTools: ["AskUserQuestion"],
14641468
});
14651469
expect(
14661470
(capturedOptions as { sessionId?: string }).sessionId,

packages/daemon/src/runtime/run-query.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ export function ensureSessionLoop(
268268
permissionMode: "bypassPermissions" as const,
269269
allowDangerouslySkipPermissions: true as const,
270270
};
271+
// Removed from the model's context entirely (not just permission-denied):
272+
// - AskUserQuestion: V0 iOS has no answer UI — if the model called it,
273+
// the turn would sit waiting on input the app can't deliver. Hiding
274+
// the tool makes the model phrase questions as plain text instead.
275+
// The ask_user detail/render path stays: resumed Desktop sessions can
276+
// still contain historical AskUserQuestion calls.
277+
const disallowedTools = ["AskUserQuestion"];
271278
// SDK requires sessionId XOR resume — they're mutually exclusive
272279
// (sdk.d.ts:1538-1540 — "Cannot be used with continue or resume unless
273280
// forkSession is also set"). We use sessionId for new sessions (so the
@@ -285,6 +292,7 @@ export function ensureSessionLoop(
285292
options.mode === "create"
286293
? {
287294
...bypassFlags,
295+
disallowedTools,
288296
...modelOption,
289297
sessionId: runtime.sessionId,
290298
includePartialMessages: true as const,
@@ -293,6 +301,7 @@ export function ensureSessionLoop(
293301
}
294302
: {
295303
...bypassFlags,
304+
disallowedTools,
296305
...modelOption,
297306
resume: runtime.sessionId,
298307
includePartialMessages: true as const,

0 commit comments

Comments
 (0)