Skip to content

fix(core): bound delivery history and recover expired cursors - #452

Merged
lg2m merged 5 commits into
fix/durable-run-receiptsfrom
fix/bounded-event-journal
Oct 24, 2026
Merged

lg2m merged 5 commits into
fix/durable-run-receiptsfrom
fix/bounded-event-journal

Conversation

@lg2m

@lg2m lg2m commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Delivery replay now retains at most 65,536 events and 64 MiB of encoded event payloads globally. Expired cursors request a fresh snapshot; pending questions, original approval previews and completed results survive reconnects. Headless runs and goals recover without resubmitting work, preserve interrupted exit 130, and supply the unattended answer when a reviewer escalates. Clearing or replacing a goal drains only its already-cancelled historical family before the old invocation returns. JSONL outcomes expose recovered replies to Harbor without inventing another model call. Protocol 39 / schema 63.

Fourth PR in the stack, based on #449. Freed SQLite pages are reused; retained conversations and artifacts still consume storage. Reply reconstruction is bounded to 64 MiB / 4,096 text messages and fails closed on ambiguous historical channel ordering.

Verified: current-head CI and website checks pass; Codex review is clean. Regression tests cover retention/migration, transactional rollback, canonical-state preservation, approval scope, SSE resets, reply ordering and recovery with exactly one provider request. The goal-clear race failed before the fix; ten repetitions and all 32 related CLI tests pass after it. Strict Clippy, lint (69/69 existing sleeps), 70 protocol tests, 21 pinned Harbor tests and all 11 binary smoke scenarios pass. Evidence: target/qq-verify/journal-window/evidence/.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T04:18:08.671453Z f2a7250 Manual request
ℹ️ 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.

lg2m commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review head e0f4aa8 against stack parent #449. Focus on transactional retention and migration, cold-cursor reset semantics, pending-approval scope/authority, and headless goal/run recovery without duplicate work or fabricated delivery events.

@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: e0f4aa8f5c

ℹ️ 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 src/headless.rs Resolved
Comment thread src/headless.rs Resolved

lg2m commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Fixed both findings in 421ba80. Interrupted recovery retains its forced status (regression returned 6 before the fix; now 130). Goal-owned ToolApprovalEscalated events now supply the unattended deny after reviewer handoff/timeout; ownership remains checked by the core. Regression previously waited past its liveness deadline. All 32 related tests, strict Clippy, and 11 real-binary smokes pass. Also corrected the CI race: a replacement goal may admit its own run after the old family settles; assertions now verify that identity rather than forbidding replacement work.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 421ba801cc

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

lg2m commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Final head b47cd8f only refreshes six existing headless sleep allowlist line numbers after the reviewed CLI changes. No sleeps were added or exempted. Narrow cargo xtask lint passes all 69/69 entries. Runtime code is unchanged from the clean-reviewed 421ba80.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: b47cd8f6b9

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

lg2m commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review final head f2a7250. CI exposed a real clear/replacement cleanup race: the live goal identity disappears before cancelled paid work has settled. The adapter now drains the exact historical goal’s already-cancelled family through a read-only core query before reporting the identity change, and does not cancel replacement work. This failed in CI and one of ten local repetitions before the fix; ten repetitions, all 32 related tests, strict Clippy, lint (69/69), and 11 real-binary smokes pass after it. Earlier interrupt and delegated-approval fixes are retained.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: f2a72505ca

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

@lg2m
lg2m added this pull request to stack #456 October 24, 2026 04:31
@lg2m
lg2m merged commit 51dbc26 into main Oct 24, 2026
9 checks passed
@lg2m
lg2m deleted the fix/bounded-event-journal branch October 24, 2026 04:31
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