dsh tui: --resume selects the session but renders an empty conversation until the first message #4750
Replies: 2 comments
|
This is a There is no TUI package anywhere in this repository; Your analysis reads correctly to me from the outside: selecting a session and rendering its transcript are separate steps, and the boot path does the first without the second, so the conversation stays empty until something else triggers a render. That the transcript appears after the first message — rather than never — is consistent with that, since the send path is what folds the history in. One thing worth adding when you re-file: your companion report (#4751, the exit hint naming a I verified the harness side of #4751 while looking: the CLI ships exactly |
|
Implemented in the owning plugin and opened for maintainer review:
The patch eagerly hydrates the session selected by startup Verification on the plugin's real Harness bundle composition: 399/399 tests passed (including 188 app tests), TypeScript build passed, and |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Booting the TUI with
--resume <session>selects the persisted session but renders an empty conversation — visually indistinguishable from a brand-new session. The old transcript only appears after the user sends a message (or manually re-selects the session from the sessions list).Environment
dsh0.1.1-rc.2 (@deepseek-ai/dsh)dsh-tui-plugin0.3.0To reproduce
dsh --profile tui→ have a conversation → exit (note the session id in the exit hint).dsh --profile tui --resume <session-id>.Expected: booting with
--resumeshould display the persisted conversation immediately.Root cause analysis (from reading
lib/tui/app.jsin dsh-tui-plugin@0.3.0)The boot path in
refreshSessions()only selects the session:ensureCurrent()(line 535) merely setsthis.currentand resets scroll — it does not attach an agent or fold the transcript. The two other paths that open a session both eagerly attach the agent:newSessionWithAgent()(line 1029):await this.currentAgent();selectSession(id)(line 1042):await this.currentAgent();currentAgent()(line 596) is what actually resumes the agent (agents.resume(...)) and folds the full persisted history viaattachResumedSession()(lines 615-628). Because the--resumeboot path never calls it,state.transcriptstays empty until the firstsend()(line 819) or a manualselectSession.Data is intact
This is purely a rendering/attach-timing bug, not data loss. The persisted
session.jsonl.zstdfor the affected session decodes to a complete artifact (valid header + 314 event records, 9 turns, cleanturn/end), and resuming the same session via the sessions list works correctly.Suggested fix
In the boot path, after
ensureCurrent(this.startup.resume),await this.currentAgent()(mirroringselectSession), so the transcript renders on first paint.All reactions