Repository navigation
feat(memory): add review transition API - #626
Conversation
|
Warning Review limit reached
More reviews will be available in 46 minutes and 41 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds a session-scoped memory review transition endpoint, the request/response schemas it uses, semantic-sync wiring during startup, and end-to-end tests plus ADR checklist entries for accepted, rejected, archived, and failure paths. ChangesSession memory review transitions
Sequence Diagram(s)sequenceDiagram
participant "POST /sessions/{session_id}/memory/reviews/{candidate_id}" as ReviewRequest
participant transition_memory_review
participant MemoryReviewStore
participant SemanticMemoryReviewSyncService
participant SemanticMemorySyncer
ReviewRequest->>transition_memory_review: request body and path params
transition_memory_review->>MemoryReviewStore: transition candidate to accepted, rejected, or archived
MemoryReviewStore-->>transition_memory_review: ReviewedMemoryRecord
opt semantic_memory_review_sync_service configured
transition_memory_review->>SemanticMemoryReviewSyncService: sync_reviewed_memory(record)
SemanticMemoryReviewSyncService->>SemanticMemorySyncer: sync_reviewed_memory(record)
end
transition_memory_review-->>ReviewRequest: response or HTTP error
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@coding-agent/src/coding_agent/server/http_server.py`:
- Around line 2800-2814: The semantic memory sync path in the HTTP handler
currently turns a post-commit sync failure into a 500, which is not safely
retryable once the review store has already been updated. Update the logic
around _sync_memory_review_service in the HTTP server handler so that failed
sync is treated as best-effort/reconciled or, if the same status is retried,
rerun the semantic sync idempotently before deciding on an error. Keep the retry
behavior aligned with the terminal-status check so a committed review does not
force a 400 on subsequent repair attempts.
- Line 2748: Add FastAPI dependency helpers to Ruff’s immutable-calls allowlist
so the standard `Depends(...)` pattern in `http_server.py` is not flagged by
B008. Update the Ruff lint configuration in `pyproject.toml` to include
`fastapi.Depends` and `fastapi.Security` under `extend-immutable-calls`, which
will cover the `auth_context_from_headers` dependency usage and similar FastAPI
injection points throughout `http_server.py`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 856c4bb7-1862-4c49-9892-ee07cd49bcc7
📒 Files selected for processing (7)
coding-agent/docs/adr/0072-tape-memory-semantic-index-and-enable-switch.mdcoding-agent/src/coding_agent/core/app.pycoding-agent/src/coding_agent/server/http_server.pycoding-agent/src/coding_agent/server/schemas.pycoding-agent/src/coding_agent/topics/semantic_sync.pycoding-agent/tests/coding_agent/test_memory_switch.pycoding-agent/tests/ui/test_http_server.py
Summary
POST /sessions/{session_id}/memory/reviews/{candidate_id}Verification
UV_PYTHON=3.12 uv run pytest tests/ui/test_http_server.py::TestMemoryReviewTransitions -q-> 10 passedUV_PYTHON=3.12 uv run pytest tests/coding_agent/test_memory_switch.py tests/coding_agent/test_semantic_sync.py -q-> 48 passedUV_PYTHON=3.12 uv run pytest tests/ui/test_http_server.py -q-> 279 passedUV_PYTHON=3.12 uv run pytest tests/coding_agent/test_semantic_tape_index.py tests/coding_agent/test_semantic_sync.py tests/coding_agent/test_memory_switch.py -q-> 66 passeduv run ruff check src/coding_agent/core/app.py src/coding_agent/server/http_server.py src/coding_agent/server/schemas.py src/coding_agent/topics/semantic_sync.py tests/coding_agent/test_memory_switch.py tests/ui/test_http_server.py-> passgit diff --checkon changed files -> passReview Gate
code-review-expertfound two P2 transition issues; both fixed with regressionsValueErrormapping issue; fixed with a regressioncode-review-expertpass reported no P1/P2 findingsNotes
AGENTS.mdreferencesRTK.mdandprompts/codex-delegatee.md, but those files are not present in this worktree; I followed the pasted AGENTS rules.Summary by CodeRabbit
New Features
Bug Fixes