fix(tui): stop stale cached session title from pinning New Session - #5258
Conversation
41b64ed to
35c888b
Compare
|
Well, the commits on main are landing way too fast for me to keep up, so I'll just leave this PR here as is. Hi @Hmbown, when you're up, could you take a look and merge this manually? Maybe the CodeWhale Bot should create its own branch and batch several commits together before submitting — that would make this a lot easier to catch up with. |
build_session_snapshot restored the title from the in-memory cache before the disk lifecycle merge, and the cache is only refreshed at the end of the function. A snapshot taken before the first user message therefore pinned the placeholder title forever: every later snapshot overwrote the conversation-derived title with the stale cached copy. Title now resolves in priority order: 1. disk record, when the session already exists (user renames survive autosave, Hmbown#2934/Hmbown#4397); 2. in-memory cache, when no disk record exists for the session yet; 3. the title computed from the conversation (first user message). A placeholder that survived from an earlier snapshot yields to the computed title once a user message exists, healing both fresh and pre-existing sessions. The placeholder string is centralized in DEFAULT_SESSION_TITLE so the healing rule cannot drift from the generator. Regression tests: stale cached placeholder no longer overrides the generated title; a persisted placeholder record yields to the computed title. Existing picker-rename tests (rename survives autosave) still pass. Full codewhale-tui suite: 9708 passed; 10 failures all verified pre-existing on main (6) or parallel-flaky (4, pass in isolation). Reviewed by a sub-agent reviewer: no Critical/Major findings; Minor findings addressed (comments corrected, placeholder centralized, cache assertions completed); one documented edge (a session deliberately renamed to the literal placeholder title yields to the computed title).
That's a great idea - sorry - I've been trying to get this new release out and keep running into things I want to fix. I'm able to get this merged - don't worry! Thank you so much for this!! I've just added a billion issues for 0.9.5 if you want to see where things are headed 🙂 |
- runtime-contract: regenerate tool_catalog for todo_write sole surface (plan/act/operate full/active now list todo_write, not work_update); bumps bytes/sha + prompt stages (agent plugins work) - web: public-surface-contract expects todo_write (matches docs/RUNTIME_SIMPLIFICATION_DESIGN already) - source-structure: 676325 -> 676652 (+327) — 321 for bf69e7f session-title fix plus 6 for stall/UI tweaks; durable test asset - engine: raise no_user_input_continues 12 -> 20 (6 sites) to stop false 'hit (12)' stops on long todo_write loops; preserves anti-runaway - subagent: GENERAL/PLAN intros now say todo_write, not work_update (child priming fix) - palette: WHALE_TEXT_HINT #8491AA -> #8A99B3 (+0.4 contrast) - tui: add BehavioralTipTodoWrite + 15 locale keys (hint: track with todo_write) - subagent tests: fmt fixes for isolated_fleet_roster_with + assert! expansion Refs: efcf47a, 21ed173, ec5747f, Hmbown#5258
77a56cf to
301aa91
Compare
- runtime-contract: regenerate tool_catalog for todo_write sole surface (plan/act/operate full/active now list todo_write, not work_update); bumps bytes/sha + prompt stages (agent plugins work) - web: public-surface-contract expects todo_write (matches docs/RUNTIME_SIMPLIFICATION_DESIGN already) - source-structure: 676325 -> 676652 (+327) — 321 for bf69e7f session-title fix plus 6 for stall/UI tweaks; durable test asset - engine: raise no_user_input_continues 12 -> 20 (6 sites) to stop false 'hit (12)' stops on long todo_write loops; preserves anti-runaway - subagent: GENERAL/PLAN intros now say todo_write, not work_update (child priming fix) - palette: WHALE_TEXT_HINT #8491AA -> #8A99B3 (+0.4 contrast) - tui: add BehavioralTipTodoWrite + 15 locale keys (hint: track with todo_write) - subagent tests: fmt fixes for isolated_fleet_roster_with + assert! expansion Refs: efcf47a, 21ed173, ec5747f, Hmbown#5258
301aa91 to
9d24af7
Compare
- runtime-contract: regenerate tool_catalog for todo_write sole surface (plan/act/operate full/active now list todo_write, not work_update); bumps bytes/sha + prompt stages (agent plugins work) - web: public-surface-contract expects todo_write (matches docs/RUNTIME_SIMPLIFICATION_DESIGN already) - source-structure: 676325 -> 676652 (+327) — 321 for bf69e7f session-title fix plus 6 for stall/UI tweaks; durable test asset - engine: raise no_user_input_continues 12 -> 20 (6 sites) to stop false 'hit (12)' stops on long todo_write loops; preserves anti-runaway - subagent: GENERAL/PLAN intros now say todo_write, not work_update (child priming fix) - palette: WHALE_TEXT_HINT #8491AA -> #8A99B3 (+0.4 contrast) - tui: add BehavioralTipTodoWrite + 15 locale keys (hint: track with todo_write) - subagent tests: fmt fixes for isolated_fleet_roster_with + assert! expansion Refs: efcf47a, 21ed173, ec5747f, Hmbown#5258
9d24af7 to
192e84c
Compare
|
No worries at all — shipping a release is way more important than keeping up with it. Thanks for merging it manually, really appreciate it! |
- runtime-contract: regenerate tool_catalog for todo_write sole surface (plan/act/operate full/active now list todo_write, not work_update); bumps bytes/sha + prompt stages (agent plugins work) - web: public-surface-contract expects todo_write (matches docs/RUNTIME_SIMPLIFICATION_DESIGN already) - source-structure: 676325 -> 676652 (+327) — 321 for bf69e7f session-title fix plus 6 for stall/UI tweaks; durable test asset - engine: raise no_user_input_continues 12 -> 20 (6 sites) to stop false 'hit (12)' stops on long todo_write loops; preserves anti-runaway - subagent: GENERAL/PLAN intros now say todo_write, not work_update (child priming fix) - palette: WHALE_TEXT_HINT #8491AA -> #8A99B3 (+0.4 contrast) - tui: add BehavioralTipTodoWrite + 15 locale keys (hint: track with todo_write) - subagent tests: fmt fixes for isolated_fleet_roster_with + assert! expansion Refs: efcf47a, 21ed173, ec5747f, Hmbown#5258
192e84c to
5de9b71
Compare
- runtime-contract: regenerate tool_catalog for todo_write sole surface (plan/act/operate full/active now list todo_write, not work_update); bumps bytes/sha + prompt stages (agent plugins work) - web: public-surface-contract expects todo_write (matches docs/RUNTIME_SIMPLIFICATION_DESIGN already) - source-structure: 676325 -> 676652 (+327) — 321 for bf69e7f session-title fix plus 6 for stall/UI tweaks; durable test asset - engine: raise no_user_input_continues 12 -> 20 (6 sites) to stop false 'hit (12)' stops on long todo_write loops; preserves anti-runaway - subagent: GENERAL/PLAN intros now say todo_write, not work_update (child priming fix) - palette: WHALE_TEXT_HINT #8491AA -> #8A99B3 (+0.4 contrast) - tui: add BehavioralTipTodoWrite + 15 locale keys (hint: track with todo_write) - subagent tests: fmt fixes for isolated_fleet_roster_with + assert! expansion Refs: efcf47a, 21ed173, ec5747f, Hmbown#5258
Aggregate 678400 -> 680500 (+2100) for stacked PRs Hmbown#5258, Hmbown#5205, Hmbown#5256, Hmbown#5257, Hmbown#5255 plus copilot runtime APIs (goal, verifier, memory with native_memory.rs new 1017 large, mcp, skill). Large 177->178. Passes check-source-structure-budget.
Record Shizuku's exact current PR head as v0.9.5 ancestry. The verified release tree already contains the equivalent session-title repair; the ours merge preserves the contributor's commit and GitHub provenance without replaying the older release integration.
Summary
Session titles were stuck at "New Session" forever: after the first user message, the title computed from the conversation was overwritten by a stale copy held in the in-memory session metadata cache, and the cache itself is only refreshed at the end of each snapshot. A snapshot taken before the first user message pinned the placeholder, and every later snapshot restored it.
Changes
tui/ui/frame.rs):build_session_snapshotno longer restores the title from the cache unconditionally. Title now resolves in priority order: (1) the persisted disk record when the session already exists (a user rename applied through the session manager survives autosave — feat: sidebar sessions panel with auto-resume and session history browsing #2934 / v0.9.2 Control plane: multi-session dashboard with peek approvals #4397 behavior preserved); (2) the in-memory cache when no disk record exists for the session yet (sessions that have never been saved); (3) the title computed from the conversation (first user message). A placeholder that survived from an earlier snapshot yields to the computed title once a user message exists, healing both fresh and pre-existing sessions.session_manager.rs,session.rs,session_resume.rs): the "New Session" placeholder is now theDEFAULT_SESSION_TITLEconstant (5 usages replaced), so the healing rule inbuild_session_snapshotcannot drift from the generator.tui/ui/tests.rs): two new tests — a stale cached placeholder no longer overrides the generated title, and a persisted placeholder record yields to the computed title once the conversation has content. Both fail on the old code.Type of Change
Testing
cargo test -p codewhale-tui stale_cached_placeholder_title— 1 passedcargo test -p codewhale-tui persisted_placeholder_title— 1 passedcargo test -p codewhale-tui picker_rename— 2 passed (rename survives autosave regression)cargo test -p codewhale-tuifull suite — 9708 passed; 10 failures verified unrelated: 6 pre-existing on main (verified via stash), 4 parallel-flaky (pass in isolation)Checklist
Related Issues
No-Issue: session title stuck at "New Session" after sending messages was found by myself, no relevant issues.