Skip to content

feat(web): import local Codex and Claude Code sessions - #291

Draft
7oMB2006 wants to merge 1 commit into
feat/stepcode-web-mvp-ghfrom
feat/session-import
Draft

7oMB2006 wants to merge 1 commit into
feat/stepcode-web-mvp-ghfrom
feat/session-import

Conversation

@7oMB2006

Copy link
Copy Markdown
Collaborator

Problem

Users moving to StepCode currently need to manually copy context from other
coding clients. Local history should be discoverable, reviewable and importable
without running the source agent or making a model request.

Changes

  • Add offline Codex and Claude Code adapters and built-in Web settings for
    discovery, compatibility preview, destination mapping and import jobs.
  • Exclude Codex archives and child sessions by default.
  • Import the exact reviewed snapshot, including contained supported images,
    even when an active source continues writing.
  • Publish native sessions atomically without overwriting existing copies;
    persist job outcomes and support cancellation between sessions.
  • Preserve import provenance, compaction attachments and explicit completed,
    failed or unknown tool outcomes in continuation context.
  • Read complete metadata-bearing JSONL records, including Claude first messages
    larger than 64 KiB.

Behavior and compatibility

This migrates history, not source processes, credentials, approvals, filesystem
checkpoints or encrypted reasoning. Historical tools remain evidence and are
not replayed. Imported model selection and usage do not become native state.

The Web host exposes authenticated migration endpoints backed by coding-agent.
The shared Web client also supplies the Desktop UI. Existing native sessions
are not rewritten. Identical reviewed source snapshots are skipped; newly
reviewed changed snapshots create separate copies.

Previews expire after 15 minutes or host restart and may be evicted under the
bounded cache. Expired previews require another review. Unsupported content and
missing attachments produce compatibility warnings.

Validation

Windows local validation:

  • From packages/coding-agent:
    pnpm exec vitest --run test/session-import.test.ts test/session-manager/build-context.test.ts test/session-manager/read-session-branch.test.ts test/step-usage-lifecycle.test.ts test/compaction-serialization.test.ts test/context-projection.test.ts
    passed: 92 tests across 6 files.
  • pnpm --filter @step-harness/coding-agent build:unbundled passed.
  • Root pnpm run check passed, including type/boundary checks, 287 Web tests
    with 9 intentional skips, built-host runtime smoke and browser bundle smoke.
  • From apps/web:
    node --test --test-name-pattern="session migration" test/e2e/web.e2e.mjs
    passed: 1 Chromium end-to-end test, including active-source snapshot changes
    and narrow viewport layout.
  • Faux-provider continuation verified that retained images, captions and
    failed historical tool evidence reach the request without replaying old tools.
  • git diff --check passed.
  • Repository-wide ./test.sh was attempted but stopped in its prerequisite
    offline build on Windows: scripts/build-coding-agent-bundle.mjs failed with
    spawnSync npm ENOENT. The isolated full test suite did not start.

Limitations

  • Repository-wide tests remain unverified because of the Windows build blocker
    above; focused suites are not a substitute for the full pre-submission gate.
  • Claude compatibility is fixture-tested, not accepted against a real installed
    Claude Code history. Migration is not a lossless source-state backup.
  • Real-source Codex checks were read-only; no real source session was imported
    automatically as part of acceptance.
  • Packaged Desktop and non-Windows platforms have not been validated.
  • Previously imported sessions are not repaired retroactively.
  • Remote CI is not available until the branch and PR exist.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant