You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
9714d11(same day) — Fix for new session without interaction falling back to default old session style patched findSessionsByPrefix to exclude .events.jsonl sidecars.
The default branch (!forceNew && !forceResume) still resolves to the bare name with no timestamp — same as before the PR. The timestamp suffix was only wired into the --new and --resume paths.
The asymmetry
Three places create a "new" session, each with different semantics:
Trigger
What happens
reasonix code (first launch)
Plain name, no timestamp — but there's nothing to overwrite, so no harm.
reasonix code -n / --new
Timestamped name — old session preserved.
/new in TUI
loop.clearLog() rewrites .jsonl to [] — old messages lost, same filename.
Additionally, /new at runtime doesn't call resolveSession at all — it just truncates the current session file. So even if the default launch path were fixed to always use timestamps, /new would still overwrite in place.
Questions
Should every session name carry a timestamp by default (not just -n/--new)? So reasonix code creates code-reasonix-202503211430, and re-launching without flags picks up the latest code-reasonix-*.
Should /new in the TUI also spin off a new timestamped session instead of truncating the current one? This would preserve old conversations for later browsing via /sessions.
Is the current /new design (truncate in place) intentional to keep the system prompt hash stable for cache-first? The comment at clearLog says "keeps session + immutable prefix (cache-first invariant)" — but the system prompt hash derives from rootDir, not sessionName, so a timestamped child session would produce the same hash.
Related: resolveSession already exists and works — it just isn't wired into the launch default path or the /new slash handler.
Observed
reasonix code(first run)code-reasonixcode-reasonixreasonix code -n/--newcode-reasonix-202503211430/newin TUIcode-reasonix)How we got here
code-reasonix). Starting fresh overwrote in place.043dcb7(Apr 30) —feat: Timestamped session allowing multiple sessions by projectintroducedtimestampSuffix(),findSessionsByPrefix(),resolveSession().9714d11(same day) —Fix for new session without interaction falling back to default old session stylepatchedfindSessionsByPrefixto exclude.events.jsonlsidecars.34464ff(same day, PR feat: Timesteamped session allowing mutiple sessions by project. #12) —fix(session): preserve old sessions on "new"; clean .plan.json sidecars (#12)landed the current design.The current logic (session.ts:107):
The default branch (
!forceNew && !forceResume) still resolves to the bare name with no timestamp — same as before the PR. The timestamp suffix was only wired into the--newand--resumepaths.The asymmetry
Three places create a "new" session, each with different semantics:
reasonix code(first launch)reasonix code -n/--new/newin TUIloop.clearLog()rewrites.jsonlto[]— old messages lost, same filename.Additionally,
/newat runtime doesn't callresolveSessionat all — it just truncates the current session file. So even if the default launch path were fixed to always use timestamps,/newwould still overwrite in place.Questions
Should every session name carry a timestamp by default (not just
-n/--new)? Soreasonix codecreatescode-reasonix-202503211430, and re-launching without flags picks up the latestcode-reasonix-*.Should
/newin the TUI also spin off a new timestamped session instead of truncating the current one? This would preserve old conversations for later browsing via/sessions.Is the current
/newdesign (truncate in place) intentional to keep the system prompt hash stable for cache-first? The comment atclearLogsays "keeps session + immutable prefix (cache-first invariant)" — but the system prompt hash derives fromrootDir, notsessionName, so a timestamped child session would produce the same hash.Related:
resolveSessionalready exists and works — it just isn't wired into the launch default path or the/newslash handler.