Skip to content

Keep pinned runs outside completed retention quota - #1051

Merged
dennisonbertram merged 2 commits into
mainfrom
codex/issue-1048-pinned-retention-quota
Jul 31, 2026
Merged

Keep pinned runs outside completed retention quota#1051
dennisonbertram merged 2 commits into
mainfrom
codex/issue-1048-pinned-retention-quota

Conversation

@dennisonbertram

@dennisonbertram dennisonbertram commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Closes #1048

Summary

  • count only zero-subscriber persisted terminal candidates toward completed-run retention pressure
  • preserve subscriber-pinned terminal runs as protected exceptions
  • preserve persistent run records, terminal persistence gating, configuration, and wire behavior

Root cause

Subscriber-pinned terminal states consumed MaxCompletedRetention despite being ineligible for pruning. Under a limit of one, that allowed a just-completed run to be removed before its StartRun caller could subscribe.

Test-first evidence

Hosted race CI exposed the existing TestRunner_PruneKeepsCompletedRunWithActiveSubscriber regression as collect extra run 2 events: run not found before the production fix.

Exact-head verification

Rebased retention-only head d8e7c261fc5680c10d599be080844d0837587b98 onto production main f3fb4d8e911210d53cb43e8e3163b24bda70cca1.

  • focused retention test normal -count=100
  • focused retention test under race detector -count=100
  • complete internal/harness package normal/race
  • foreground non-TTY ./scripts/test-regression.sh: PASS, 85.6% total coverage, zero uncovered functions
  • regression now proves both that the subscriber-pinned run survives and that the unpinned retention quota remains bounded

Rollout / rollback

No migration or flag. Revert this commit if subscriber cancellation fails to reclaim pinned state or the number of unpinned drainable terminal states exceeds the configured limit.

Related: #958, #1000, #1047, #1045, #1043, #1041, #1033.

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@dennisonbertram

Copy link
Copy Markdown
Owner Author

Exact tested head: 5b77220. @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 5b772204b0

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

@dennisonbertram

Copy link
Copy Markdown
Owner Author

@codex review

Exact-head review requested for rebased retention-only commit 118d1a2 on merged main 8906149. Focused/adjacent/complete harness normal and race checks plus the foreground non-TTY full regression gate passed; net scope remains six #1048 files.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 118d1a230b

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

@dennisonbertram
dennisonbertram force-pushed the codex/issue-1048-pinned-retention-quota branch from 118d1a2 to 82e1e6c Compare July 31, 2026 15:14
@dennisonbertram

Copy link
Copy Markdown
Owner Author

Exact-head review requested for 82e1e6c. This is rebased onto production main f3fb4d8. Focused retention test passed 100x normally and 50x under race; complete internal/harness normal/race and foreground ./scripts/test-regression.sh passed with 85.7% coverage and zero uncovered functions. @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 82e1e6c629

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

@dennisonbertram
dennisonbertram merged commit d8e7c26 into main Jul 31, 2026
2 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.

[Bug]: Subscriber-pinned runs consume completed retention quota

1 participant