Skip to content

feat: add goal-mode indicator to desktop status bar - #43020

Closed
akshan-main wants to merge 1 commit into
NousResearch:mainfrom
akshan-main:feat/goal-mode-indicator
Closed

feat: add goal-mode indicator to desktop status bar#43020
akshan-main wants to merge 1 commit into
NousResearch:mainfrom
akshan-main:feat/goal-mode-indicator

Conversation

@akshan-main

@akshan-main akshan-main commented Jun 9, 2026

Copy link
Copy Markdown

What does this PR do?

Adds a "Goal" label with subtle highlight in the desktop status bar when goal mode is active (via /goal). Mirrors the goal-mode badge that Codex shows.

When a user sets a goal with /goal, the backend emits a session.info event with goal_active: true, and the desktop frontend displays Goal session timer.

Type of Change

  • New feature (non-breaking change that adds functionality)

Changes Made

Backend

  • tui_gateway/server.py — _session_info() reports goal_active via GoalManager.is_active(); _mirror_slash_side_effects emits session.info after /goal; goal set/resume/clear handlers emit immediately; goal judge verdict re-emits on completion
  • hermes_cli/web_server.py — REST endpoint GET /api/sessions/{id} returns goal_active + goal_text

Frontend (desktop)

  • store/session.ts — $goalActive atom + setGoalActive()
  • use-message-stream.ts — handles goal_active from session.info events
  • use-session-actions.ts, use-session-state-cache.ts — preserves goal state across session switches
  • use-statusbar-items.tsx — renders Goal text with bg-(--chrome-action-hover) highlight
  • app/types.ts, types/hermes.ts, lib/chat-messages.ts, lib/chat-runtime.ts — type plumbing
  • i18n/types.ts, i18n/en.ts, i18n/ja.ts, i18n/zh.ts, i18n/zh-hant.ts — all 4 locales

How to Test

  1. Start Hermes Desktop
  2. Type /goal keep working until you count till 20 and print it in chat
  3. Status bar shows a Goal label with highlight, next to session timer.
  4. Goal loop runs; after completion the label disappears

Checklist

  • I have read the Contributing Guide
  • My commit message follows Conventional Commits (feat(desktop): ...)
  • My PR contains only changes related to this feature
  • I have run pytest tests/ -q and all tests pass
  • I have added tests for my changes
  • I have tested on my platform: macOS

Screenshots

Screenshot 2026-06-09 at 12 05 18 PM

Status bar shows Goal text with highlight, right of session timer. Hidden when no goal is set. This only displays when the chat window pertaining to it selected, if switched to another chat window, this doesn't appear.

Shows a 'Goal' label with highlight in the bottom-right status bar
when goal mode is active (via /goal). Mirrors Codex's goal-mode badge.

Backend:
- _session_info() reports goal_active via GoalManager.is_active()
- _mirror_slash_side_effects emits session.info after /goal commands
- Goal set/resume/clear handlers emit session.info immediately
- Goal judge verdict re-emits session.info on turn completion
- REST endpoint GET /api/sessions/{id} returns goal_active + goal_text

Frontend:
-  atom + setGoalActive for reactive state
- session.info handler extracts goal_active from gateway events
- Goal state preserved across session switches (state cache)
- Status bar renders 'Goal' text with bg-(--chrome-action-hover)
- i18n with English, Japanese, Chinese, Traditional Chinese
@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have labels Jun 9, 2026
@alt-glitch alt-glitch added comp/desktop Electron desktop app (apps/desktop/*) comp/cli CLI entry point, hermes_cli/, setup wizard and removed comp/gateway Gateway runner, session dispatch, delivery labels Jun 26, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused desktop status-bar feature. The premise remains valid: current main has neither goal_active in tui_gateway/server.py:_session_info nor a goal status-bar item.

Problems

  • tui_gateway/server.py:2041 reads the goal key only from the optional session argument. This PR also invokes _session_info(agent) without that argument at lines 2576 and 3766, so those paths necessarily publish goal_active: false. Use an agent.session_id fallback (as current main now does for other session metadata) and cover it.
  • The PR has no tests. Add coverage for backend emission and Desktop active-session cache switching, including active → paused/cleared updates.

Suggested changes

  • Port the frontend work to current main's split metadata path: apps/desktop/src/app/session/hooks/use-message-stream/utils.ts and use-session-state-cache.ts. The former pre-refactor hook files in this branch no longer represent the active architecture.

Automated hermes-sweeper review.

Comment thread tui_gateway/server.py
try:
from hermes_cli.goals import GoalManager

session_key = (session or {}).get("session_key")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_session_info(agent) is also called without a session object on this branch (for example lines 2576 and 3766). In those calls this lookup is empty and the payload always reports goal_active: false; fall back to agent.session_id (and cover that path) so resumed/fallback session metadata remains accurate.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted, working on this

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 14, 2026
teknium1 added a commit that referenced this pull request Jul 26, 2026
Append a "⊙ goal 3/20" segment (turns used / turn budget) to the CLI
status bar whenever a standing /goal is active. Mirrors the desktop
composer goal indicator: active-goal-only — paused/done goals stay out
of the bar since they already print their own glyph lines in-thread.

- Snapshot: goal_active / goal_turns_used / goal_max_turns from the
  cached GoalManager (in-memory attribute read, no DB hit per repaint).
- Rendered in all three width tiers of both _build_status_bar_text and
  _get_status_bar_fragments, and it respects the /statusbar toggle for
  free (the toggle gates _get_status_bar_fragments as a whole).
- Tests: segment composition, active-only contract, all width tiers.

Status-bar goal indicator concept from #43020.

Co-authored-by: Akshan Krithick <akshankrithick305@gmail.com>

Assisted-by: Claude Fable 5 via Hermes Agent
teknium1 added a commit that referenced this pull request Jul 27, 2026
Append a "⊙ goal 3/20" segment (turns used / turn budget) to the CLI
status bar whenever a standing /goal is active. Mirrors the desktop
composer goal indicator: active-goal-only — paused/done goals stay out
of the bar since they already print their own glyph lines in-thread.

- Snapshot: goal_active / goal_turns_used / goal_max_turns from the
  cached GoalManager (in-memory attribute read, no DB hit per repaint).
- Rendered in all three width tiers of both _build_status_bar_text and
  _get_status_bar_fragments, and it respects the /statusbar toggle for
  free (the toggle gates _get_status_bar_fragments as a whole).
- Tests: segment composition, active-only contract, all width tiers.

Status-bar goal indicator concept from #43020.

Co-authored-by: Akshan Krithick <akshankrithick305@gmail.com>

Assisted-by: Claude Fable 5 via Hermes Agent
@teknium1

Copy link
Copy Markdown
Contributor

The goal-mode status bar indicator was unified into #72244 (now merged) with credit. Thanks!

@teknium1 teknium1 closed this Jul 27, 2026
sebmarion pushed a commit to sebmarion/hermes-agent that referenced this pull request Aug 6, 2026
Append a "⊙ goal 3/20" segment (turns used / turn budget) to the CLI
status bar whenever a standing /goal is active. Mirrors the desktop
composer goal indicator: active-goal-only — paused/done goals stay out
of the bar since they already print their own glyph lines in-thread.

- Snapshot: goal_active / goal_turns_used / goal_max_turns from the
  cached GoalManager (in-memory attribute read, no DB hit per repaint).
- Rendered in all three width tiers of both _build_status_bar_text and
  _get_status_bar_fragments, and it respects the /statusbar toggle for
  free (the toggle gates _get_status_bar_fragments as a whole).
- Tests: segment composition, active-only contract, all width tiers.

Status-bar goal indicator concept from NousResearch#43020.

Co-authored-by: Akshan Krithick <akshankrithick305@gmail.com>

Assisted-by: Claude Fable 5 via Hermes Agent
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Append a "⊙ goal 3/20" segment (turns used / turn budget) to the CLI
status bar whenever a standing /goal is active. Mirrors the desktop
composer goal indicator: active-goal-only — paused/done goals stay out
of the bar since they already print their own glyph lines in-thread.

- Snapshot: goal_active / goal_turns_used / goal_max_turns from the
  cached GoalManager (in-memory attribute read, no DB hit per repaint).
- Rendered in all three width tiers of both _build_status_bar_text and
  _get_status_bar_fragments, and it respects the /statusbar toggle for
  free (the toggle gates _get_status_bar_fragments as a whole).
- Tests: segment composition, active-only contract, all width tiers.

Status-bar goal indicator concept from NousResearch#43020.

Co-authored-by: Akshan Krithick <akshankrithick305@gmail.com>

Assisted-by: Claude Fable 5 via Hermes Agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants