Skip to content

fix(acp): slash commands reach the agent as a single prompt block - #19396

Closed
Mnigos wants to merge 1 commit into
pingdotgg:mainfrom
Mnigos:acp-slash-prompt-single-block
Closed

Mnigos wants to merge 1 commit into
pingdotgg:mainfrom
Mnigos:acp-slash-prompt-single-block

Conversation

@Mnigos

@Mnigos Mnigos commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #19384.

Opened a minute after #19393 (#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-skill turn sends a session/prompt whose prompt is 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 with expected [ {…}, …(1) ] to deeply equal [ { type: 'text', text: '/repro-skill' } ].
  • AcpAdapterV2.test.ts (119 tests) and provider-core's orchestrationInstructions.test.ts pass; typecheck for provider-core, provider-acp and apps/server, lint, fmt and knip clean.

Implemented with Claude Opus 5.5, coordinated by Claude Fable 5.1 in Claude 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 14, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 27c0a84

Macroscope'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.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

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: d358a518-3552-4e06-99ed-5aafd3b8991b
📥 Commits

Reviewing files that changed from the base of the PR and between f99b202 and 27c0a84.

📒 Files selected for processing: 3
  • apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
  • packages/provider-acp/src/server/adapter.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; 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.ts
The exported isSlashCommandPrompt helper 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.ts
The 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

Merge Risk: ⚪ Minimal · up to 27c0a

No actionable issue remains before merge; normal checks still apply.

### Architecture Summary

Architecture risk: 🟡 Medium · up to 27c0a

The change affects 3 systems.

Changed systems: packages/provider-core, packages/provider-acp, apps/server

Architecture 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/prompt requests: /repro-skill is 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 isSlashCommandPrompt import used to conditionally include runtime instructions.
  • observed — Modified behavior in packages/provider-acp/src/server/adapter.ts: Runtime instructions are now appended only when messageText is 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: Passed 6
Passed Passed checks: 6 passed
Check name Status Explanation
Linked Issues check Passed The description links issue #19384, and the implementation directly addresses its ACP slash-command acceptance criteria.
Out of Scope Changes check Passed The changes are focused on ACP slash-command prompt construction, shared predicate logic, and targeted tests. No unrelated changes are described.
Linked Issues check Passed The change satisfies the coding requirements in [#19384]. isSlashCommandPrompt centralizes the leading-slash check. resolvePromptParts omits the runtime-instructions block for slash commands, whil…
Out of Scope Changes check Passed 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 Passed The title is concise, uses conventional commit format, and clearly describes the primary ACP slash-command fix.
Description check Passed 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

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

@Mnigos

Mnigos commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

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 Mnigos closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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]: Copilot (ACP) does not expand slash commands because T3 adds a runtime-instructions block

1 participant