test(runtime): tolerate transient Dream lock contention#732
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTest improvements to reduce flakiness in dream consolidation testing by adding a retry helper that waits for non-busy lock states and updates an existing test to verify the lock is properly acquired after consolidation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
🚥 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. Review rate limit: 0/1 reviews remaining, refill in 39 minutes and 58 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@clients/agent-runtime/src/memory/dream.rs`:
- Around line 637-649: Replace the duplicated inline retry loop in the test
function session_trigger_fires_after_five_sessions with a call to the existing
helper run_if_triggered_after_transient_busy(workspace_dir) so both places share
the same transient-busy retry behavior; locate the inline loop in
session_trigger_fires_after_five_sessions (the 10-iteration sleep-and-check
block) and remove it, invoking
run_if_triggered_after_transient_busy(workspace_dir) and using its returned
MemoryConsolidationReport instead of manually handling reports and Busy lock
state.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2248f2ee-0295-434a-90e1-cb666694b7cc
📒 Files selected for processing (1)
clients/agent-runtime/src/memory/dream.rs
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: pr-checks
- GitHub Check: sonar
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Cloudflare Pages
🧰 Additional context used
📓 Path-based instructions (4)
clients/agent-runtime/src/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
clients/agent-runtime/src/**/*.rs: Never log secrets, tokens, raw credentials, or sensitive payloads in any logging statements
Avoid unnecessary allocations, clones, and blocking operations to maintain performance and efficiency
Files:
clients/agent-runtime/src/memory/dream.rs
clients/agent-runtime/**/*.rs
📄 CodeRabbit inference engine (clients/agent-runtime/AGENTS.md)
Run
cargo fmt --all -- --check,cargo clippy --all-targets -- -D warnings, andcargo testfor code validation, or document which checks were skipped and why
Files:
clients/agent-runtime/src/memory/dream.rs
**/*.rs
⚙️ CodeRabbit configuration file
**/*.rs: Focus on Rust idioms, memory safety, and ownership/borrowing correctness.
Flag unnecessary clones, unchecked panics in production paths, and weak error context.
Prioritize unsafe blocks, FFI boundaries, concurrency races, and secret handling.
Files:
clients/agent-runtime/src/memory/dream.rs
**/*
⚙️ CodeRabbit configuration file
**/*: Security first, performance second.
Validate input boundaries, auth/authz implications, and secret management.
Look for behavioral regressions, missing tests, and contract breaks across modules.
Files:
clients/agent-runtime/src/memory/dream.rs
🧠 Learnings (1)
📚 Learning: 2026-02-17T12:31:17.076Z
Learnt from: CR
Repo: dallay/corvus PR: 0
File: clients/agent-runtime/AGENTS.md:0-0
Timestamp: 2026-02-17T12:31:17.076Z
Learning: Applies to clients/agent-runtime/**/*.rs : Run `cargo fmt --all -- --check`, `cargo clippy --all-targets -- -D warnings`, and `cargo test` for code validation, or document which checks were skipped and why
Applied to files:
clients/agent-runtime/src/memory/dream.rs
🔇 Additional comments (1)
clients/agent-runtime/src/memory/dream.rs (1)
669-672: Good assertion ordering to guard transient lock contention.Asserting
DreamLockState::Acquiredbefore checkingsessions_processedis the right guard for this flaky path.
Deploying corvus with
|
| Latest commit: |
5a89354
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3d725b55.corvus-42x.pages.dev |
| Branch Preview URL: | https://fix-dream-transient-lock-tes.corvus-42x.pages.dev |
|



Summary
memory::dream::tests::accepts_recorded_completed_session_and_creates_deterministic_artifact_refsessions_processed = 1but got0whenrun_if_triggered()returned aBusylock state on first attemptrun_if_triggered_after_transient_busy()that waits for lock acquisition, matching pattern already used insession_trigger_fires_after_five_sessionstestChanges
run_if_triggered_after_transient_busy()test helperDreamLockState::Acquiredassertion before validatingsessions_processedTesting
Fixes intermittent failure observed in https://github.com/dallay/corvus/actions/runs/25174664361/job/73803405198