fix(acp): slash commands reach the agent as a single prompt block #19396
main fromrefs/pull/19396/head·opened View on GitHubFixes #19384.
Opened a minute after #19393 (https://github.com/pingdotgg/t3code/pull/19393) by Exotic209093, which takes the same approach; the difference here is the shared isSlashCommandPrompt predicate and a full run of the ACP adapter test file. Happy to close this one if that lands first.
Problem#
ACP agents receive T3's orchestration instructions inside the first user prompt, and t3AcpPromptWithInstructions already leaves a prompt that starts with / untouched so the agent can expand its own slash command. But resolvePromptParts then appended a second text block with the <runtime_info> instructions on every turn. Copilot only expands a slash command when the prompt is a single text block that starts with / (the issue's standalone copilot --acp repro shows the same prompt loading the skill as one block and failing as two), so /skill turns reached the model as plain text, and skills with disable-model-invocation: true could never be started from T3 Code.
Change#
resolvePromptParts in packages/provider-acp/src/server/adapter.ts leaves out the runtime-instructions block when the message is a slash command, so the prompt is that single text block. The predicate moved into an exported isSlashCommandPrompt in orchestrationInstructions.ts so both places share it. Nothing else changes: image attachments are still appended, the empty-prompt error stays, and a slash turn still returns no instruction state, so the orchestration instructions are sent with the next ordinary turn as before. Grok also goes through this adapter and gets the same shape. Cursor appends its runtime instructions to the same text block and is unaffected; Muse uses its own turn/start protocol and is out of scope here.
Verification#
AcpAdapterV2.test.ts,sends a slash command as the only ACP prompt block: a/repro-skillturn sends asession/promptwhosepromptis exactly[{ type: "text", text: "/repro-skill" }], and the ordinary follow-up turn sends two blocks, the orchestration instructions with the message and the<runtime_info>block. Without the fix it fails withexpected [ {…}, …(1) ] to deeply equal [ { type: 'text', text: '/repro-skill' } ].AcpAdapterV2.test.ts(119 tests) and provider-core'sorchestrationInstructions.test.tspass; typecheck forprovider-core,provider-acpandapps/server, lint, fmt and knip clean.
Implemented with Claude Opus 5.5, coordinated by Claude Fable 5.1 in Claude Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
27c0a84Macroscope's review found this PR approvable — This is a small, self-contained ACP bug fix that preserves normal prompt handling and verifies the changed slash-command shape with an integration test. It does not alter product defaults, schemas, deployment behavior, or static-analysis configuration.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).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:
d358a518-3552-4e06-99ed-5aafd3b8991b
📥 Commits
-
Reviewing files that changed from the base of the PR and between f99b20275359ff7acecdb916a9fa25ac33102b12 and 27c0a84ecd3deb4c1721284287707af38499a45a.
📒 Files selected for processing: 3
-
apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tspackages/provider-acp/src/server/adapter.tspackages/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; 6 remain after this review.
-
📝 Walkthrough
-
The ACP adapter now omits runtime instructions from slash-command prompts. A shared helper detects prompts that begin with
/, and a test checks slash-command and ordinary prompt contents.Changes: ACP prompt handling
Layer / File(s) Summary Shared slash-command detection
packages/provider-core/src/server/orchestrationInstructions.tsThe exported isSlashCommandPrompthelper checks for/after leading whitespace. Existing orchestration-instruction handling now uses this helper.ACP prompt composition
packages/provider-acp/src/server/adapter.ts,apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsThe adapter omits runtime instructions for slash-command prompts. The test checks that a slash command is sent as the sole text block, while an ordinary prompt includes orchestration instructions and runtime information. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarminge
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
27c0a-
No actionable issue remains before merge; normal checks still apply.
Architecture risk: 🟡 Medium · up to
27c0aThe change affects 3 systems.
Changed systems:
packages/provider-core,packages/provider-acp,apps/serverArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — packages/provider-core (library) was modified; 1 changed file maps to changed impact.
- observed — packages/provider-acp (library) was modified; 1 changed file maps to changed impact.
- observed — apps/server (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts: Adds a live test that inspects outgoing
session/promptrequests:/repro-skillis sent as the sole text block, while an ordinary follow-up includes orchestration instructions and runtime information. - observed — Modified behavior in packages/provider-acp/src/server/adapter.ts: Added the
isSlashCommandPromptimport used to conditionally include runtime instructions. - observed — Modified behavior in packages/provider-acp/src/server/adapter.ts: Runtime instructions are now appended only when
messageTextis not a slash-command prompt; previously they were appended unconditionally. - observed — Modified behavior in packages/provider-core/src/server/orchestrationInstructions.ts: Added exported
isSlashCommandPrompt, which returns whether the prompt starts with/after leading whitespace is trimmed.
Reliability and maintainability
- inferred — Risk-relevant change factors for packages/provider-core: blast_radius_1; direct_dependents_1
Pre-merge checks:
6-
Passed checks: 6 passed-
Check name Status Explanation Linked Issues check The description links issue #19384, and the implementation directly addresses its ACP slash-command acceptance criteria.Out of Scope Changes check The changes are focused on ACP slash-command prompt construction, shared predicate logic, and targeted tests. No unrelated changes are described. Linked Issues check The change satisfies the coding requirements in [ #19384].isSlashCommandPromptcentralizes the leading-slash check.resolvePromptPartsomits the runtime-instructions block for slash commands, whil…Out of Scope Changes check The changes stay within the issue scope. The adapter change fixes ACP prompt shape, the exported helper preserves the existing slash-command behavior in provider-core, and the test covers the required… Title check The title is concise, uses conventional commit format, and clearly describes the primary ACP slash-command fix. Description check The description includes the problem, implementation details, linked issue, scope context, and focused verification results. It is sufficiently complete despite not repeating the template's Scope and …
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Note
🤖 Claude Fable 5.1 on behalf of Mnigos
Closing in favour of #19393, which was opened first for the same fix; three PRs on one issue is one too many.
Mnigos(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes