Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

test(server): the messaging verbs inherit the NAMED edition refusal — proven on the wire

enes01fd2d5b5850
diff --git a/docs/SERVER.md b/docs/SERVER.md
index 3ddc7f3cb..4de226581 100644
--- a/docs/SERVER.md
+++ b/docs/SERVER.md
@@ -491,6 +491,10 @@ Consequences worth knowing:
outage. `browser` additionally names why it is **structural** rather than unimplemented —
a browser node on this edition renders in the **viewer's own** browser tab, which this
server has no debugger for, and never can. See `src/server/control-unsupported.ts`.
+ The agent-messaging verbs (`send`/`reply`/`notify`) are additionally **verified-only at
+ the route** on every edition, so on this one an unverified caller gets the flat 403
+ messaging refusal and a verified caller gets the same
+ `control-unsupported-on-this-edition` — both terminal, neither an invitation to retry.
- The **`ptyDestroy` tail-teardown** — *resolved in Phase 3c.* Phase 3b left this skipped
(agent tails self-cleared only on `SessionEnd`, so a node closed *without* one left an
idle file-tail); the server now untracks agent tails on node close, at desktop parity.
diff --git a/src/server/control-unsupported.test.ts b/src/server/control-unsupported.test.ts
index 222256824..09fc58ee1 100644
--- a/src/server/control-unsupported.test.ts
+++ b/src/server/control-unsupported.test.ts
@@ -12,7 +12,7 @@ import os from 'os'
import path from 'path'
import { initPlatform, resetPlatformForTests } from '../core/platform'
import { fakePlatform } from '../core/platform-fake'
-import { hookServer } from '../core/agents/hook-server'
+import { hookServer, MESSAGING_CONTROL_REFUSAL } from '../core/agents/hook-server'
import { nodeAuthToken } from '../core/agents/node-auth-token'
import { STRICT_CONTROL_REFUSAL } from '../core/agents/node-identity-policy'
import {
@@ -87,6 +87,24 @@ describe('the Server Edition refuses canvas control by name', () => {
expect(text.trimEnd()).not.toContain('\n')
})
+ it('the messaging verbs get the same NAMED refusal — /control/send is 400, never an outage', async () => {
+ // Task 5.3 of the messaging plan, shared with this mechanism by agreement. `send` is
+ // verified-only at the route (requiresVerified runs before the handler on every edition), so
+ // a token is presented here for the same reason the `browser` test presents one: the edition
+ // answer is what a caller that got PAST identity hears.
+ const res = await control('send', 'n-msg', 'text/plain', nodeAuthToken(SECRET, 'n-msg'))
+ expect(res.status).toBe(400)
+ const text = await res.text()
+ expect(text).toContain(CONTROL_UNSUPPORTED_ERROR)
+ expect(text).toContain('do not retry')
+ })
+
+ it('an unverified `send` is refused on IDENTITY first, and that refusal does not invite a retry either', async () => {
+ const res = await control('send', 'n-msg2')
+ expect(res.status).toBe(403)
+ expect((await res.text()).trim()).toBe(MESSAGING_CONTROL_REFUSAL)
+ })
+
it('names WHY browser control is structural, not merely unimplemented', async () => {
// `browser` is a strict verb, so it takes a verified identity even to be told no. That
// ordering is correct — identity runs before the handler — and it is why this test presents a