fix(mcp): show an agent's writes without reloading the page - #56
Merged
Conversation
A card filed over MCP did not appear until the browser was refreshed. The Kanban and note queries have no polling and no subscription, so they only refreshed when the UI itself made the change — which means a write from anywhere else was invisible by construction. That is worst for exactly the case this feature exists for: an agent working in the background, while you are not thinking to press reload. A successful mutation now broadcasts library:update carrying the space, and the browser invalidates the Kanban, the columns and the Library tree. Three deliberate details: - It fires only AFTER the write succeeds. Announcing the attempt would put the UI a step ahead of the data — it would refetch, see the old state, and quietly disagree with what the agent was just told. - Reads announce nothing. Nothing changed, so there is nothing to refetch, and a listing agent should not make every open browser do work. - A failed broadcast does not fail the write. The write already happened; reporting failure would tell the agent its change was rejected when it was not, and a reload still shows the truth. A missed notification is the smaller harm, so it is logged and swallowed. The announcer is injected by the route rather than reached for inside mcp_server, same as the comment poster — the websocket manager is a thing only the HTTP layer has, and keeping it out means the tool layer still tests without a running app. Broadcast to all clients: a Library space is not scoped to a TeamWork project, and a client with no query for it ignores the event. 45 MCP tests, 282 TeamWork tests green, tsc + build clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A card filed over MCP didn't appear until the browser was refreshed.
Why
The Kanban and note queries have no polling and no subscription — they only refresh when the UI itself made the change. So a write from anywhere else was invisible by construction, and worst for exactly the case this feature exists for: an agent working in the background, while you're not thinking to press reload.
A successful mutation now broadcasts
library:updatecarrying the space, and the browser invalidates the Kanban, the columns, and the Library tree.Three deliberate details
Fires only after the write succeeds. Announcing the attempt would put the UI a step ahead of the data — it'd refetch, see the old state, and quietly disagree with what the agent was just told.
Reads announce nothing. Nothing changed, so there's nothing to refetch — and a listing agent shouldn't make every open browser do work.
A failed broadcast doesn't fail the write. The write already happened; reporting failure would tell the agent its change was rejected when it wasn't, and a reload still shows the truth. A missed notification is the smaller harm, so it's logged and swallowed.
Shape
The announcer is injected by the route rather than reached for inside
mcp_server— same as the comment poster. The websocket manager is a thing only the HTTP layer has, and keeping it out means the tool layer still tests without a running app.Broadcast to all clients: a Library space isn't scoped to a TeamWork project, and a client with no query for it ignores the event.
Verification
45 MCP tests, 282 TeamWork tests green,
tsc+ build clean. Found by using it on the live box.