Skip to content

feat: add agent thread controls#2

Draft
nassimna wants to merge 1 commit into
agent/fork-from-message-v2from
agent/thread-controls
Draft

feat: add agent thread controls#2
nassimna wants to merge 1 commit into
agent/fork-from-message-v2from
agent/thread-controls

Conversation

@nassimna

@nassimna nassimna commented Jul 22, 2026

Copy link
Copy Markdown
Owner

What Changed

  • Added project-scoped thread_list, thread_create, thread_fork, thread_send, and thread_archive MCP tools.
  • Added capability checks so thread tools are limited to the invoking project and authenticated provider session.
  • Added Codex developer instructions describing when to use each thread-control tool.
  • Made agent-initiated thread_fork default to the last completed turn while excluding the agent's currently running turn.
  • Automatically opened an agent-created fork as a side chat.

Why

Agents can currently operate only in the active conversation. Delegating an investigation or exploring an alternative requires interrupting the main task or manually creating and coordinating another thread.

These controls give the running agent one project-native way to inspect, create, fork, message, and retire sibling threads while T3 Code keeps the user in control of the resulting conversations.

Scope

This PR contains only agent-facing thread controls. It is a 14-file delta on top of the selected-message fork foundation in pingdotgg/t3code#4248. It does not add or change the per-message fork action or provider-specific fork adapters.

Verification

  • vp test run on the four affected MCP, orchestration, and Codex-instruction test files: 27 tests passed.
  • Contracts, server, and web package typechecks passed.
  • Integrated browser verification confirmed that a running agent can call thread_fork, inherit the previous completed turn, and automatically open the new thread as a side chat.

UI Evidence

Before

Conversation before an agent opens a side thread

After

Agent-created fork opened as a side chat

Interaction

The 20-second recording keeps the real cursor visible and uses the single prompt Open a new thread and say hello, showing the native thread-create and thread-send tool calls before opening the new Hello thread and displaying its hello message.

20-second real-cursor agent thread-control recording

Checklist

  • The PR contains one feature: agent thread controls.
  • The user-facing message fork and provider adapters remain in the dependency PR.
  • Before/after screenshots and a short recording are included.
  • Focused tests and affected package typechecks pass.

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant