Skip to content

Distinguish thread listing failures from exhausted history - #51602

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/09653a84fc65f47316d8bbae9e4cf3dd8ce9948a
Oct 7, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/09653a84fc65f47316d8bbae9e4cf3dd8ce9948a

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Distinguish thread listing failures from exhausted history

Why

DB-only listing and pagination failures must not look like exhausted history. This hardens the DB-only listing added in #18502 and page refilling added in #7509.

What changed

  • Return JSON-RPC error -32603 when useStateDbOnly: true cannot query the local state database, including requests with an empty cwd array.
  • Track all cursors encountered while filling a page and return -32603 for repeated cursors, including on full pages.
  • Document that callers can retry these errors; a successful response with nextCursor: null still indicates exhaustion. Default scan-and-repair requests retain their filesystem fallback.

Testing

Add regression tests for missing or mismatched state databases versus healthy empty history, with active and archived listings and null or empty cwd filters. Cover repeated cursors during page refilling and on full pages using the in-memory thread store.

## Why

DB-only listing and pagination failures must not look like exhausted history. This hardens the DB-only listing added in #18502 and page refilling added in #7509.

## What changed

- Return JSON-RPC error `-32603` when `useStateDbOnly: true` cannot query the local state database, including requests with an empty `cwd` array.
- Track all cursors encountered while filling a page and return `-32603` for repeated cursors, including on full pages.
- Document that callers can retry these errors; a successful response with `nextCursor: null` still indicates exhaustion. Default scan-and-repair requests retain their filesystem fallback.

## Testing

Add regression tests for missing or mismatched state databases versus healthy empty history, with active and archived listings and null or empty `cwd` filters. Cover repeated cursors during page refilling and on full pages using the in-memory thread store.

GitOrigin-RevId: 09653a84fc65f47316d8bbae9e4cf3dd8ce9948a
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/09653a84fc65f47316d8bbae9e4cf3dd8ce9948a branch from 51d1240 to 406eb53 Compare October 7, 2026 06:34
@copyberry
copyberry Bot merged commit 406eb53 into main Oct 7, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-07T06:34:34.686164Z 51d1240 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/09653a84fc65f47316d8bbae9e4cf3dd8ce9948a branch October 7, 2026 06:34
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
@mehoney
mehoney deployed to issue-triage October 7, 2026 06:50 — with Image GitHub Actions Active
@mehoney
mehoney deployed to issue-triage October 7, 2026 06:50 — with Image GitHub Actions Active
@mehoney
mehoney deployed to issue-triage October 7, 2026 06:50 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 7, 2026 07:15 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 7, 2026 07:15 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 7, 2026 07:15 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 7, 2026 07:16 — with Image GitHub Actions Active
@aggnplz
aggnplz deployed to issue-triage October 7, 2026 07:24 — with Image GitHub Actions Active
@aggnplz
aggnplz deployed to issue-triage October 7, 2026 07:24 — with Image GitHub Actions Active
@aggnplz
aggnplz deployed to issue-triage October 7, 2026 07:24 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 7, 2026 07:32 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 7, 2026 07:32 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 7, 2026 07:32 — with Image GitHub Actions Active
@yaanfpv
yaanfpv deployed to issue-triage October 7, 2026 07:37 — with Image GitHub Actions Active
@yaanfpv
yaanfpv deployed to issue-triage October 7, 2026 07:37 — with Image GitHub Actions Active
@yaanfpv
yaanfpv deployed to issue-triage October 7, 2026 07:37 — with Image GitHub Actions Active
@yaanfpv
yaanfpv deployed to issue-triage October 7, 2026 07:38 — with Image GitHub Actions Active
@lonh-jing
lonh-jing deployed to issue-triage October 7, 2026 07:52 — with Image GitHub Actions Active
@lonh-jing
lonh-jing deployed to issue-triage October 7, 2026 07:52 — with Image GitHub Actions Active
@lonh-jing
lonh-jing deployed to issue-triage October 7, 2026 07:52 — with Image GitHub Actions Active
@lonh-jing
lonh-jing deployed to issue-triage October 7, 2026 07:53 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants