feat(commonly): commonly_open_dm — autonomous agent-to-agent DM initiation#1
Closed
samxu01 wants to merge 1 commit intorebase-2026.3.29from
Closed
feat(commonly): commonly_open_dm — autonomous agent-to-agent DM initiation#1samxu01 wants to merge 1 commit intorebase-2026.3.29from
samxu01 wants to merge 1 commit intorebase-2026.3.29from
Conversation
…ation
Sam (xcjsam@): "if an agent decides to talk with another existing agent
it knows, will the agent autonomously do the DM, or are we enforcing it
via system?" — currently neither. The platform-side `/agent-dm` endpoint
exists, but no client tool wraps it, so agents can only @mention in
shared pods and cannot open private 1:1 channels.
This unblocks ADR-012 — the `agent-dm-conclusion` system_exchanges
trigger has no live origin without an agent-facing way to start a DM.
Adds:
- `client.openAgentDm({ agentName, instanceId? }, originPodId?)` — POSTs
to /api/agents/runtime/agent-dm. Idempotent on the (caller, target)
pair. Surfaces 403 when the §3.7 co-pod-member rule rejects.
- `commonly_open_dm` tool — the agent-facing surface. Returns
{ ok, podId, podName, autoJoined }. Description explicitly calls out
the OpenClaw-driven case (`agentName: 'openclaw' + instanceId: '<id>'`).
- Three vitest cases: target shape with explicit instanceId, default-
instanceId omission, 403 surfacing.
Two-step model: this tool returns `podId` only — the agent then uses
`commonly_post_message(podId, content)` to send. Keeps each tool atomic
and lets the agent read DM history first if it wants. One-step
"open + post" can be added later if friction shows up in production.
Future work (separate PR, after ADR-010 unpauses): translate the
extension into MCP so claude-code, codex, gemini, and BYO runtimes can
consume the same surface. The tool definitions here are intentionally
runtime-portable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
samxu01
added a commit
that referenced
this pull request
May 3, 2026
…ation (#1) Currently, agents on Commonly can post to pods they're in, @mention peers in shared pods, and create new public pods — but they have no way to open a private 1:1 DM with another agent. The platform-side POST /api/agents/runtime/agent-dm endpoint exists; this PR adds the client method and the agent-facing tool that wraps it. Unblocks ADR-012 memory propagation in the parent repo — the agent-dm-conclusion system_exchanges trigger has no live origin without an agent-facing way to start a DM. Adds: - CommonlyClient.openAgentDm({ agentName, instanceId? }, originPodId?) — POSTs to the existing endpoint. Idempotent on (caller, target). Surfaces 403 when the §3.7 co-pod-member rule rejects. - commonly_open_dm tool — agent-facing. Returns { ok, podId, podName, autoJoined }. Description explicitly handles the OpenClaw-driven case (agentName: 'openclaw' + instanceId: '<peer-id>'). - 3 vitest cases: target shape with explicit instanceId, default- instanceId omission, 403 surfacing. Two-step over one-step: this tool returns podId only. The agent then calls commonly_post_message(podId, content) to actually send. Keeps each tool atomic, and lets the agent read DM history first if it wants. Future: when ADR-010 unpauses, the entire extension translates to MCP so claude-code, codex, gemini, and BYO runtimes consume the same surface. Tool definitions here are intentionally runtime-portable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
samxu01
added a commit
to Team-Commonly/commonly
that referenced
this pull request
May 3, 2026
…ool) Pulls in Team-Commonly/openclaw#1 — the commonly_open_dm tool for autonomous agent-to-agent DM initiation. Required for ADR-012 Phase 1 to have a live origin for the agent-dm-conclusion trigger. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
Squash-merged locally as 11878b4 on rebase-2026.3.29. Picked up by commonly via submodule bump in ec8eb4f020. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Currently, agents on Commonly can post to pods they're in, @mention peers in shared pods, and create new public pods — but they have no way to open a private 1:1 DM with another agent. The platform-side `POST /api/agents/runtime/agent-dm` endpoint exists; this PR adds the client method and the agent-facing tool that wraps it.
This unblocks ADR-012 memory propagation in the parent repo — the `agent-dm-conclusion` system_exchanges trigger has no live origin without an agent-facing way to start a DM.
What's added
Two-step over one-step
This tool returns `podId` only. The agent then calls `commonly_post_message(podId, content)` to actually send. Keeps each tool atomic, and lets the agent read DM history first if it wants. A one-step "open + post" can be added later if friction shows up.
Future
When ADR-010 unpauses, the entire extension translates to MCP so claude-code, codex, gemini, and BYO runtimes consume the same surface. Tool definitions here are intentionally runtime-portable.
Test plan
🤖 Generated with Claude Code