Skip to content

Post-cutover migration: adopt existing legacy OMP sessions into ACP chat #69

Open

Description

@44madfire

Summary

Post-cutover migration feature: let a user move an existing legacy OMP conversation into an ACP chat under the same OMP session id. History is imported with the legacy OMP decoder. Unadoptable sessions stay on the legacy path with a named reason.

Context

  • 44madfire/orca#20 session identity: preserve the conversation, load the same session, never fabricate a new one, fall back explicitly. v3 rule: "v1 does not change transport ownership for an already-existing legacy OMP session. Existing sessions stay legacy; new supported sessions use ACP. Legacy→ACP adoption is a separate migration feature." So this is not on the cutover path; legacy sessions are not regressed meanwhile.
  • session/load alone renders a blank chat. Frames inside the load window only update usage (src/main/acp/acp-timeline-translator.ts:161-164, src/main/acp/acp-context-usage.ts:35 @76d1b7b).
  • Existing pattern: Claude/Codex adoption imports the provider transcript into a fresh journal epoch (src/main/native-chat/structured-agent-session-history-adoption.ts:124, src/main/native-chat/agent-session-wire/structured-agent-session-adopted-import.ts:16 @76d1b7b). The importer already maps OMP (src/main/native-chat/agent-session-journal/journal-legacy-import.ts:152), refuses sources over 16 MiB (:50) and rebuilds epochs (:8-11). Non-Claude/Codex adoption is blocked at src/main/runtime/orca-runtime-get-structured-agent-session-create-support.ts:219-221.
  • OMP rejects a load/resume whose cwd differs from the recorded cwd, case-sensitively on Windows (packages/coding-agent/src/session/agent-session.ts:11307-11308 @53f253f). It answers unknown ids with -32603 (acp-agent.ts:1249,1264). It sends no usage after load/resume. All three are fixed by ACP reopen of adopted sessions: Windows cwd normalization, resource-not-found, usage after load/resume oh-my-pi#12.
  • Store identity (docs/plans/omp-acp-migration/v2/risk-findings/account-home.md): OMP's store follows profile/agent-dir/config-root/session-dir variables and a launch-cwd .env. OMP_CODING_AGENT_DIR is an Orca-only read override (src/main/ai-vault/omp-session-root.ts:46-47). PI_CODING_AGENT_SESSION_DIR writes a flat layout that resolveOmpSessionFile (src/main/native-chat/session-file-resolver.ts:315) does not walk.

Scope

  • Provider-neutral: generalize adoption from 'claude' | 'codex' to registered agents with a transcript importer; lift the create-support guard for them.
  • OMP adoption:
  • Entry points: an explicit "Open in ACP chat" on legacy OMP chats and AI Vault rows. Never automatic.
  • Adoption refuses conversations held by another chat or by a live/unverifiable terminal agent (Single-writer protection for ACP-held OMP sessions (resume guards, AI Vault ownership) #83 vocabulary).
  • Unadoptable cases (missing transcript, over 16 MiB, cwd outside root, load/resume failure) keep the legacy path with a named reason. Never session/new for an adoption.

Non-goals

Depends on

Parity rows owned

  • P-DISC-01, P-DISC-02 (post-cutover; not regressed meanwhile because legacy sessions stay legacy).

Acceptance criteria

  • An adopted conversation shows the same rows, in the same order, as legacy chat shows for that transcript, and the next prompt appends to the same OMP session file.
  • The context ring shows the last usage immediately after adoption.
  • No adoption path ever creates a new OMP session. Every refusal names its reason and leaves the legacy chat usable.
  • Adoption works for a named profile, a relocated agent dir, a relocated config root and a session-dir override. It also works on Windows when the drive-letter case differs, and in folder workspaces.
  • A user with OMP_CODING_AGENT_DIR pointing elsewhere still adopts from their real store.

Required tests

  • Fixture transcripts (compaction, aborted turn, bash/python cells, custom display true/false, fileMention, abandoned branch): imported rows equal the legacy decode.
  • Concurrent adoption of one conversation → one owner, one refusal. Adopting while a terminal PTY is live → refused; after proven exit → succeeds; an unverifiable owner is never treated as exited.
  • Recorded cwd inside the root but ≠ the workspace path → used. Outside the root → refused. Over 16 MiB → refused with a reason.
  • -32002 vs -32603 classification on load failure (with ACP reopen of adopted sessions: Windows cwd normalization, resource-not-found, usage after load/resume oh-my-pi#12). Flat session-dir layout lookup.

Base branch

acp-migration (44madfire/orca).

Activity

  1. changed the title [-]Adopt legacy OMP sessions; replay history exactly once[/-] [+]Adopt existing OMP conversations into ACP chat, persisted Terminal↔Chat handoff, single-writer guards[/+] on Oct 7, 2026
  2. changed the title [-]Adopt existing OMP conversations into ACP chat, persisted Terminal↔Chat handoff, single-writer guards[/-] [+]Post-cutover migration: adopt existing legacy OMP sessions into ACP chat[/+] on Oct 8, 2026
  3. added
    phase-CPhase C extensions
    and removed
    phase-BPhase B parity completion
    on Oct 8, 2026
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

    acp-migrationOMP Native Chat ACP migrationphase-CPhase C extensions

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions