emrg: GUI open-sessions sidebar shows title for cross-project sessions (rant 2026-08-14T12:01:44) - #782
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (verified locally: pytest 804 green, GUI npm test 245/245 with the new cross-project title test, import + CLI checks pass; CI test + test-windows both PASS on this PR; diff matches the rant 12:01:44 spec: entry.title || cur.title || entry.sid priority chain + async per-project title fetch in touchOpenSession + rename sync)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (2/3)
Reviewed on rebased head 319c649 (conflict resolved after #781 merge: merged master in, kept Agent.md GUI 245 — rebase dropped #781's already-merged commit, GUI delta unchanged).
Verified GUI delta (4 files, +49/-6):
main.js: rename_session success → immediately syncopenSessions[sid].title+ broadcast;touchOpenSession→ async per-projectlistSessions(projectPath)fetch, setsv.title+ broadcast if found (fail → undefined → sid fallback);openSessionsList()passestitlethrough;listSessions(cwd=projectDir)parameterized for cross-project query.sidebar.js: title priority chainentry.title || cur.title || entry.sid— cross-project entries (not in current project's state.sessions) now resolve via entry.title instead of raw sid.- New smoke test (3 states): entry.title present → wins over sid; cross-project no title → sid fallback; current-project → state.sessions title. Discriminating, not smoke-only.
- Agent.md GUI 244→245 synced.
Local: GUI npm test 245/245 (incl. new test) + pytest 804 green. CI test + test-windows re-running on new head (watch). MERGEABLE.
Needs 1 more ✅ from a different cycle.
Summary
Host rant 2026-08-14T12:01:44: in the GUI "open sessions" sidebar region, cross-project opened sessions show only the session id even when the session has a name/title. Current-project sessions are unaffected (they resolve via
App.state.sessions).Root cause (verified)
renderOpenSessions(sidebar.js) looks up titles only inApp.state.sessions, which is populated bylist_sessions(cwd=projectDir)— i.e. only sessions of the current global project dir.openSessionsList()(main.js) entries were{sid, projectName, projectPath, lastActive}— notitlefield.emrg-evolution-emrg-tasksession opened while the global project dir is~/.emrg) are missing fromstate.sessions→cur = {}→ title falls back toentry.sid.Fix
listSessions(cwd = projectDir)gains an optional cwd param;touchOpenSessionasynchronously fetches the session's own project list (listSessions(projectPath)) and setsv.titlewhen found (fail/no title → stays undefined → sid fallback);openSessionsList()now includestitle;renameSessionhandler syncsv.title+ rebroadcasts after a successful rename.entry.title || cur.title || entry.sid(entry.title wins for cross-project, cur.title for current-project, sid last).Verification
npm test: 245/245 pass (120 renderer smoke, was 119).