Repository navigation
fix(inbox): an unplaced inbox follows its registered agent's group - #43
Conversation
Desktop agents enrolled with a device token are named by their harness (cursor-, claude-, codex-), so no streamDefaults prefix covers their relaycast:inbox/<name> stream and every DM to them was denied as unknown_stream. After override, registered stream and prefix default, an inbox id now resolves from the registered agent with that name: owned by the agent, in its gid, with the new optional policy inboxDefaults entry for that gid (mode, acl, classify) or 660 with no ACL. Unregistered names stay unknown_stream. The agent directory keeps using operator rules only, so visibility is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
The synthetic ctl:<userId> agent (keyId control) owns a Control user's sessions but holds no token, so a DM to it would be enrolled upstream and never read. Such names stay unknown_stream, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
relaygate placed
relaycast:inbox/<name>streams only bystreamDefaultsprefixes (local-,pit-,slack-). Agent Relay Desktop agents enrol with a device token (keyIddevice:<uid>, gid fromcontrolPrincipals) and are named by their harness (cursor-…,claude-…,codex-…), so their inboxes matched no prefix and every DM to them was denied at stagemode, reasonunknown_stream. Local agents could not DM each other.Fix
resolveStreamorder is now: override → registered stream → longest prefix default → registered agent's inbox (only forrelaycast:inbox/<name>):inboxDefaults: [{gid, mode, acl?, classify?}]for that gid; otherwise660, no ACL (same group may message it, no one else)unknown_stream(deny):agent-inboxExplicit overrides and
streamDefaultskeep precedence. The pit (gid 22) never getswon a gid-11 inbox unless policy grants it (built-in default has other = 0;inboxDefaultsmirroringlocal-gives 22 onlyr).Visibility unchanged:
GET /v1/agentsstill uses operator rules only (resolveStream(..., { agentInboxes: false })), so a derived inbox does not show an agent in the directory. If we want local Desktop agents to list each other too, that's a one-line flip — called out deliberately.Policy validator:
inboxDefaultsgids/ACL gids must be defined groups, at most one entry per gid, mode validated as elsewhere. Also: an agent can now read its own inbox (owner digit), which previously failed for these agents the same way.Docs:
docs/contract.md(Resources → DMs; pit deployment section).examples/policy.pit.jsondeclaresinboxDefaultsfor gid 11.Deployer policy addition
(mirror whatever ACL your
relaycast:inbox/local-rule has). Without it, Desktop agents still DM each other with built-in660/no ACL. Chart default: separate infra PR.Tests
test/agent-inbox.test.ts: device-enrolledcursor-xandclaude-yDM each other; pit agent can't DM them (also with inboxDefaults mirroring local-: r yes, w no); explicit streamDefaults/overrides win; unregistered name →unknown_stream; only inbox ids derived; directory visibility unchanged; explain reportsagent-inbox; validator rules.npm run typecheck+npm test(167) green.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Desktop agents register with device tokens and are named by their harness (
cursor-…,claude-…,codex-…), so nostreamDefaultsprefix covered their inboxes and every DM to them was denied asunknown_stream. Resolution for an inbox is now override → registered stream → prefix default → the registered agent's inbox, owned by that agent, in its group, with mode/ACL/classify from the newinboxDefaultspolicy entry (default660, no ACL); a name no agent has still staysunknown_stream.streamDefaultskeep precedence; audit reasons end in:agent-inbox.ctl:identity holds no token, so it is never a DM recipient through this rule and those names stayunknown_stream.GET /v1/agentsstill uses operator rules only, so a derived inbox doesn't list the agent.Migration
"inboxDefaults": [{"gid": 11, "mode": "660", "acl": [...]}]mirroring theirrelaycast:inbox/local-rule; without it, desktop agents still DM each other with the built-in660/no ACL.Written for commit 2638a9b. Summary will update on new commits.