feat(cli): TUI surfaces no autonomous-goal state — no indicator, no /goal view
#3,022 opened on Aug 14, 2026
Repository metrics
- Stars
- (1 star)
- PR merge metrics
- (No merged PRs in 30d)
Description
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
waitingbackoff (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.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). - 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 (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. - Render goal-origin turns with a distinct marker (parallel to the
legacy_automationblock) 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