{"record":{"id":"5e5014523458dd3b","repo":"slopus/happy","slug":"claude-edit-goal-action-is-not-supported","errorCode":null,"errorMessage":"Claude edit goal action is not supported","messagePattern":"Claude edit goal action is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/happy-cli/src/claude/runClaude.ts","lineNumber":592,"sourceCode":"            ? 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();\n\n        return await new Promise<{ ok: true }>((resolve, reject) => {\n            const timeout = setTimeout(() => {","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/claude/runClaude.ts#L574-L610","documentation":"Analogous to the clear guard: a 'set' (edit) goal action is only allowed when the active goal status advertises capabilities.edit. If the edit capability is absent, the handler rejects the action because the session cannot modify the goal.","triggerScenarios":"A 'goal-action' with type 'set' arrives while capabilities.edit is falsy on the latest goal status — the running Claude integration does not support editing an existing goal.","commonSituations":"Older Claude SDK versions without goal editing; session started in a mode that disables goal edits; app UI not gated on advertised capabilities.","solutions":["Upgrade CLI/Claude SDK to a version supporting goal edits.","Clear and re-create the goal instead of editing it, if clear is supported.","Gate the edit UI on capabilities.edit before sending the action.","Verify the session's goal status metadata to confirm supported capabilities."],"exampleFix":"// before\nawait rpc('goal-action', { action: 'set', goal: 'new goal' });\n// after\nif (goalStatus?.capabilities?.edit) await rpc('goal-action', { action: 'set', goal: 'new goal' });","handlingStrategy":"validation","validationCode":"if (goalStatus?.status === 'active' && !goalStatus.capabilities?.edit) {\n  console.warn('Editing goals is not supported by this session');\n  return;\n}","typeGuard":"function supportsEdit(s: { status: string; capabilities?: { edit?: boolean } } | null): boolean {\n  return s?.status === 'active' && s.capabilities?.edit === true;\n}","tryCatchPattern":"try {\n  await rpc('goal-action', { action: 'set', goal });\n} catch (err) {\n  if ((err as Error).message.includes('edit goal action is not supported')) {\n    logger.warn('Session cannot edit goals — clear and re-create the goal or upgrade the SDK');\n  } else throw err;\n}","preventionTips":["Gate edit UI on capabilities.edit.","Upgrade Claude SDK when goal editing is required.","Prefer clear+set over edit when edit is unsupported.","Refresh capability info on each goal status change."],"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"}