fix(codex): settle reset-credit retry aliases with canonical identity - #3965
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe reset-credit consume handler now adopts the ledger’s canonical operation ID for unfinished operations. Integration tests cover alias retries and ambiguous upstream failures. The Management API documentation describes these idempotency semantics. ChangesReset-credit operation identity
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ConsumeHandler
participant ResetCreditLedger
participant UpstreamConsume
Client->>ConsumeHandler: submit operationId
ConsumeHandler->>ResetCreditLedger: openManualResetCreditOperation
ResetCreditLedger-->>ConsumeHandler: canonical operationId
ConsumeHandler->>UpstreamConsume: consume with canonical operationId
UpstreamConsume-->>ConsumeHandler: result or failure
ConsumeHandler->>ResetCreditLedger: record settlement state
✨ 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 head Independent Astra high source/security audit and main-agent verification found no blocking issue. Canonical ID adoption occurs after authentication, physical-account ownership and execute admission. Both account fields survive; legacy no-ID and fail-closed unavailable/identity-mismatch branches remain intact. Three real-ledger pending-to-ambiguous regressions distinguish the original defect without already-ambiguous setup. Source change remains the contributor's exact two hunks, with original authorship retained. This is explicit security acceptance/sponsorship for this revision under the owner's delegated maintainer delivery, not a separate human approval or runtime test result. Current-head hosted PR and full dispatch CI remain required. Synthetic fixtures only; no real credits consumed. The known Windows routing-fixture failure from another candidate is not treated as passing evidence here. |
리뷰 · 우선순위 73 / 80이 PR은 Codex reset-credit 수동 소모에서, 호출자가 보낸 지금 변경은 한 줄에 가깝습니다. 라인 src/codex/auth-api.ts · identity 재할당 - open 이후 identity.operationId를 opened.operationId로 덮는 것이 핵심입니다. 업스트림 키와 장부 키가 갈라지던 지점을 한곳에서 맞춥니다. 라인 tests/codex-integration/codex-auth-api.test.ts - pending canonical + alias 실패 3종(throw/non-2xx/unknown-code)이 없으면 이 회귀가 다시 열립니다. account key·canonical id·terminal code가 안 바뀌는지도 같이 보므로 유지하세요. 경로 #3919 - 같은 수정의 contributor 원본(draft)입니다. 이 carry가 먼저 들어가면 #3919는 landed-via-maintainer로 닫는 편이 맞습니다. 자동 환급 worker나 identity 정책은 건드리지 않습니다. 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
7c7b908 to
6c1477d
Compare
|
@lidge-jun Current verification status for 6c1477d: full lane=all dispatch 34169887448 has completed with failure, including windows 4/6 (job 101888425573). The PR check list also reports a failed test 1/4, so the historical pending note should not be read as a green gate. I could verify the failing job identities but did not obtain a useful failure excerpt from the log command; I am not attributing either result to the patch or calling it a baseline flake without that evidence. Keep this Draft while the exact-head failures are diagnosed. No rerun, skip, timeout change, local product execution or real reset-credit action was performed. |
(cherry picked from commit 6f20c3d)
Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
6c1477d to
62412d3
Compare
|
Final candidate source/security acceptance: New PRCI34181771859 and full dispatch34181768953 pending. This final integration includes separately landed routing/probe/storage/PID fixture repairs; previous failed attempts are historical, not current passes. No local product tests or live credits/accounts used. Original3919 stays open until verified actual landing. |
|
Owner-authorized dev-only maintainer integration for 62412d3 into abb46a1. Independent source review PASS; exact-head hosted verification: 34181771859 pull_request: 19 success / 2 skip; 34181768953 workflow_dispatch: 26 success / 0 skip. Skips are not passing tests. Original failure history retained; no local product tests/build/typecheck/install. One fixture repair only, independently revertible squash. Candidate and combined tree are identical. Actual landing is checked against precomputed merge tree, unchanged unrelated paths and fetched dev ancestry. This is agent-assisted maintainer integration, not a separate human approval. No unresolved threads or maintainer objections; ready-triggered optional review checks are not claimed as passed. |
Summary
A reset-credit retry may join an unfinished operation with a different caller ID. The request already uses the canonical upstream ID, but recording its settlement or ambiguous failure with the alias can be rejected by the ledger. Adopt the ledger-returned operation ID for both outcomes after existing authentication, ownership and execute admission.
Carries #3919 from
6f20c3d08cd202e43b8679de33674133bdc7f34c, preserving the contributor's two production hunks and management API explanation. Added regressions start with a real pending canonical operation and exercise an alias fetch error, non-2xx response and unknown code; the durable row must become ambiguous without changing account key, canonical ID or terminal code. Existing settled-alias replay remains covered. No automatic-redemption worker or identity policy change.Verification
git diff --checkpassed. Only the original three-file scope changes.6c1477d19c7d1a77a1866cabfd2b4411f1a210d7with no blocking findings. Hosted CI pending.ci.ymlworkflow dispatch withlane=allwill be inspected before landing. Skipped or cancelled work is not passing evidence.--no-verifypushes.Checklist
Co-authored-by: luvs01 27862058+luvs01@users.noreply.github.com
Integration refresh: base
9c8f66b9df4cdf133a16c95a95ee07ff5171a46d; both commits unchanged by range-diff. Independent interdiff/security review PASS, with no alias dependency impact from Go translation/release-note changes. New-head PR CI 34169890598 and full dispatch 34169887448 pending. Earlier-head CI is historical evidence only.Summary by CodeRabbit
Bug Fixes
Documentation