Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ› fix(hetero): disable Claude Code wakeup tools (#16436)

Arvin Xuf49c2bcea465
diff --git a/apps/desktop/src/main/modules/heterogeneousAgent/drivers/claudeCode.test.ts b/apps/desktop/src/main/modules/heterogeneousAgent/drivers/claudeCode.test.ts
index 3cb3e1ec75f..4ba81708b73 100644
--- a/apps/desktop/src/main/modules/heterogeneousAgent/drivers/claudeCode.test.ts
+++ b/apps/desktop/src/main/modules/heterogeneousAgent/drivers/claudeCode.test.ts
@@ -36,16 +36,16 @@ describe('claudeCodeDriver', () => {
expect(args[idx + 1]).toBe('/tmp/lobe-cc-mcp-op-1.json');
});
- it('still pins --disallowedTools AskUserQuestion alongside --mcp-config', async () => {
+ it('still pins shared --disallowedTools alongside --mcp-config', async () => {
// Even with our local MCP replacement available, CC's built-in stays
- // disabled β€” leaving both visible would let the model double-register
- // the same name and pick the broken one.
+ // disabled. Monitor/ScheduleWakeup stay disabled through the same shared
+ // base args because they can hit the stuck wakeup path in desktop mode.
const { args } = await claudeCodeDriver.buildSpawnPlan(
buildParams({ mcpConfigPath: '/tmp/x.json' }),
);
const disallowedIdx = args.indexOf('--disallowedTools');
expect(disallowedIdx).toBeGreaterThan(-1);
- expect(args[disallowedIdx + 1]).toBe('AskUserQuestion');
+ expect(args[disallowedIdx + 1]).toBe('AskUserQuestion,Monitor,ScheduleWakeup');
});
it('--mcp-config goes before --resume so user --args can still override the resume id', async () => {
diff --git a/packages/heterogeneous-agents/src/spawn/spawnAgent.test.ts b/packages/heterogeneous-agents/src/spawn/spawnAgent.test.ts
index 060110ade65..c7e116dda36 100644
--- a/packages/heterogeneous-agents/src/spawn/spawnAgent.test.ts
+++ b/packages/heterogeneous-agents/src/spawn/spawnAgent.test.ts
@@ -134,12 +134,11 @@ describe('spawnAgent', () => {
expect(call.args).toContain('--output-format');
expect(call.args.filter((a) => a === 'stream-json')).toHaveLength(2);
expect(call.args).toContain('-p');
- // CC's built-in interactive Q&A is disabled at every spawn site so the
- // model degrades to plain-text questioning instead of stalling on a
- // synthetic "Answer questions?" tool_result.
+ // These tools are disabled at every spawn site so CC does not stall on
+ // built-in interactive Q&A or wakeup/monitor lifecycle calls.
const disallowedIdx = call.args.indexOf('--disallowedTools');
expect(disallowedIdx).toBeGreaterThan(-1);
- expect(call.args[disallowedIdx + 1]).toBe('AskUserQuestion');
+ expect(call.args[disallowedIdx + 1]).toBe('AskUserQuestion,Monitor,ScheduleWakeup');
// Partial deltas are opt-in β€” terminal/sandbox callers want fewer events.
expect(call.args).not.toContain('--include-partial-messages');
// Prompt MUST go through stdin as a stream-json user message β€” never as argv.
diff --git a/packages/heterogeneous-agents/src/spawn/spawnAgent.ts b/packages/heterogeneous-agents/src/spawn/spawnAgent.ts
index 08b5d2b5dc0..88eca78b487 100644
--- a/packages/heterogeneous-agents/src/spawn/spawnAgent.ts
+++ b/packages/heterogeneous-agents/src/spawn/spawnAgent.ts
@@ -110,9 +110,11 @@ export interface SpawnAgentHandle {
* `AskUserQuestion` is disabled because CC's CLI self-injects an
* `is_error: "Answer questions?"` tool_result in `-p` mode before the host
* can surface the questions, so the model falls back to plain-text prompting
- * anyway. Remove this once a local MCP-backed replacement is wired to
- * LobeHub's intervention UI.
+ * anyway. `Monitor` and `ScheduleWakeup` are also disabled here because they
+ * can hit the same stuck wakeup path in both desktop and sandbox runs.
*/
+const CLAUDE_CODE_DISALLOWED_TOOLS = ['AskUserQuestion', 'Monitor', 'ScheduleWakeup'] as const;
+
export const CLAUDE_CODE_BASE_ARGS = [
'-p',
'--input-format',
@@ -121,7 +123,7 @@ export const CLAUDE_CODE_BASE_ARGS = [
'stream-json',
'--verbose',
'--disallowedTools',
- 'AskUserQuestion',
+ CLAUDE_CODE_DISALLOWED_TOOLS.join(','),
] as const;
// bypassPermissions is blocked when running as root (e.g. cloud sandbox).