host: the MCP server room with the tool attach #76

Merged
mikluko merged 1 commit from room-attach into main 2026-11-16 09:56:13 +00:00
Owner

spec-bb1.39, the host's half of attach: the host serves an MCP server room (the go-sdk, streamable HTTP, stateless, JSON responses) on the pod's loopback with a random secret, and gives it to the agent in session/new when the agent declares mcpCapabilities.http (goose and claudeacp do; without it nothing is given and the host logs that). attach(path, caption) reads a regular file of the working directory (os.OpenRoot: .., absolute paths outside and links out are refused, readable reasons), up to 64 MiB, and calls HostService.Send; the server's own reason for a refusal is the tool's error text.

Tried: the tests drive the real server with the SDK's client, and a helper agent through the host end to end; TestRealGooseAttachesAFileThroughTheRoom (gated like the other real ones) ran the real goose on Kimi: it called room: attach, asked leave as "room: attach · chart.png" (title; goose's tool name room__attach is in the preceding tool_call's _meta.goose.toolCall.toolName), and the file reached the fake server with name, media type and caption. -race and GOMAXPROCS=1 -count=5 pass.

Not in this PR: the host answering the room's own permission requests (next, as specs-18 decided), the other tools. No changelog entry and no release before roomcity-b8's side of Send lands: until then the tool answers with the server's Unimplemented.

spec-bb1.39, the host's half of `attach`: the host serves an MCP server `room` (the go-sdk, streamable HTTP, stateless, JSON responses) on the pod's loopback with a random secret, and gives it to the agent in session/new when the agent declares `mcpCapabilities.http` (goose and claudeacp do; without it nothing is given and the host logs that). `attach(path, caption)` reads a regular file of the working directory (`os.OpenRoot`: `..`, absolute paths outside and links out are refused, readable reasons), up to 64 MiB, and calls `HostService.Send`; the server's own reason for a refusal is the tool's error text. Tried: the tests drive the real server with the SDK's client, and a helper agent through the host end to end; `TestRealGooseAttachesAFileThroughTheRoom` (gated like the other real ones) ran the real goose on Kimi: it called `room: attach`, asked leave as "room: attach · chart.png" (title; goose's tool name `room__attach` is in the preceding tool_call's `_meta.goose.toolCall.toolName`), and the file reached the fake server with name, media type and caption. `-race` and `GOMAXPROCS=1 -count=5` pass. Not in this PR: the host answering the room's own permission requests (next, as specs-18 decided), the other tools. No changelog entry and no release before roomcity-b8's side of `Send` lands: until then the tool answers with the server's Unimplemented.
host: give the agent an MCP server room, with the tool attach
Some checks failed
test / changelog (pull_request) Successful in 6s
image / image (pull_request) Successful in 25s
test / go (pull_request) Failing after 1m17s
5942d1a34f
The host serves it on the pod's loopback, over streamable HTTP with a secret of
its own for the session, and names it in session/new when the agent says it
takes http MCP servers (goose and claudeacp both do; goose refuses sse). attach
reads a file that lies within the working directory, by os.OpenRoot so that no
link leads out of it, and hands it to the server with HostService.Send; the
server's reason for refusing it goes back to the agent as the tool's own error.

The server answers Unimplemented to Send until its side is made, so the tool
fails with that reason until then.

Assisted-By: Claude <noreply@anthropic.com>
mikluko force-pushed room-attach from 5942d1a34f
Some checks failed
test / changelog (pull_request) Successful in 6s
image / image (pull_request) Successful in 25s
test / go (pull_request) Failing after 1m17s
to 96823fa884
All checks were successful
test / changelog (pull_request) Successful in 4s
image / image (pull_request) Successful in 21s
test / go (pull_request) Successful in 1m35s
2026-11-16 09:49:23 +00:00
Compare
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/roomcity!76
No description provided.