{"record":{"id":"9ab23d8c750c5145","repo":"slopus/happy","slug":"codex-goal-actions-are-not-supported-by-this-runti","errorCode":null,"errorMessage":"Codex goal actions are not supported by this runtime","messagePattern":"Codex goal actions are not supported by this runtime","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/happy-cli/src/codex/runCodex.ts","lineNumber":636,"sourceCode":"        } catch (error) {\n            logger.debug('[Codex] Goal command API failed; falling back to normal turn:', error);\n            return false;\n        }\n    };\n    session.rpcHandlerManager.registerHandler('goal-action', async (params: Record<string, unknown>) => {\n        const command = parseCodexGoalActionParams(params);\n        if (!command) {\n            throw new Error('Unsupported Codex goal action');\n        }\n\n        const threadId = client.threadId;\n        if (!threadId) {\n            throw new Error('No active Codex thread');\n        }\n\n        const handled = await handleCodexGoalCommand(command, threadId);\n        if (!handled) {\n            throw new Error('Codex goal actions are not supported by this runtime');\n        }\n\n        return { ok: true };\n    });\n\n    // Approval handler: routes server → client approval requests to our permission handler\n    client.setApprovalHandler(async (params) => {\n        const toolName = params.type === 'exec'\n            ? 'CodexBash'\n            : params.type === 'patch'\n                ? 'CodexPatch'\n                : (params.toolName ?? 'McpTool');\n        const input = params.type === 'exec'\n            ? { command: params.command, cwd: params.cwd }\n            : params.type === 'patch'\n                ? { changes: params.fileChanges }\n                : (params.input ?? {});\n        const activePermissionMode = activeTurnPermissionMode ?? remoteModeState.currentPermissionMode;","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/codex/runCodex.ts#L618-L654","documentation":"The goal-action handler calls handleCodexGoalCommand(); if it returns false, the current Codex runtime/transport does not implement that goal capability, so the handler throws. This is a capability gate, not a data error — the action was recognized but this runtime can't execute it.","triggerScenarios":"Sending a goal action through a runtime whose handleCodexGoalCommand returns false — e.g. app-server transport lacking rollback/goal support, or the action type routed to a runtime that only supports a subset of goal actions.","commonSituations":"Older Codex CLI versions whose app-server lacks the needed RPC; running a Codex session mode that disables goal controls; feature shipped to the app before CLI support landed.","solutions":["Upgrade the Codex CLI (npm install -g @openai/codex) to a version supporting goal actions","Upgrade happy-cli to the latest release","Hide/disable goal actions in the client for sessions on unsupported runtimes","Use the interactive Codex session directly for the goal operation as a workaround"],"exampleFix":"// before\n$ happy codex ... # old codex binary -> 'not supported by this runtime'\n\n// after\n$ npm install -g @openai/codex@latest && npm update -g happy-cli","handlingStrategy":"fallback","validationCode":"// Query runtime capabilities before sending:\nconst supportsGoals = await rpc('capabilities', {}).then(c => c.goalActions === true, () => false);\nif (!supportsGoals) {\n  console.warn('This runtime does not support goal actions.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await rpc('goal-action', params);\n} catch (error) {\n  if ((error as Error).message.includes('not supported by this runtime')) {\n    // fall back to manual handling in the interactive session\n  } else { throw error; }\n}","preventionTips":["Advertise goal-action support in a capabilities handshake","Upgrade the Codex CLI to the minimum version that implements goal RPCs","Feature-flag goal actions per runtime in the client"],"tags":["codex","rpc","capability","version-mismatch"],"backgroundTag":"unsupported-action","analyzedSha":"b824cd0a4681d41af631a8e422a813873e4455b0","analyzedAt":"2026-08-31T23:12:36.205Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}