# CLI-063 Tasks — Print mode session resume (`-c` / `-r`) wiring

Spec: `.agents/spec-docs/active/CLI-063-print-mode-session-resume.md`

- [x] T1 (TC-01): agent-transport — `IHeadlessInteractionChannelOptions` gains `resumeSessionId?`/`forkSession?`; `HeadlessInteractionChannel` forwards both to `InteractiveSession`; unit wiring test
- [x] T2 (TC-02): agent-cli — print-mode integration test: seeded session store + `resumeSessionId` → provider request contains prior messages, no extra session id in store
- [x] T3 (TC-03): agent-cli — fork variant: `forkSession: true` → new independent session id with fresh model context (TUI-parity fork semantics; context question → CLI-073), original untouched
- [x] T4 (TC-04): agent-cli — `parseCliArgs` print-mode argument error for empty resume id (`-r ""`): "Print mode requires an explicit session id", exit 1 via startCli parse-error path
- [x] T5 (TC-05): agent-cli — `cli.ts` argument error for `-c`/`-r` + `--no-session-persistence`: stderr "--no-session-persistence conflicts", exit 1
- [x] T6 (TC-06): agent-cli — `-c` with empty store → exit 0, exactly one new session (continue-or-start)
- [x] T7 (TC-07): SPEC sync — agent-cli SPEC Session Resolution Logic covers print mode + new error rows; agent-transport SPEC documents new channel options
- [x] T8: build/typecheck/lint/test green; PR to develop; backlog CLI-063 evidence recording

## Test Plan

Authoritative TC table lives in the spec document (`.agents/spec-docs/active/CLI-063-print-mode-session-resume.md` § Test Plan).
Summary: unit wiring tests in `agent-transport` (`headless-channel-options.test.ts` — resume/fork option forwarding), integration tests in `agent-cli` (`print-mode-integration.test.ts` — TC-02 resume restores prior messages with no extra session, TC-03 fork creates an independent session, TC-06 continue-or-start), and parser validation tests (`cli-args.test.ts` — TC-04 empty `-r ""` print-mode error, TC-05 `--no-session-persistence` conflict). Verification: `pnpm --filter @robota-sdk/agent-transport --filter @robota-sdk/agent-cli test` plus workspace typecheck/lint.
