Skip to content

Codex: SessionStart systemMessage renders as a yellow warning: (reads like an error every session) #605

Description

@spde

What happens

On Codex, every SessionStart shows ponytail's mode as a yellow warning: line:

• SessionStart hook (completed)
  warning: PONYTAIL:FULL
  hook context: PONYTAIL MODE ACTIVE — level: full

Ponytail is working correctly, but the warning: styling reads as an error every session — a small adoption paper-cut. (Screenshot available.)

Root cause — ponytail-side, distinct from #331 / openai/codex#16933

This is not the #331 case (Codex rendering additionalContext). This specific line comes from ponytail's own systemMessage in the isCodex branch of hooks/ponytail-runtime.js:

const output = { systemMessage: `PONYTAIL:${mode.toUpperCase()}` };

Codex maps a hook systemMessage to a Warning entry, and the presence of any Warning entry also drops the completed-hook bullet from green to neutral (see codex tui/src/history_cell/hook_cell.rs: the warning: prefix on the Warning kind, and hook_completed_bullet greening the bullet only when no Warning entry is present). The additionalContext "hook context:" line is a separate Context entry and is untouched.

Because it's ponytail's own systemMessage, it's fully in ponytail's control — unlike #331.

Fix

The Qoder branch right below already ships hookSpecificOutput minus systemMessage, so there's precedent for a silent mode signal. Dropping systemMessage on Codex:

  • removes the warning: line,
  • flips the completed-hook bullet to green (success),
  • keeps every state visible via the hook context: line — PONYTAIL MODE ACTIVE — level: <mode> when on, PONYTAIL MODE OFF when off (the off path passes that context too), since Codex renders additionalContext (Ponytail instructions are printed on codex session start #331).

So there's no loss of visibility — only the alarming styling goes. After the change the isCodex branch becomes identical to isQoder; happy to dedup them in the PR if you'd prefer.

PR incoming. tests/hooks.test.js currently asserts the systemMessage values, so those move with the change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions