emrg: gui: fix open-session button for task session IDs + full-chain switch logging - #958
Conversation
…logging (rant 2026-08-24T14:29:37)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 180730
Re-verified: head f904d42 unchanged, MERGEABLE/CLEAN, CI green (test + test-windows). Reviewed all 6 GUI files: SESSION_ID_RE widened to accept emrg-evolution-* task session IDs (root-cause fix), plus full-chain logging (conn-manager open path, switchSession entries/rejections, emrg:log IPC bridge with level whitelist + 2000-char truncation, renderer click chain). Local: GUI 252 pass / 0 fail, pytest 1039 pass / 1 skip.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 181352
Re-verified: head f904d42 unchanged, MERGEABLE/CLEAN, CI green (test + test-windows). Code re-read: SESSION_ID_RE now accepts both s_... and emrg-evolution-* forms; full-chain logging covers open/reuse/create/connected/resume/FAILED plus switch entries/rejections and renderer clicks via the emrg:log bridge. No issues found — LGTM.
What
Fixes the GUI task panel "Open session" (打开会话) button, which always failed for fixed task sessions, and adds full-chain logging across the switch-session path for future troubleshooting.
Root cause:
daemon_client.jsSESSION_ID_REonly accepted interactive session IDs (s_<6-digit date>_<4-digit time>_<hex id>), so fixed task session IDs likeemrg-evolution-<task-name>were rejected withinvalid session_id— the "Open session" button could never work for task sessions.Changes (6 files)
daemon_client.js— widenedSESSION_ID_REto also acceptemrg-evolution-<task-name>(fixed task session IDs). Both forms flow through the GUI switchSession/打开会话 path and are now accepted.main.js—emrg:switchSessionnow logs every entry point: request, rejections (invalid id / invalid project path / cap exceeded / own stream busy), prev→target switch, open success/failure with error, session-not-found fallback. Added anemrg:logIPC bridge (level whitelist, 2000-char truncation) so the renderer writes into the same~/.emrg/emrg-gui.logtimeline as main.preload.js— exposedemrg.log(level, msg)bridge to the renderer.renderer/js/app.js— switchSession/switchView now log enter/abort/IPC call/return/exception/view transitions.renderer/js/dialogs.js— task panel open-session click path logs: click, missing session_id skip, switchSession call/resolve/throw.conn-manager.js—open()logs start/reuse/create/connected/resume send/OK/FAILED, so connection-level failures are visible in the log chain.Verification
npm testinemrg/gui/)Rant: 2026-08-24T14:29:37 (GUI 任务管理「打开会话」按钮失效 — SESSION_ID_RE 正则拒绝任务会话 ID + 全链路日志排障)