Problem
When the agent arms an autonomous goal (GoalSet), the TUI gives the user almost no signal about what is running:
- No persistent indicator. The status line shows title / permission mode / model / ctx / cost / cache / connection / cwd — nothing about a goal. During a
waiting backoff (up to 5 min, GOAL_WAIT_BACKOFF_MAX_MS) the user sees an idle prompt while the goal will spontaneously continue.
- Goal continuation turns render as ordinary user prompts.
pi-transcript.ts maps any origin that is not legacy_automation to 'user', so origin: { kind: 'goal' } turns appear as if the user typed the [Goal continuation] ... preamble. There is no marker like the desktop's "goal continued" chip (packages/ui/src/chat-turn.tsx).
- No way to inspect the goal. Iterations, elapsed time, token budget/spend, pause state and the evaluator's last reason are all invisible. The only user-facing query path is asking the model to call GoalStatus — which costs a model turn.
Codex (the reference for this feature) ships a bottom-pane goal indicator (active with token budget or elapsed time, Goal paused (/goal resume), stalled, budget-limited, complete) and a /goal summary command.
Proposal
Surface-layer only; the host protocol already exposes goal.query with the full projection (status, setAt, pausedAt, iterations, maxIterations, tokensSpent, tokenBudget, lastReason):
- Add a goal query to the CLI session driver (
connection.request('goal.query', ...)).
- Render a goal segment in the TUI status line: status +
iteration/max + elapsed (from setAt, frozen at pausedAt when paused). Refresh at turn boundaries and on session attach — every goal transition is adjacent to a turn boundary or a control action, so no new subscription machinery is needed.
- Render goal-origin turns with a distinct marker (parallel to the
legacy_automation block) instead of as plain user messages.
- Add
/goal (no args) printing condition, status, iterations, elapsed, tokens vs budget, and last reason.
Out of scope here: /goal pause|resume|clear control actions and Ctrl+C pause notices — tracked separately.
Generated-by: Maka
Problem
When the agent arms an autonomous goal (GoalSet), the TUI gives the user almost no signal about what is running:
waitingbackoff (up to 5 min, GOAL_WAIT_BACKOFF_MAX_MS) the user sees an idle prompt while the goal will spontaneously continue.pi-transcript.tsmaps any origin that is notlegacy_automationto'user', soorigin: { kind: 'goal' }turns appear as if the user typed the[Goal continuation] ...preamble. There is no marker like the desktop's "goal continued" chip (packages/ui/src/chat-turn.tsx).Codex (the reference for this feature) ships a bottom-pane goal indicator (active with token budget or elapsed time,
Goal paused (/goal resume), stalled, budget-limited, complete) and a/goalsummary command.Proposal
Surface-layer only; the host protocol already exposes
goal.querywith the full projection (status, setAt, pausedAt, iterations, maxIterations, tokensSpent, tokenBudget, lastReason):connection.request('goal.query', ...)).iteration/max+ elapsed (fromsetAt, frozen atpausedAtwhen paused). Refresh at turn boundaries and on session attach — every goal transition is adjacent to a turn boundary or a control action, so no new subscription machinery is needed.legacy_automationblock) instead of as plain user messages./goal(no args) printing condition, status, iterations, elapsed, tokens vs budget, and last reason.Out of scope here:
/goal pause|resume|clearcontrol actions and Ctrl+C pause notices — tracked separately.Generated-by: Maka