{"record":{"id":"7566fb83ba859f62","repo":"slopus/happy","slug":"claude-clear-goal-action-is-not-supported","errorCode":null,"errorMessage":"Claude clear goal action is not supported","messagePattern":"Claude clear goal action is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/happy-cli/src/claude/runClaude.ts","lineNumber":589,"sourceCode":"\n    session.rpcHandlerManager.registerHandler('goal-action', async (params: unknown) => {\n        const actionParams = params && typeof params === 'object' && !Array.isArray(params)\n            ? params as Record<string, unknown>\n            : null;\n        const command = actionParams ? parseClaudeGoalActionParams(actionParams) : null;\n        if (!command) {\n            throw new Error('Unsupported Claude goal action');\n        }\n        if (pendingClaudeGoalAction) {\n            throw new Error('Claude goal action already in progress');\n        }\n        if (!latestClaudeGoalStatus || latestClaudeGoalStatus.status !== 'active') {\n            throw new Error('No active Claude goal');\n        }\n\n        const capabilities = latestClaudeGoalStatus.capabilities ?? {};\n        if (command.type === 'clear' && !capabilities.clear) {\n            throw new Error('Claude clear goal action is not supported');\n        }\n        if (command.type === 'set' && !capabilities.edit) {\n            throw new Error('Claude edit goal action is not supported');\n        }\n        if (currentRunMode !== 'remote') {\n            throw new Error('Claude goal action is not ready: remote mode is not active');\n        }\n        if (!currentSession || currentSession.thinking) {\n            throw new Error('Claude goal action is not ready while Claude is thinking');\n        }\n        if (messageQueue.size() > 0) {\n            throw new Error('Claude message queue is busy');\n        }\n\n        const slashCommand = command.type === 'clear'\n            ? '/goal clear'\n            : `/goal ${command.objective}`;\n        const mode = currentEnhancedMode();","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/claude/runClaude.ts#L571-L607","documentation":"The server advertises per-action goal capabilities (capabilities.clear / capabilities.edit) in the goal status. If a 'clear' action is requested while capabilities.clear is false/absent, the handler rejects it as unsupported rather than attempting an action Claude cannot perform.","triggerScenarios":"A 'goal-action' with type 'clear' arrives while the active goal status's capabilities object lacks a truthy clear flag — i.e. the current Claude version/mode does not support clearing goals.","commonSituations":"Older Claude Code SDK versions lacking the clear-goal feature; a session mode where goal clearing is disabled; client/server version skew where the app shows a clear button the session can't honor.","solutions":["Upgrade the CLI (and the bundled Claude SDK) to a version that supports goal clearing.","Use a different mechanism to reset the goal (e.g. set a new goal instead of clearing).","Hide the clear action in the app when capabilities.clear is false.","Check latestClaudeGoalStatus.capabilities to confirm what the session supports before sending actions."],"exampleFix":"// before\nawait rpc('goal-action', { action: 'clear' });\n// after\nif (goalStatus?.capabilities?.clear) await rpc('goal-action', { action: 'clear' });","handlingStrategy":"validation","validationCode":"if (goalStatus?.status === 'active' && !goalStatus.capabilities?.clear) {\n  console.warn('Clearing goals is not supported by this session');\n  return;\n}","typeGuard":"function supportsClear(s: { status: string; capabilities?: { clear?: boolean } } | null): boolean {\n  return s?.status === 'active' && s.capabilities?.clear === true;\n}","tryCatchPattern":"try {\n  await rpc('goal-action', { action: 'clear' });\n} catch (err) {\n  if ((err as Error).message.includes('clear goal action is not supported')) {\n    logger.warn('Session does not support goal clear — upgrade the CLI/Claude SDK or set a new goal instead');\n  } else throw err;\n}","preventionTips":["Gate clear buttons on capabilities.clear from goal status metadata.","Upgrade CLI + bundled Claude SDK when goal features are needed.","Check capabilities after every goal status update.","Fall back to setting a replacement goal when clear is unavailable."],"tags":["rpc","capability","versioning"],"backgroundTag":"unsupported-capability","analyzedSha":"b824cd0a4681d41af631a8e422a813873e4455b0","analyzedAt":"2026-08-31T23:12:36.205Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}