Saved session label (/save) lost after resume + new prompt
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
Research direction
Start at the metadata cache writer that refreshes the recent_sessions row after a new prompt, then trace how /save stores saved and save_label in the session JSON and how /resume reads the cache. Done when a resumed saved session keeps its label and remains in the saved section after another prompt.
Written by the indexing model from the issue text.
Description
Bug
/save [label] writes saved: true and save_label into the session's own JSON file (~/.jcode/sessions/<id>.json). But the session picker reads a separate local index cache (~/.jcode/session-metadata-v1.sqlite3, table recent_sessions), not the session JSON directly.
When a saved session is resumed and a new prompt is sent, the sqlite cache row for that session gets refreshed (updated_at_ms bumps) but the saved flag is not carried over from the JSON file — it resets to 0 in the cache. The label becomes invisible in /resume's saved section even though the underlying session JSON still has saved: true and the correct save_label.
Repro
- In a session, run
/save my-label. - Confirm it shows up under the saved section in
/resume. - Resume that session, send any new chat prompt.
- Open
/resumeagain — the session no longer appears as saved.
Confirmed on my machine
- Session
session_hedgehog_...JSON file:saved: true,save_label: "DC 2nd Shop Auth". - Same session's row in
session-metadata-v1.sqlite3recent_sessionstable:saved = 0, withupdated_at_msnewer than the save itself. - Zero rows in the sqlite cache currently have
saved = 1, despite at least one session's JSON havingsaved: true.
Expected
The metadata cache writer should preserve saved/save_label on every session update (e.g. after each new prompt), not only at the moment /save is run, so bookmarked sessions stay discoverable in the resume picker across the session's lifetime.
Environment
- Jcode v0.81.2-dev (8e7b304)
- macOS, aarch64
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1jehuang/jcode
-
OrcaRouter is in the login catalog but has no ProviderChoice, so it can't be selected explicitly Open
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
-
Session::save() skips untouched sessions, so is_debug and canary never persist (4 failing tests) Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
area: providers autonomous: clear bug triage: reproducible
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area: providers autonomous: no bug triage: needs-decision
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100