Skip to content

fix: import legacy sessions from config session dir#3247

Merged
esengine merged 1 commit into
main-v2from
codex/fix-config-session-migration
Jun 6, 2026
Merged

fix: import legacy sessions from config session dir#3247
esengine merged 1 commit into
main-v2from
codex/fix-config-session-migration

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • import legacy v0.x event logs from the current user config session directory in addition to ~/.reasonix/sessions
  • use a separate import marker for config-root session imports so source markers remain independent
  • add boot and agent regression coverage, and update the migration guide

Tests

  • go test ./internal/agent -run 'TestMigrateLegacy'\n- go test ./internal/boot -run 'TestBuildMigratesLegacy(ConfigEndToEnd|SessionsFromConfigSessionDir)'\n- go test ./internal/agent ./internal/boot\n\n## Notes\n- go test ./... is blocked locally by machine state: with normal HOME, internal/control reads local MCP config; with isolated HOME/XDG/AppData, only the existing macOS sandbox confinement tests fail (internal/sandbox and internal/tool/builtin).\n

@SivanCola SivanCola requested a review from esengine as a code owner June 5, 2026 11:08
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 5, 2026
@esengine esengine merged commit ad3fae6 into main-v2 Jun 6, 2026
9 checks passed
@esengine esengine deleted the codex/fix-config-session-migration branch June 6, 2026 10:35
esengine added a commit that referenced this pull request Jun 6, 2026
…est (#3371)

TestBuildMigratesLegacySessionsFromConfigSessionDir used t.Chdir(proj) to point Build at a temp project dir, which makes that dir the process cwd. On Windows a cwd directory cannot be removed, so t.TempDir cleanup failed (being used by another process) even though all assertions passed — this reddened the main-v2 Windows CI. Use the Build WorkspaceRoot option instead: it loads the project config without changing the process cwd. Fixes the #3247 regression.
esengine added a commit that referenced this pull request Jun 11, 2026
… dirs (#3944)

The flat import (#3247) reconstructed v0.x sessions into the global
config session dir, but the desktop sidebar only lists the per-workspace
projects/<slug>/sessions dirs — so for desktop users the import
"succeeded" into a directory nothing reads, and upgraders kept reporting
their history gone (#3937).

- the per-workspace session-dir layout moves to config.ProjectSessionDir
  (the desktop helper now delegates), so the importer can route to it
- the importer reads each session's v0.x sidecar (<name>.meta.json):
  a live workspace routes the session into that workspace's dir, the
  summary becomes its display title; dead/missing workspaces fall back
  to the global dir as before
- a new one-time routed pass deliberately ignores the flat-import
  markers so existing upgraders get their stranded sessions re-homed;
  a global-dir file is only moved when its mtime matches the legacy
  event log (the flat import stamped it), so a same-named native v1+
  session is never touched

Trade-off: sessions a user deleted after the flat import reappear once
(in their workspace) during the routed pass; there is no record that
distinguishes "deleted by user" from "never imported", and recovering
every stranded upgrade is worth one resurrection.

Closes #3937

Co-authored-by: reasonix <reasonix@deepseek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants