Skip to content

Persisted session-*.env / *.mcp.json bake absolute paths β†’ stopped sessions un-resumable after a home/box moveΒ #429

Description

@vikasprogrammer

Severity: 🟠 portability

Discovered during the instawp box-to-box migration (2026-07-21).

Problem

Resume replays a persisted per-session env file (<connectors>/session-<id>.env, written by TerminalManager ~src/terminal.ts:2303, sourced by terminal/claude-launch.sh ~line 23 on RESUME=1). It stores absolute AGENT_DIR, MCP_CONFIG, HOOK, COMPANY_FILE. session-<id>.mcp.json likewise bakes absolute MCP server command paths.

After the data home moves, every stopped session dies at claude-launch.sh:36:

cd "$AGENT_DIR" || { red "agent folder not found: $AGENT_DIR"; exec bash; }
# agent folder not found: /home/vikas/tools/agent-os/data/agents/engineer

New sessions are fine (they recompute paths from the live home); only resume breaks.

Fix direction

  • Persist these values home-relative and reconstruct absolutes against the current home at resume; or
  • Recompute AGENT_DIR/MCP_CONFIG/HOOK/COMPANY_FILE from the live manifest + home at resume instead of sourcing stale absolutes. The persisted file should only hold truly session-specific bits (CLAUDE_SESSION_ID, secret, agent id, task).

Workaround

docs/tenant-box-migration.md Β§4 sed-rewrites the connector session files post-move.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions