GeezerVison is showing github.com — fix(id): bound PresenceTable with stale-only eviction by dezren39 · Pull Request #4160 · developing-today/code
Conversation
dezren39
commented
Nov 2, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Bounds PresenceTable to MAX_PRESENCE_NODES = 1_000, aligned with discovery. At capacity, new node keys are admitted only by evicting an entry already past its TTL (oldest heartbeat first, key bytes as tie-breaker); if all entries are fresh, the new node is refused. An existing node refreshes in place, subject to the existing timestamp ordering guard.
The implementation is in pkgs/id/src/chat_presence.rs. Regression tests use distinct signed keys and cover the cap under over-cap insertion, refusal when full of fresh entries, stale-only eviction, deterministic key-byte ties, existing-node refresh, and the ordering guard. The current-main wire-decoded channel/typing sanitization tests are preserved.
Fixes #4004. Decision: design #4502 Phase 2, pinned on issue #4004.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.
When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.
I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!
For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!
New to Jules? Learn more at jules.google/docs.
For security, I will only act on instructions from the user who triggered this task.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 2, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 53 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4e8798c7-3701-4e9e-9c18-626432bafb1d
Commits
-
Reviewing files that changed from the base of the PR and between b1a3abb and 6b99c3a.
Files selected for processing: 1
-
pkgs/id/src/chat_presence.rs
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 2, 2026
dezren39
changed the title
⚡ Bolt: bound PresenceTable node count to prevent unbounded memory growth
fix(id): bound PresenceTable with stale-only eviction
Nov 3, 2026
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
⚠️ Failed 2026-11-03T16:36:13.404814Z We couldn’t complete this review. Comment @codex review to try again. |
9381cd8 |
Draft marked ready |
ℹ️ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reworked to the recorded #4502 Phase 2 decision (#4004)
MAX_PRESENCE_NODES is now 1_000, named beside MAX_HEARTBEAT_CHANNELS / PRESENCE_TTL_SECS and aligned with discovery's MAX_PEERS.
- At capacity a new node is admitted only by evicting an entry already past its TTL — oldest such, ties broken by node key bytes — mirroring
PeerDiscovery::update.
- If every entry is fresh, the new node is refused; an existing node always refreshes in place, subject to the existing timestamp ordering guard.
- Prune-then-evict-oldest is gone.
Branch merged up to current main (1c1aa4a79), preserving the wire-decoded channel/typing sanitization tests added on main.
Tests
cargo test --lib chat_presence on the branch: 18 passed, 0 failed, including new signed-node regressions for the cap under over-cap insertion, refusal while all entries are fresh, stale-only eviction, key-byte tie-break determinism, existing-node refresh, and the ordering guard.
Review findings
Codex did not review this commit — its run failed on the account's review usage limit and reported no findings, so there is nothing to disposition from it.
CI
The id workflow currently runs only on push to main and on its nightly schedule, not on pull requests, so this PR's only triggered gate is basic: production line limit (2500). That is a coverage gap against .github/ci-policy.md (which lists a guard + affected-crate matrix for id PRs); it is reported here rather than assumed, and the targeted suite was run locally instead.
|
google-labs-jules[bot] reacted with eyes emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reworked to the recorded #4502 Phase 2 decision (#4004)
MAX_PRESENCE_NODES is now 1_000, named beside MAX_HEARTBEAT_CHANNELS / PRESENCE_TTL_SECS and aligned with discovery's MAX_PEERS.
- At capacity a new node is admitted only by evicting an entry already past its TTL — oldest such, ties broken by node key bytes — mirroring
PeerDiscovery::update.
- If every entry is fresh, the new node is refused; an existing node always refreshes in place, subject to the existing timestamp ordering guard.
- Prune-then-evict-oldest is gone.
Branch merged up to current main (1c1aa4a79), preserving the wire-decoded channel/typing sanitization tests added on main.
Tests
cargo test --lib chat_presence on the branch: 18 passed, 0 failed, including new signed-node regressions for the cap under over-cap insertion, refusal while all entries are fresh, stale-only eviction, key-byte tie-break determinism, existing-node refresh, and the ordering guard.
Review findings
Codex did not review this commit — its run failed on the account's review usage limit and reported no findings, so there is nothing to disposition from it.
CI
The id workflow currently runs only on push to main and on its nightly schedule, not on pull requests, so this PR's only triggered gate is basic: production line limit (2500). That is a coverage gap against .github/ci-policy.md (which lists a guard + affected-crate matrix for id PRs); it is reported here rather than assumed, and the targeted suite was run locally instead.
Updated the implementation and tests to match this decision: MAX_PRESENCE_NODES is set to 1_000, aligning with discovery's 1_000 peer table bounds. At capacity, a new node is admitted only if an entry is past its TTL (evicting the oldest expired entry, tie-broken by node key bytes). If every entry is fresh, the new node is refused. Existing nodes always refresh in place without consuming capacity. All tests pass cleanly.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…(salvage of PR #4160 onto current main)
Port of the PR #4160 fix (commits 7888205 + 67a2b78) onto current
main: the original branch had diverged (1016 files dirty vs main).
MAX_PRESENCE_NODES = 1_000; at capacity a new node is admitted only by
evicting the oldest expired entry (expiry from the effective stamp,
#8865), ties broken by node key bytes; if every entry is fresh the new
node is refused. Existing nodes refresh in place. Three bound tests
ported from PR #4160; cargo test --lib chat_presence 26/26 pass.
Fixes #4004. Task 8482.
|
🤖 Agent note · branch salvaged onto current main — queue worker (repo-worker-code), lane code-b, task 8482.
PR #4160's branch had diverged from main beyond repair (mergeable_state dirty; 1,016 files / +148k/-118k vs main, from an old-tree merge in its history), though its actual fix was always a single file. This shift salvaged it:
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 12, 2026
Uh oh!
There was an error while loading. Please reload this page.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|