Skip to content

fix(server): Claude threads no longer get ACP and Codex tool instructions - #16482

Open
Gigioxx wants to merge 2 commits into
pingdotgg:mainfrom
Gigioxx:t3code/provider-scoped-orchestration-instructions
Open

Gigioxx wants to merge 2 commits into
pingdotgg:mainfrom
Gigioxx:t3code/provider-scoped-orchestration-instructions

Conversation

@Gigioxx

@Gigioxx Gigioxx commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Claude Code threads got two pieces of T3's orchestration prompt that only apply to other agents. Every provider receives the shared T3_CODE_ORCHESTRATION_INSTRUCTIONS from packages/provider-core/src/server/orchestrationInstructions.ts, and it carried the ACP terminal fallback (T3_ACP_MCP_NODE, acp-mcp-call), a Codex code-mode example, and the sample name mcp__t3_code__delegate_task. Claude names these tools mcp__t3-code__…, so the example was wrong there, and the ACP paragraph cost about 166 tokens in every Claude thread. Cursor, OpenCode, Pi and Codex got the ACP paragraph too. Fixes #16465.

The shared text is now provider-neutral. Each provider-specific part goes only to the path that uses it:

  • The ACP fallback is added in t3AcpPromptWithInstructions. The ACP adapter in packages/provider-acp is the only place that sets T3_ACP_MCP_NODE, and Grok, Antigravity, Devin and registry agents all build their prompt there.
  • The Codex code-mode hint is added in buildCodexAdditionalContext.
  • The lazy-attach guidance ("make one bounded direct attempt") stays shared, now under its own ### Finding T3 tools heading at the end. The ACP and Codex additions then read as part of that section, not as part of "Showing visuals".

Proof:

  • Reproduced on main by building Claude's real query options with the t3-code MCP server attached. systemPrompt.append contained ACP fallback, T3_ACP_MCP_NODE and mcp__t3_code__. With this change, it contains none of them.
  • New assertions cover the shared text, ACP with and without MCP, Codex's context, and Claude's systemPrompt.append. Against main's instruction files, 3 of them fail (for example expected '<runtime_info>…' to not include 'acp-mcp-call'). With this change, all pass.

Current-main verification:

  • ./node_modules/.bin/vp test run packages/provider-core/src/server/orchestrationInstructions.test.ts apps/server/src/provider/CodexDeveloperInstructions.test.ts apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts: 247 tests passed.
  • Server and provider-core typechecks passed. Scoped lint and formatting passed.
  • The merge preserves main's scoped MCP test setup and the relocated provider-core instructions. No UI behavior changed during conflict resolution.

Not checked: a live Claude or ACP session quoting its prompt.

Model: Claude Opus 5.5 (1M) with Codex GPT-6-Astra (medium). Harness: Claude Code in T3 Code.

Maintenance: GPT-6-Astra via the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 6, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 6, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 5cf9b50

Macroscope's review found this PR approvable — This is a small, well-scoped provider-instruction fix that removes misplaced ACP/Codex guidance from shared prompts and restores it only to the relevant provider paths. Runtime impact is limited to generated prompt text, with focused tests covering the affected providers.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4d058ee9-4617-4d40-bb7b-220ecd513dc9

📥 Commits

Reviewing files that changed from the base of the PR and between 94b834a and 5cf9b50.


📒 Files selected for processing (4)
  • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
  • apps/server/src/provider/CodexDeveloperInstructions.ts
  • packages/provider-core/src/server/orchestrationInstructions.test.ts
  • packages/provider-core/src/server/orchestrationInstructions.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

Shared orchestration guidance now separates ACP fallback instructions from general instructions. ACP prompts include the fallback only when T3 MCP tools are available. Codex context adds guidance to check for T3 capabilities before reporting that tools are absent.

Changes

Orchestration guidance

Layer / File(s) Summary
Shared guidance and ACP composition
packages/provider-core/src/server/orchestrationInstructions.ts, packages/provider-core/src/server/orchestrationInstructions.test.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
Shared instructions add bounded polling, duplicate-work avoidance, and stable retry IDs. They omit ACP-specific guidance and the Codex-specific tool example. ACP fallback guidance is appended when T3 MCP tools are available. Tests check the prompt contents for shared, ACP, and Claude contexts.
Codex capability guidance
apps/server/src/provider/CodexDeveloperInstructions.ts, apps/server/src/provider/CodexDeveloperInstructions.test.ts
Codex context adds guidance to check orchestrator capabilities before reporting that T3 tools are absent. A test checks for the Codex capability tool and the absence of acp-mcp-call.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge


Merge Risk | ⚪ Minimal · up to 5cf9b

Merge Risk: ⚪ Minimal · up to 5cf9b

The prompt guidance is separated by provider and scoped to the relevant tool context. No actionable merge-blocking regression is established.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 5cf9b

The change narrows where tool guidance is delivered while preserving existing access controls. No new or worsened security risk was identified in the reviewed change.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The reviewed relocation does not broaden ACP fallback exposure beyond its existing configured MCP session and authorized tool surface. Other consumers of shared guidance no longer receive the terminal-fallback instructions; this is a reduction in instructional reach, not evidence of stronger sandbox enforcement.

Trust Boundaries and Controls

  • observed — ACP MCP availability is derived from session configuration. The configured bridge and fallback environment use the session's endpoint and authorization header, and the inspected bridge sends authenticated requests to that endpoint. The relocated fallback is advice for an existing transport, not a newly granted credential or independent authorization path.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary fix: Claude threads no longer receive ACP and Codex-specific tool instructions.
Description check Passed The description provides a clear problem statement, implementation details, linked issue, verification results, untested items, and agent attribution. It does not use the template headings or state ex…
Linked Issues check Passed Issue [#16465] requires Claude Code threads to omit the ACP terminal fallback and the invalid mcp__t3_code__delegate_task example. The shared instructions now omit acp-mcp-call, T3_ACP_MCP_NODE,…
Out of Scope Changes check Passed The ACP fallback relocation preserves ACP behavior in the ACP prompt path. The Codex code-mode hint preserves Codex-specific guidance in buildCodexAdditionalContext. The shared lazy-attach guidance …

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 11, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 11, 2026 06:10

Dismissing prior approval to re-evaluate 94b834a

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 11, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 12, 2026 02:40

Dismissing prior approval to re-evaluate 5cf9b50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Claude Code threads get T3 instructions meant for other agents

2 participants