Skip to content

feat: add async durable session storage - #247

Merged
roackb2 merged 1 commit into
mainfrom
codex/async-session-storage-foundation
Jul 15, 2026
Merged

feat: add async durable session storage#247
roackb2 merged 1 commit into
mainfrom
codex/async-session-storage-foundation

Conversation

@roackb2

@roackb2 roackb2 commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace synchronous whole-collection session persistence with an async, record-oriented repository contract
  • add optimistic revisions, compare-and-swap updates/deletes, stable cursor pagination, and explicit storage errors
  • harden the default JSON adapter with immutable revision bodies, atomic catalog replacement, and cross-process writer locking
  • await durable run acceptance before the control plane reports an accepted prompt
  • document zero-config local JSON usage and PostgreSQL adapter semantics

Verification

  • yarn test:unit — 114 files, 679 tests passed
  • yarn test:integration — 32 files, 295 tests passed
  • yarn typecheck
  • yarn build
  • yarn lint
  • git diff --check

Scope

This PR establishes the session durability foundation. Artifact, archive, trace, and object-storage adapters remain separate tracked follow-up slices.

The concurrent root README refresh is intentionally excluded because another task owns it.

@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: 962c0058a3

ℹ️ 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".

}

private static sessionRevisionPath(sessionsDir: string, sessionId: string, revision: number): string {
return join(sessionsDir, `${encodeURIComponent(sessionId)}.${revision}.json`);

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 Update session watchers for revisioned storage

With this new <encoded-id>.<revision>.json layout, no new write touches chat-sessions/${sessionId}.json, and later saves move on to .2, .3, etc. I checked ControlPlaneChatSessionsController.subscribeLiveEvents and the REST ChatSessionEventsRestController: both still watch resolveFilePath(..., ${sessionId}.json), so selected-session streams for new sessions only emit waiting and never send session.updated when another client, turn, or settings write persists. The UI can miss durable updates until a run terminal/poll/manual refresh; watch the catalog/directory or publish session update events from the service when revisioned writes complete.

Useful? React with 👍 / 👎.

@roackb2
roackb2 merged commit 60d0d97 into main Jul 15, 2026
5 checks passed
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