mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
New session (⌘N, the sidebar New session row, and the per-worktree "+") all funnel into `startFreshSessionDraft`, which sets the stored-session selection to null. Fronting the workspace pane was never done by that action — it happened as a side effect of `$selectedStoredSessionId.listen`. Nanostores `.listen` only notifies on an actual value CHANGE, so: selected = <id> -> set null -> changed -> workspace fronted (fine) selected = null -> set null -> no change -> listener never runs (dead) With main already parked on a blank draft and a session tile fronted, every subsequent new-session gesture created the session but never revealed it, so it looked like nothing happened at all. Reproduced deterministically against the running app: 4/4 silent no-ops in that state, versus a correct reveal when the selection did change. Extract the listener body as `homeSelectionToWorkspace` and add `homeFreshDraftToWorkspace`, called explicitly from `startFreshSessionDraft`. A fresh draft is a primary navigation, so it applies the homing policy directly instead of depending on a change notification. Homing is idempotent, so the listener firing as well is harmless. The explicit path deliberately does NOT consume the boot-restore one-shot: that flag is armed for a specific pending resume, and swallowing it here would let a cold start clobber the persisted active tab (the ⌘R bug the flag exists to prevent). Covered by its own test. Unit tests verified RED without the fix and GREEN with it. Also adds an E2E covering the two-worktree "+" scenario from the report. That path turns out to be healthy — the spec passes with and without the fix, and it is labelled as coverage rather than a regression test in its header. It is kept because it pins the fiddly worktree-lane fixture (projects registered via the folder-open flow, since a desktop session does not adopt its launch cwd as a workspace) and would catch a future change that collapses the two lanes into one session. |
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||