Skip to content

feat(client): add resumable CLI sessions - #185

Merged
bouillipx merged 2 commits into
mainfrom
codex/client-session-resume
Mar 5, 2026
Merged

feat(client): add resumable CLI sessions#185
bouillipx merged 2 commits into
mainfrom
codex/client-session-resume

Conversation

@bouillipx

Copy link
Copy Markdown
Collaborator

Summary

  • persist CLI session snapshots under the workspace .dare/sessions directory so chat, run, and script flows can resume prior conversation history
  • add --resume support plus sessions list and /sessions list so resumable sessions can be discovered without manually browsing stored files
  • document the design/OpenSpec slice and add unit/integration coverage for session persistence and discovery

Test Plan

  • .venv/bin/python -m pytest -q tests/unit/test_client_cli.py
  • .venv/bin/python -m pytest -q tests/integration/test_client_cli_flow.py
  • openspec validate client-session-resume
  • ./scripts/ci/check_governance_traceability.sh
  • ./scripts/ci/check_governance_evidence_truth.sh

Notes

  • this change restores historical conversation context and session metadata only
  • runtime checkpoint/pause-continue semantics remain out of scope for a later slice

Introduce persistent client session snapshots so chat, run, and script commands can resume prior conversation context across CLI invocations.

Key changes:
- add a session store under workspace .dare/sessions with snapshot save/load/list support
- add --resume handling for chat, run, and script flows plus interactive /sessions list and top-level sessions list commands
- extend parser, CLI orchestration, docs, OpenSpec artifacts, and governance evidence for the new session-management workflow
- add unit and integration coverage for resume persistence and session discovery

Rationale:
- make the local CLI baseline closer to Codex CLI / Claude Code style continuity
- remove the need to manually inspect persisted session files before resuming work
- keep the implementation scoped to history restoration without introducing runtime checkpoint semantics yet

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 149e4e5dc2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/session_store.py
Address review feedback about session-id traversal handling in the CLI session snapshot store.

Key changes:
- enforce a strict allowlist for session IDs
- reject traversal-like tokens such as dot-dot even in tampered payloads
- resolve snapshot paths and enforce they stay under workspace session storage
- add unit coverage for invalid session IDs and tampered snapshots

Rationale:
- keep resume/session persistence scoped to workspace-owned snapshot files
- prevent crafted resume targets or snapshot contents from escaping session-store boundaries
@bouillipx
bouillipx merged commit 14fc4ce into main Mar 5, 2026
10 checks passed
@bouillipx
bouillipx deleted the codex/client-session-resume branch March 5, 2026 01:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c29366fe65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread client/session_store.py
f"{schema_version or '<missing>'}"
)

session_id = self._normalize_session_id(raw.get("session_id"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce snapshot filename/session_id consistency

_load_path trusts the session_id inside JSON without checking that it matches the file being loaded, and _build_session_state then uses that payload value as the active conversation id. If a snapshot file is renamed or copied (e.g. alias.json containing "session_id": "real-session"), --resume alias restores one session but subsequent saves write to real-session.json, silently updating the wrong session history; this can corrupt/rescope results for explicit resume targets. Reject mismatches between path.stem and parsed session_id when loading.

Useful? React with 👍 / 👎.

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