#1287·jcode

Saved session label (/save) lost after resume + new prompt

Author: eujindigital-netizenCreated Sep 17, 2026Updated Sep 17, 2026

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

  1. In a session, run /save my-label.
  2. Confirm it shows up under the saved section in /resume.
  3. Resume that session, send any new chat prompt.
  4. Open /resume again — 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.sqlite3 recent_sessions table: saved = 0, with updated_at_ms newer than the save itself.
  • Zero rows in the sqlite cache currently have saved = 1, despite at least one session's JSON having saved: 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