feat(agent): persist native session state in workspace snapshots#3333
feat(agent): persist native session state in workspace snapshots#3333tatoalo wants to merge 1 commit into
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
2e5a26b to
6362c07
Compare
|
Reviews (1): Last reviewed commit: "feat(agent): persist native session stat..." | Re-trigger Greptile |
6362c07 to
3045c06
Compare
There was a problem hiding this comment.
Well-tested feature addition that safely migrates and symlinks native agent session directories into a durable workspace root. Both bot-flagged concerns (data loss on first opt-in, partial symlink state from parallel execution) are addressed in the current diff, and the migration logic is defensive against data loss. No API contract changes, no security issues.
Problem
Directory resume snapshots preserve
/tmp/workspace, while Claude Code and Codex keep their native session state under home-directory config paths. Snapshot resumes therefore lose that native state and fall back to rebuilding history from persisted run logs. That loses in-session compaction, starts resumes with unnecessarily full context, and prevents Codex from using nativethread/resume.Follow-up to #3331.
Changes
POSTHOG_AGENT_STATE_DIRconfiguration to the agent server.projects,session-env,plans, andtodos.sessionsandshell_snapshots./tmp/workspace/.posthog/agent-stateso the existing workspace snapshot captures both agents' native resume state.