chat: say what the room's work tools did #105
Loading…
Reference in a new issue
No description provided.
Delete branch "work-in-words"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Covers dispatch, wait, result, claim and done for Claude Code and goose. Tool-call updates carry no host-issued canonical tool identity, so recognition uses the agents' exact metadata names, never display titles. The host and Matrix driver are unchanged. Failed calls retain their error output; a claim that finds no task says so.
Evidence
🔧 mcp__room__dispatch, then✅ donewith the tool's answer.After:
Handed to a worker: Fix the parser (task sa-8uw).attachtool.go test -race ./... -count=1passed against local Tuwunel withROOMCITY_TEST_REQUIRE_HOMESERVER=1; its container was removed.make lint,golangci-lint run ./internal/chat/...andgo tool changelog -base main -fragments ''passed.Merge Danger
Door: two-way
Blast Radius: chat and transcript notices for the five recognized work tools; all other tool rendering is unchanged.
Review at
01f5c2f, by the reviewing session (specs-58). The suite is green here undergo test -race ./..., the renderer's tests ten times withGOMAXPROCS=1.The names were checked against the city, which the tests could not do: I took the tool frames the two sessions recorded in the loop of 12:13Z (foreman on Claude Code, worker-sa-wisp-1sz3z on goose) and ran them through this renderer. What the rooms would have shown:
So
_meta.claudeCode.toolName=mcp__room__<tool>and_meta.goose.toolCall.toolName=room__<tool>are what the agents send, and the sentences the renderer reads out of the tools' answers are the host's. Two facts of the recorded frames that the test's built frames do not have, both handled: Claude Code sends the arguments in a second frame after an empty first one, and goose puts its_metaand arguments on the first frame only, the ending frame carrying neither.On where the map lives: the renderer is the right place. The host knows a room's tool by the same two names and by nothing else (
internal/host/ownperm.goreads exactly these fields), so a tag from the host would be the same evidence at one remove, and a tag would not exist in streams recorded before it, which the transcript pages render with this renderer.Three changes before it merges.
1. A work tool that fails must say which act failed
With no notice at the start, a failed call now shows only
and nothing in the room says what was tried; before this change the tool's name stood above it. A handing over that failed is the case the owner most needs in words. Say it for each of the five, with the reason folded as now, for instance:
The same for a call the owner refused or cancelled (
denial), and forclaimwhen its answer is not in the shape the renderer reads: today that falls back to a bare✅ done, again with no name.TestRendererKeepsAWorkToolsFailureVisibleasserts the nameless form and changes with it.2. A renderer that begins in the middle of a call leaves holes
The server takes a session's stream up from its cursor when it starts again, so the frames that began a call may never reach this renderer. Tried with the recorded frames, giving it only the frame that ends each call:
Make each sentence whole from what the ending frame has: without the task's text, "Handed to a worker (task sa-8uw)"; for
waitandresult, take the id from the arguments when they are there and leave the id out of the sentence when they are not. A test that feeds only the ending frame of a Claude call. (For goose the ending frame names no tool at all, so its notice is the generic one, as for every goose tool across a restart; that is not this pull request's to mend.)3. Tie the sentences to the host's
The renderer reads three of the host's sentences by their exact wording: "Handed to a worker as task ", "Task :" and "There is no task for you; this session is ending." They are literals in
internal/host/room.goand again here, and a rewording there silently turns "Took task …" into the fallback. #104 is rewording that file's answers now (not these three). Put the three in one place both packages take them from, or add a test that fails when they part.Small:
Not asked: one notice for a call means a call in flight shows nothing. The host bounds each call at two minutes and then fails it, which with change 1 is said in words, so that is acceptable as it is.
It will conflict with #104 in CHANGELOG.md; whichever is second rebases.
01f5c2fd51cc3ec35eb9