Skip to content

feat(server): MCP tools to manage threads and answer their requests - #122

Merged
adampeterhiggins merged 1 commit into
mainfrom
ah/mcp-write-7-thread-lifecycle-tools
Oct 1, 2026
Merged

adampeterhiggins merged 1 commit into
mainfrom
ah/mcp-write-7-thread-lifecycle-tools

Conversation

@adampeterhiggins

Copy link
Copy Markdown
Owner

Stack 7 of 8: agents operate T3 Code over MCP. Based on #121.

The operate toolkit could start, message, wait on and stop threads, but not do the rest of what the sidebar offers. An external supervisor also had no way to unblock a thread waiting on an approval.

  • update_thread. Title, model, runtime mode and interaction mode, via thread.meta.update, thread.runtime-mode.set and thread.interaction-mode.set. A thread agent's runtime-mode request is capped at its own mode, as in create_thread.
  • set_thread_state. archive / unarchive, settle / unsettle, pin / unpin, snooze (needs snoozeUntil) / unsnooze, and stop. Every way in has its way out. Delete is deliberately not offered.
  • respond_to_request (approval decision or question answers):
    • Listed only to token actors through a new McpActor.tokenToolsVisible predicate, so thread agents never see it.
    • The handler refuses thread actors too.
  • wait_for_thread reports open requests. It now returns pendingRequests, with each approval's accepted decisions and each question's options. They're derived with the decider's openRequests (now exported), so they match what the decider will accept.
  • Work-log labels and docs. Labels for the three tools; docs/user/agent-access.md, the fork-differences entry and the operate access description updated.

Testing:

  • Handler tests: open approval listed; answering refused for a thread agent and dispatched for a token; archive and snooze (snoozeUntil required); update_thread's runtime cap.
  • Both HTTP visibility tests updated. Thread agents see update_thread and set_thread_state but not respond_to_request; /mcp/operate lists respond_to_request.
  • Passing: server src/mcp + decider tests 247/247, client-runtime work-log 440/440. tsc is clean for server and web.
  • QueryMcpServer.test.ts returned a 404 once, in one of nine runs, while the full src/mcp suite ran in parallel. Eight reruns passed.

Done by Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

Adds update_thread (title, model, runtime and interaction mode) and
set_thread_state (archive, settle, pin, snooze, stop, and their undo) to
the operate toolkit, and respond_to_request, listed only to agent access
tokens, for answering a thread's approvals and questions as the user.
wait_for_thread now returns the thread's open requests with the
decisions or question options they accept.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@adampeterhiggins
adampeterhiggins force-pushed the ah/mcp-write-7-thread-lifecycle-tools branch from 7af1cb2 to 390b09d Compare October 1, 2026 08:35
@adampeterhiggins
adampeterhiggins changed the base branch from ah/mcp-write-6-started-by-ui to main October 1, 2026 08:35
@adampeterhiggins
adampeterhiggins merged commit ad25712 into main Oct 1, 2026
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.

1 participant