fix(codex): serialize auto-redeem journal reservation and settlement - #3970
Conversation
(cherry picked from commit c817db4)
Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe auto-redeemer now coordinates journal reservations and settlements with a shared SQLite-backed mutation lock. It retries lock failures, verifies reservation identity before settlement, and adds integration tests for process contention and journal integrity. ChangesReset-credit redemption coordination
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant AutoRedeemer
participant MutationLock
participant Journal
participant CreditService
AutoRedeemer->>MutationLock: Reserve request ID
MutationLock->>Journal: Read or write dispatched entry
AutoRedeemer->>CreditService: Consume reset credit
AutoRedeemer->>MutationLock: Settle request ID
MutationLock->>Journal: Verify and write settled entry
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
|
Explicit owner-authorized agent-assisted maintainer security review for Independent Astra high review and main verification accept the scoped journal change: reservation before network, network outside coordinator lock, settlement re-read and ID comparison, preserved opt-in and persistent-error backoff, short retry for wrapped/raw SQLite contention, and no account/credential-policy expansion. Real-database COMMIT-busy and two-process atomic-marker test designs were reviewed for reachability, distinct process identity, overlap, bounded retries and cleanup. All three approved files are accounted for; no shared coordinator change. This is source/security acceptance and sponsorship, not a separate human approval or executed test claim. Exact-head hosted PR and lane=all CI remain gates. Fixtures are synthetic; no real reset credit or live account was used. No upstream exactly-once guarantee is asserted. |
리뷰 · 우선순위 62 / 80이 PR은 Codex reset-credit 자동 환급(auto-redeem) 이 같은 고치는 방식은 이미 있는 설정 mutation coordinator( 이 변경은 opt-in( 라인 src/codex/reset-credit-auto-redeem.ts · dispatch 예약 블록 - 라인 src/codex/reset-credit-auto-redeem.ts · settle 블록 - consume 성공 후 저널을 다시 읽고 라인 tests/codex-integration/codex-reset-credit-auto-redeem.test.ts · peer settled 보존 / cross-process 테스트 - 두 harness가 같은 journalFile을 쓸 때 엔트리 두 개가 모두 settled로 남는지, request id가 각각 소비 id와 맞는지 확인합니다. 이 회귀가 없으면 옛 “덮어쓰기” 버그가 다시 열립니다. 경로 #3912 - 같은 수정의 contributor 원본입니다. 이 PR이 머지되면 경로 #3965 - 수동 reset-credit alias 정산 carry와 동시에 열려 있습니다. 충돌 파일은 거의 없지만, 머지 순서는 서로 독립으로 둬도 됩니다. 하나만으로 자동 환급 구멍이 닫히지는 않습니다. 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Maintainer integration decision for The owner authorized this independently revertible carry of #3912. Source/security review passed and was recorded above; the original author survives in the source commit and final squash trailer. Exact-head PR CI 34170889491 succeeded; workflow_dispatch 34170970202 succeeded with all 26 jobs, including all six Windows shards and macOS control. Windows execution logs confirm the new COMMIT-contention, two-process ID-sharing, disabled-boundary and future-credit cases passed. No local product execution is claimed beyond the disclosed excluded baseline-hook incident. The destination moved by C delivery-record documents plus the independent Santiago test isolation in This is explicit owner-authorized dev-only maintainer integration under MAINTAINERS.md, not a separate human approval. No maintainer objection or unresolved review thread is present. Ready-triggered review automation may still be pending and is not reported as passed. The shared merge lock covers final revalidation through landing proof. |
Summary
Serialize auto-redeem journal reservation and settlement across processes using the existing configuration mutation coordinator. Keep upstream consumption outside the lock, then re-read the durable reservation and verify its request ID before settlement so a delayed result cannot overwrite a peer's newer entry.
Carries #3912 from
c817db47b28b44466036975577d4666083060d53with original authorship. A scoped follow-up classifies both wrapped acquisition contention and raw SQLite commit contention for the existing short retry. Persistent storage errors retain the idle retry interval. The operation remains opt-in; no real account or credit is used for validation.Verification
a742211d0841989e67bdd5cc31ee7a35c08c9369; no blocking findings. Hosted execution pending.ci.ymlworkflow_dispatch withlane=allare required. Skip/cancel/pending results are not passes.--no-verify.Checklist
Co-authored-by: luvs01 27862058+luvs01@users.noreply.github.com
Summary by CodeRabbit
Bug Fixes
Documentation