fix: live session names sync with /rename + SPA fallback - #37
Merged
Conversation
aterrylu
enabled auto-merge (squash)
March 17, 2026 23:48
- Enrich GET /api/sessions with latest JSONL titles via batchGetTitles. When a user /renames in the terminal, the live session sidebar now picks up the new name on the next 5s poll. - Title enrichment is best-effort with try-catch — filesystem errors log a warning but never block the session list response. - Returns new objects to avoid mutating the in-memory session store. - SPA catch-all now returns JSON 404 for /api/*, /ws/*, /mcp paths (all HTTP methods) with path context for debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
aterrylu
force-pushed
the
terry/fix-session-name-sync
branch
from
March 17, 2026 23:52
bdba797 to
eb4a5eb
Compare
nox-0x
approved these changes
Mar 17, 2026
nox-0x
left a comment
Collaborator
There was a problem hiding this comment.
Clean fix on both fronts. The best-effort title enrichment in GET /api/sessions is well-structured — mtime-based caching keeps repeated polls cheap, error handling falls back gracefully, and new objects are returned instead of mutating the in-memory store. The SPA fallback ordering is correct: serveStatic passes through on missing files, and the explicit JSON 404 guards for /api/*//ws/*//mcp catch the preview pane HTML-bleeding bug. No issues blocking merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/renamechanges. TheGET /api/sessionsendpoint enriches session names with the latestcustomTitlefrom JSONL files viabatchGetTitles. Previously, names were frozen at creation time.index.htmlfor/api/*and/ws/*paths, causing the preview pane to get HTML instead of JSON. Now returns JSON 404 for API/WS/MCP routes. (Supersedes fix: SPA fallback returning HTML for API routes #36)Test plan
/renameit in the terminal — sidebar live session name should update within 5s/preview?file=...) — should work🤖 Generated with Claude Code