Repository navigation
FEAT: support session goals and live goal status - #94
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A critical active finding remains: synchronous goal refreshes can serialize up to 2-second RPC timeouts across many sessions, severely delaying Fetch and live telemetry.
1 open issue
What changed in this PR
Adds session-goal support backed by the shared app-server, with guarded /goal commands, authoritative live status, terminal and web presentation, localization, documentation, and regenerated frontend assets.
Changes:
- Adds goal observation, reconciliation, lifecycle mutations, budget editing, validation, stale-state handling, and post-mutation verification.
- Displays goal states independently from turn, approval, and working status in terminal and web interfaces.
- Adds browser, Go, projection, concurrency, localization, and responsive-layout coverage.
- Updates documentation, command support inventory, and embedded frontend assets.
Review findings:
- Critical —
internal/codex/session_goal_unix.go:106: Synchronous goal refreshes can serialize up to a two-second timeout per subscribed session, delaying telemetry for hundreds of seconds. Use concurrent reads or a shared deadline. (1 vote) - Moderate —
internal/codex/session_goal_unix.go:47: The 256-entry observation cache silently drops later sessions, leaving live goal status incorrect and causing repeated refresh attempts. Evict unsubscribed entries or provide an explicit fallback. (1 vote) - Moderate —
internal/codex/session_goal_commands_unix.go:63: Browsermaxlengthcounts UTF-16 code units while backend validation counts UTF-8 runes, preventing valid objectives containing more than 2,048 astral characters. Use rune-aware client-side validation or adjust the advertised limit. (1 vote) - Moderate —
internal/ui/monitor_commands_inline.go:122: Direct root forms such as/goal Finish the reportand/goal pausedo not reach the goal-input branch while root suggestions are open. Handle root queries directly. (1 vote) - Nit —
internal/ui/monitor_commands.go:683: TheGoal updated.notice bypasses localization despite translations existing in every locale. Usei18n.Text. (1 vote)
| File | Description |
|---|---|
web/tests/browser.spec.ts |
Adds browser coverage for goal display, responsive placement, and guarded commands. |
web/src/StatusLine.svelte |
Renders goal status in the web status line. |
web/src/state.svelte.ts |
Adds frontend session-goal state types. |
web/src/Sessions.svelte |
Displays goals in session rows and detail footers. |
web/src/SessionCopy.svelte |
Supports compact copy-control placement. |
web/src/SessionCommands.svelte |
Adds goal command input and review handling. |
web/src/GoalStatus.svelte |
Provides web goal-status presentation and stale styling. |
README.md |
Documents goal commands, states, limits, and semantics. |
intro-post.md |
Documents the user-facing goal workflow and presentation. |
internal/web/state.go |
Projects sanitized goal telemetry into web snapshots. |
internal/web/session_goal_test.go |
Tests isolated, sanitized, read-only goal projection. |
internal/web/dist/index.html |
References regenerated frontend assets. |
internal/web/dist/assets/index-DiPYjudz.css |
Removes the superseded stylesheet bundle. |
internal/web/dist/assets/index-CqJz1WRL.css |
Adds regenerated goal-status and compact-footer styles. |
internal/web/control_commands.go |
Adds goal mutation success messaging. |
internal/ui/monitor.go |
Places goal status beneath terminal telemetry fields. |
internal/ui/monitor_statusline.go |
Integrates goal status with terminal footer geometry. |
internal/ui/monitor_goal.go |
Implements terminal goal rendering and footer layout. |
internal/ui/monitor_goal_test.go |
Tests goal ordering, stale handling, layout, and hit targets. |
internal/ui/monitor_context.go |
Places goal status before full-detail footer controls. |
internal/ui/monitor_commands.go |
Adds goal reviews, navigation, and result handling. |
internal/ui/monitor_commands_inline.go |
Supports inline goal command input and review paths. |
internal/ui/model.go |
Stores and synchronizes per-session goals. |
internal/i18n/locales/zh-Hans.json |
Adds Simplified Chinese goal labels and messaging. |
internal/i18n/locales/tr.json |
Adds Turkish goal labels and messaging. |
internal/i18n/locales/sv.json |
Adds Swedish goal labels and messaging. |
internal/i18n/locales/ru.json |
Adds Russian goal labels and messaging. |
internal/i18n/locales/pt-PT.json |
Adds European Portuguese goal labels and messaging. |
internal/i18n/locales/pt-BR.json |
Adds Brazilian Portuguese goal labels and messaging. |
internal/i18n/locales/nl.json |
Adds Dutch goal labels and messaging. |
internal/i18n/locales/nb.json |
Adds Norwegian Bokmål goal labels and messaging. |
internal/i18n/locales/ja.json |
Adds Japanese goal labels and messaging. |
internal/i18n/locales/it.json |
Adds Italian goal labels and messaging. |
internal/i18n/locales/fr.json |
Adds French goal labels and messaging. |
internal/i18n/locales/fi.json |
Adds Finnish goal labels and messaging. |
internal/i18n/locales/et.json |
Adds Estonian goal labels and messaging. |
internal/i18n/locales/es.json |
Adds Spanish goal labels and messaging. |
internal/i18n/locales/en-GB.json |
Adds English goal labels and messaging. |
internal/i18n/locales/de.json |
Adds German goal labels and messaging. |
internal/i18n/locales/da.json |
Adds Danish goal labels and messaging. |
internal/codex/session_settings_unix_test.go |
Extends app-server fixtures for goal RPC behavior. |
internal/codex/session_prompt_unix.go |
Clears goal state when sessions close. |
internal/codex/session_goal.go |
Defines goal state, labels, cloning, usage, and command helpers. |
internal/codex/session_goal_unix.go |
Implements goal observation, notifications, reconciliation, and command normalization. |
internal/codex/session_goal_unix_test.go |
Tests lifecycle, isolation, stale reads, races, validation, and no-retry behavior. |
internal/codex/session_goal_test.go |
Tests labels, cloning, linked-session isolation, bounds, and cache policy. |
internal/codex/session_goal_commands_unix.go |
Implements goal menus, validation, mutations, confirmation, and verification. |
internal/codex/session_commands.go |
Extends command-path validation for goal inputs and budgets. |
internal/codex/session_commands_unix.go |
Registers and dispatches the goal command family. |
internal/codex/session_command_cache.go |
Keeps typed goal reviews out of the catalogue cache. |
internal/codex/live_usage.go |
Carries root-session goals into live usage snapshots. |
internal/codex/daemon_status.go |
Adds goals to daemon status snapshots. |
internal/codex/daemon_status_unix.go |
Tracks goal observations, notifications, subscriptions, and refreshes. |
docs/slash-command-support.md |
Marks /goal as implemented in the command inventory. |
Review effort: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
Codex can pursue a session goal across turns, but Codexometer previously offered neither
/goalcontrols nor a reliable indication of whether pursuit was active, paused, stalled or limited. This adds goal support through the shared app-server, without guessing goal state from inactivity or conflating it with turn/approval status.Changes
Shared goal adapter
thread/goal/get,thread/goal/updatedandthread/goal/cleared, with periodic snapshot reconciliation./goal,/goal <objective>,/goal edit,/goal pause,/goal resumeand/goal clear, plus a total token-budget editor (/goal budget <integer|unlimited>).--no-confirmpolicy applies.Terminal and web presentation
/goalcompact: one non-selectable state/objective overview, explicit Create/Edit/Replace choices, short action-specific guidance, and separate current/proposed values in confirmation reviews. Completed menu labels navigate correctly rather than becoming objective text.Validation
go vet ./...andgit diff --check.Goal observation/control requires a loaded, goal-enabled shared app-server. Unsupported/file-only modes do not invent goal state. Codexometer adds no local goal persistence; Codex remains authoritative. No live user goals were created or modified during testing.