Files
orca/src/shared/agent-session-thread-goal-wire.ts
T
Brennan Benson 3a3889c991 feat(native-chat): show Claude's /goal in the goal banner (#28923)
* feat(native-chat): show Claude's /goal in the goal banner

Claude reports a goal only as a synthetic reply in stream-json, so Orca saved it
as assistant text and never showed the goal banner Codex gets. Journal Claude's
goal replies as the typed goal transition, infer completion when Claude ends a
turn on its own, report the goal to clients apart from host goal controls, and
let the banner clear it by sending /goal clear.

* fix(native-chat): keep a Claude goal open when a person stops the turn

A Stop pressed while Claude ran the goal's check ended the turn with a clean
result, which read as the goal being met and removed the goal banner. The
journal's Stop rule already says when a person's Stop decides how a turn
ends; a turn it decides never counts as the goal being met.

* fix(native-chat): count Claude goal time from the turn start and title an idle goal 'Goal set'

* Fix Claude goal clear reveal and result accounting

* Hold Claude goal clear during pending sends

* Preserve Claude goal text with status-like phrases

* Require host goal support for persisted goal banner

* Keep structured session modules within line limits

* test(native-chat): give option-read journal doubles the goal read

* test(claude): give journal doubles the goal source read
2026-10-15 13:26:07 -07:00

14 lines
644 B
TypeScript

// What a client sends to change a structured session's thread goal (`agentSession.threadGoal`).
/** Longest objective a client may send; matches the provider's own limit. */
export const AGENT_SESSION_THREAD_GOAL_OBJECTIVE_MAX_LENGTH = 4000
/** A client's change to the thread goal. `set` replaces the objective and makes
* it active, which the provider pursues without a separate turn. */
export type AgentSessionThreadGoalChange =
| { kind: 'set'; objective: string }
| { kind: 'status'; status: 'active' | 'paused' }
| { kind: 'clear' }
export type AgentSessionThreadGoalResult = { change: AgentSessionThreadGoalChange['kind'] }