slopus/happy · error

Unsupported Codex goal action

Error message

Unsupported Codex goal action

What it means

The 'goal-action' RPC handler in runCodex validates incoming params with parseCodexGoalActionParams(); if parsing fails (unknown action name or malformed params) it throws 'Unsupported Codex goal action'. Only actions recognized by the parser are supported by this runtime.

Source

Thrown at packages/happy-cli/src/codex/runCodex.ts:626

                threadId,
                objective: command.objective,
            });
            updateCodexGoalState({
                type: 'thread_goal_updated',
                threadId,
                goal: result.goal,
            });
            messageBuffer.addMessage('Goal updated', 'status');
            return true;
        } catch (error) {
            logger.debug('[Codex] Goal command API failed; falling back to normal turn:', error);
            return false;
        }
    };
    session.rpcHandlerManager.registerHandler('goal-action', async (params: Record<string, unknown>) => {
        const command = parseCodexGoalActionParams(params);
        if (!command) {
            throw new Error('Unsupported Codex goal action');
        }

        const threadId = client.threadId;
        if (!threadId) {
            throw new Error('No active Codex thread');
        }

        const handled = await handleCodexGoalCommand(command, threadId);
        if (!handled) {
            throw new Error('Codex goal actions are not supported by this runtime');
        }

        return { ok: true };
    });

    // Approval handler: routes server → client approval requests to our permission handler
    client.setApprovalHandler(async (params) => {
        const toolName = params.type === 'exec'

View on GitHub (pinned to b824cd0a46)

Solutions

  1. Update both happy CLI and the mobile client to matching latest versions
  2. Check the action name and payload against parseCodexGoalActionParams' accepted schema
  3. Log/inspect the incoming `params` to see what failed validation
  4. Handle the rejection on the caller side and surface 'update your CLI' guidance

Example fix

// before
sendGoalAction('pause'); // older CLI doesn't recognize it -> throws

// after
update happy-cli to latest; then verify the action is in the supported set before sending
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_GOAL_ACTIONS = ['start', 'stop', 'pause'] as const;
type GoalAction = typeof SUPPORTED_GOAL_ACTIONS[number];
function isSupportedGoalAction(params: Record<string, unknown>): params is { action: GoalAction } {
  return SUPPORTED_GOAL_ACTIONS.includes(params.action as GoalAction);
}
if (!isSupportedGoalAction(params)) throw new Error('Unsupported Codex goal action');

Type guard

function isGoalActionParams(p: unknown): p is { action: string; threadId?: string } {
  return typeof p === 'object' && p !== null && 'action' in p && typeof (p as any).action === 'string';
}

Try / catch

try {
  await rpc('goal-action', params);
} catch (error) {
  if ((error as Error).message === 'Unsupported Codex goal action') {
    console.warn('CLI does not support this goal action; update happy-cli.');
  } else { throw error; }
}

Prevention

When it happens

Trigger: A remote (mobile/app) client sends a `goal-action` RPC whose params do not match the expected schema: unknown action string, missing required fields, or wrong types.

Common situations: Newer mobile app version sending a goal action the CLI version doesn't know; mismatched CLI/app versions after a partial update; corrupted or hand-crafted RPC payloads.

Related errors


AI-assisted analysis of slopus/happy@b824cd0a46 (2026-08-31). Data as JSON: /api/errors/ab7448bc76aace27. Report an issue: GitHub.