Skip to content

Ping/mention collaborators inside a session (non-agent messages) - #1788

Open
rusackas wants to merge 2 commits into
mainfrom
session-ping-collaborators
Open

rusackas wants to merge 2 commits into
mainfrom
session-ping-collaborators

Conversation

@rusackas

@rusackas rusackas commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

Adds a Slack-like "ping" — bring a collaborator's attention to something inside a session without prompting the agent. A ping is a human-to-human note: it shows up in the conversation stream and is visible to session viewers, but it never enters the agent's context and never triggers a run.

Design decision (why not the @-prefix heuristic): the composer's @ is already an overloaded autocomplete trigger for files/users/KB references whose results do go to the agent (e.g. @file.ts explain this). Inferring "this is a ping, not a prompt" from a leading @ would collide with that and be fragile. Instead, intent is explicit via a distinct Ping button next to Send in the composer's action bar. It reuses the existing @-user autocomplete to pick who to mention.

What's in scope

  • New mention MessageType (packages/core/src/types/message.ts), stored via the existing messages pipeline. Mentioned user ids + author live in message.metadata (mirrors BoardComment.mentions). No DB migration needed — the enum option on a text column is TS-level only (per context/guides/creating-database-migrations.md).
  • POST /sessions/:id/ping (apps/agor-daemon/src/register-routes.ts) — a sibling to /sessions/:id/prompt that writes the message via the same messages-service RBAC hooks, but never creates/queues a Task and never spawns the executor. Since none of the agent executors (Claude/Codex/Gemini/Copilot) read conversation context from Agor's message table — they resume from their own native session files — never creating a Task is sufficient to structurally guarantee a ping can't reach the agent.
  • Excluded from agor_messages_list (the agent-facing MCP tool), closing the one remaining path an agent could otherwise read a ping back through.
  • Composer UI: a "Ping" button in SessionFooter, wired through AppActionsContext → client.sessions.ping(). Tracks @mentioned users via a new onMentionSelect callback on AutocompleteTextarea (also fixes a latent bug where multi-word mention names weren't quoted).
  • Distinct rendering: pings render as a comment-styled note (author + mentioned collaborators + text), not as agent output.
  • Tests: MCP tool exclusion is unconditional, mention quoting/callback behavior in AutocompleteTextarea.

Explicitly out of scope (follow-ups)

  • Slack DM on mention via the gateway (mention → look up email → openDmByEmail/sendSlackMessage). Feasible, left for a fast-follow.
  • Cross-session notification center / unread badges. For this PR, the ping simply appears live in the session view (same Socket.io/Feathers event path as any other message) — no new notification infrastructure.
  • Editing/deleting pings.

Test plan

  • pnpm typecheck across @agor/core, @agor/daemon, agor-ui, @agor-live/client
  • biome check clean on all changed files
  • Existing daemon/UI test suites for touched files pass (register-hooks, widgets/submissions, messages MCP tool, SessionPanel send, SessionFooter, AutocompleteTextarea)
  • New tests: agor_messages_list unconditionally excludes mention messages; AutocompleteTextarea quotes multi-word mentions and fires onMentionSelect
  • Manual smoke test in a running dev environment (not run in this session)

🤖 Generated with Claude Code

@rusackas
rusackas force-pushed the session-ping-collaborators branch from b1d76cb to 8d3e66f Compare September 3, 2026 16:38
Adds a Slack-like "ping": a human-to-human note in the conversation stream
that never enters the agent's context and never triggers a run.

- core: new `mention` message type.
- daemon: `POST /sessions/:id/ping` writes a `mention` message through the
  messages service (same RBAC as prompting), never creates a task, and the
  `agor_messages_list` MCP tool excludes mentions so the agent cannot read
  them back.
- client: `sessions.ping()` helper.
- ui: a distinct Ping button next to Send in the composer, `@` autocomplete
  reports which users were mentioned, and pings render as a note rather than
  agent output.

Ported onto the current composer footer (mobile sizing, touch targets) and
the DirectoryUser-based message and mention types.

Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@rusackas
rusackas force-pushed the session-ping-collaborators branch from 8d3e66f to ea6e96e Compare November 25, 2026 04:51
@preset-machine

preset-machine commented Nov 25, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

`sessions/:id/ping` is an RPC route like `sessions/:id/prompt`: its durable
effect reaches clients as `messages.created` through the message service, so
the route itself declares `audience: 'none'`. Without the declaration the
realtime-publish-policy source scan flagged the new route.

Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants