Skip to content

fix(desktop): preserve padded agent mentions#1716

Draft
baxen wants to merge 1 commit into
mainfrom
astro-first-mention-fix
Draft

fix(desktop): preserve padded agent mentions#1716
baxen wants to merge 1 commit into
mainfrom
astro-first-mention-fix

Conversation

@baxen

@baxen baxen commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Why

A managed agent whose metadata display name contains trailing whitespace can be selected and highlighted in mention autocomplete, but the selected mention is lost during submit. The composer trims the serialized message, while mention extraction still looks for the padded display name stored at selection time. Extraction then returns no pubkey, so the kind-9 event has no agent p tag and the non-member agent is neither added to the channel nor triggered.

This matches Astro's first-mention failure: the managed-agent metadata name was "astro ", while the visible profile label was "astro".

What

  • Canonicalize selected mention display names by trimming them before inserting mention text and storing the mention-map key
  • Add a desktop E2E regression with padded managed-agent metadata that verifies selection remains highlighted, send adds the agent as a bot, the event includes its p tag, and the delivered mention remains highlighted
  • Replace the earlier owner-only eligibility change, which did not explain the reported post-autocomplete failure

Risk Assessment

Low — the behavior change only canonicalizes leading/trailing whitespace in the display name of a selected mention. Mention pubkeys and agent eligibility rules are unchanged.

References

  • Focused Playwright regression passed (and reproduced the failure before the fix)
  • Desktop TypeScript/Vite build passed
  • Biome passed
  • Commit hooks passed
  • Pre-push desktop, mobile, Tauri, and Rust unit suites passed
  • The full integration gate was attempted but blocked at migrations by unrelated local Postgres credentials (password authentication failed for user buzz)

Generated with Codex

Co-authored-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1k766u8wq088nkr9vy94uqlh9kmw5956g593a7xk7cks7frhgctmsr00p27 <b7b5ae1dc079cf3b0cac216bc07ee5b6dd42d348a163df1adec5a1e48ee8c2f7@sprout-oss.stage.blox.sqprod.co>
@baxen baxen force-pushed the astro-first-mention-fix branch from 30703ae to 34d05a3 Compare July 10, 2026 17:40
@baxen baxen changed the title fix: support first mention of owner-only agents fix(desktop): preserve padded agent mentions Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant