fix(agent-connector): detect bare npub mentions#621
Conversation
|
Warning Review limit reached
More reviews will be available in 28 minutes and 59 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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThe agent connector now recognizes visible bare ChangesAgent connector mention fallback
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
🚥 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 |
|
Ready to review this PR? Stage has broken it down into 5 individual chapters for you: Chapters generated by Stage for commit ee7679d on Jun 24, 2026 10:44pm UTC. |
|
Pip adversarial review. BLOCKING:
SUGGESTION:
NITPICK:
SUMMARY: The clean bare VERDICT: REQUEST_CHANGES SENSITIVE_PATHS: |
|
Address-review updates are pushed and verified. Commits:
Local verification:
GitHub checks are green on ee7679d. Rust tests (2/4) had a transient unrelated |
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 `@crates/agent-connector/src/event_projection.rs`:
- Around line 47-55: The mentions_self behavior in event_projection now includes
visible nostr:npub… and bare `@npub`… references without requiring a p tag, so the
public contract is stale. Update the InboundMessage documentation in
AgentControlEvent::InboundMessage and the corresponding client-side docs in
client.ts to describe mentions_self as a broader self-mention signal rather than
“p-tagged” only. Keep the docs aligned with the logic in
plaintext_has_nostr_hex_ref and the npub-based fallback so downstream consumers
do not assume a p tag is present when mentions_self is true.
- Around line 97-101: The mention detection in markdown_inlines_have_npub_ref is
incorrectly treating Inline::Image alt text as visible content, so images can
trigger mentions_self even when nothing is rendered. Update the Inline::Image
branch in event_projection.rs to skip recursing into alt text, and add a
regression test around markdown_inlines_have_npub_ref or mentions_self proving
that an image like  with @<self-npub> does not count as a mention.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d7968d6b-3e6d-4417-b5a6-4729a940f2ef
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
crates/agent-connector/Cargo.tomlcrates/agent-connector/src/event_projection.rscrates/agent-connector/src/tests.rs
Summary
@npub1…text as a self-mention.ptag andnostr:<hex|npub>fallback handling.@npub1…and gluedfoo@npub1…non-mentions.Test Plan
cargo test -p agent-connectorjust fast-ciCloses #620
Summary by CodeRabbit
npub-style mentions andnostr:references.