Skip to content

fix(chat): Tell an already-open Chat surface when Director or Harness changes - #480

Merged
omesser merged 1 commit into
mainfrom
fix/473-chat-settings-mode-reload
Sep 7, 2026
Merged

omesser merged 1 commit into
mainfrom
fix/473-chat-settings-mode-reload

Conversation

@omesser

@omesser omesser commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Why

Open Chat, flip Director on or off (or Harness off or on) in Settings, and the window stays in the mode it opened with: composer ready, empty-none, or empty-off. The buddy on the desk follows the new setting; this surface does not. Closing and reopening Chat shows the right mode. macOS, Windows, and X11 Settings all write the same SettingsSession::apply, so the miss is on every OS. The tray Director toggle had the same gap.

What changed

chat-opening now carries a full ChatOpening (configured / enabled / login), and chat.js re-runs attached() on that event instead of only updating the header.

Settings apply sends ReloadChat when Director or Harness source actually changes; the frame loop pushes after apply_switch so inspect is current. No per-OS Settings code. The in-window log is not wiped — this is a push, not a webview reload.

Deliberately not done: spawning or dropping a Harness session mid-run (ADR-0008). Harness off/on still takes the next launch; Chat then matches what a freshly opened window would show now. HTTP Completer attach while Chat is open still updates on send.

How to verify

  • cargo test --manifest-path src-tauri/Cargo.toml --bin ai-buddy open_chat_surface
  • cargo test --manifest-path src-tauri/Cargo.toml --bin ai-buddy director_on_patch
  • cargo test --manifest-path src-tauri/Cargo.toml --bin ai-buddy chat_opening_from_inspect
  • cargo test --manifest-path src-tauri/Cargo.toml --bin ai-buddy chat_who_after_switch
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
  • Manual: open Chat, toggle Director in Settings and from the tray — expect empty-off vs composer without closing the window. Toggle Harness — Chat should match a window you close and reopen (often unchanged until relaunch).

Notes

Harness attach remains a next-launch restart (#436). This PR only makes an already-open Chat surface re-read the opening a new one would.

Closes #473

— Cursor agent, on @omesser's behalf.

Made with Cursor

… changes

Co-authored-by: Cursor <cursoragent@cursor.com>
@omesser
omesser force-pushed the fix/473-chat-settings-mode-reload branch from 4ea7833 to 0a8622c Compare September 7, 2026 09:03
@omesser
omesser merged commit 4bd3635 into main Sep 7, 2026
5 checks passed
@omesser
omesser deleted the fix/473-chat-settings-mode-reload branch September 7, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(chat): Toggling Director or Harness in Settings leaves the Chat surface in the old mode

1 participant