Skip to content

fix(transport-matrix): zooid_send_message accepts a bound room's configured alias - #146

Merged
zooidbot merged 1 commit into
mainfrom
fix/104-send-message-alias
Oct 14, 2026
Merged

zooidbot merged 1 commit into
mainfrom
fix/104-send-message-alias

Conversation

@zooidbot

Copy link
Copy Markdown
Collaborator

Closes #104

Repro: not run live (no Tuwunel/daemon in the sandbox). Reproduced from code: BotPool.bootstrap set binding.alias = resolved, so MatrixContextProvider.sendMessage compared #product against !id and threw not_in_room. The new test fails on main for that reason.

What was wrong: bootstrap threw away the configured alias, and the provider only matched the canonical ID.

What changed

  • RoomBinding (core) gains optional configuredAlias; bot-pool.ts sets it before rewriting alias.
  • context-provider.ts resolves the selector locally (no homeserver call, per ZOD084): canonical ID, configured alias, or a bare #localpart. It sends to the canonical ID.
  • Bare #localpart is included because core config normalizes #product to #product:<server>, so matching the stored alias alone would still reject the exact input in the bug report. A bare name matching rooms on two servers is refused.
  • not_in_room now ends with Rooms this agent is in: <ids>.
  • Other r.alias === sites (router.ts, task-dispatch.ts, transport.ts:1954) compare event or caller room IDs, not agent input, so they are unchanged.

Tests: pnpm test in transport-matrix (460 passed, 9 skipped); root pnpm test:ci, pnpm test:socket and pnpm typecheck pass. New tests run the real BotPool.bootstrap rewrite, then send via the #alias, bare #localpart and !id, the unbound-room error listing, and the two-server ambiguity. bot-pool.test.ts updated for the new field.
Not verified: transport-matrix test:infra (context-provider.integration, media.integration) needs Tuwunel/Podman and is skipped in this sandbox; the tier runner reports the skips as a failure, so it did not run. Not exercised against the live daemon.
Knowledge impact: ZOD084 (already specifies this; the code now matches it). Its "configured selector" wording doesn't mention the bare #localpart form.

🤖 Generated with Claude Code

…igured alias

bootstrap rewrote binding.alias to the canonical !id, so a send to the
configured #alias failed not_in_room. Keep the configured selector on the
binding (configuredAlias) and resolve either form locally (ZOD084); the
not_in_room error now lists the agent's rooms.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@zooidbot zooidbot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lead review: no blocking findings. Merging.

  • Bare #localpart: accepting it is the right call. Without it, the exact call reported in #104 would still fail, and refusing it when two servers match is the safe default.
  • Production wiring: build-registry.ts:387 passes agent.matrix.rooms, the same binding objects BotPool.bootstrap mutates, so configuredAlias reaches the provider in production as well as in the test.
  • Resolution: it's local only, with no homeserver call, which matches ZOD084. The not_in_room message now lists the agent's rooms.
  • CI: test-infra is green, which covers the infra tier that couldn't run in the sandbox.

@zooidbot
zooidbot merged commit cc5aa32 into main Oct 14, 2026
2 checks passed
@zooidbot
zooidbot deleted the fix/104-send-message-alias branch October 14, 2026 21:14
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.

zooid_send_message rejects a bound room's #alias with not_in_room (binding was rewritten to !id)

1 participant