fix(acp): preserve native slash command prompt shape#19393
ACP slash commands keep their leading /, but T3 then appends runtime instructions as a second text block. Copilot expands native skill commands only when the prompt contains one text block, so skills requiring slash invocation never load.
For raw user messages beginning with / after leading whitespace, omit that appended runtime block. Preserve the native command text and existing instruction-state tracking; ordinary turns still receive runtime instructions and mode changes still refresh session instructions.
Fixes #19384.
Verification on Windows with Node 24.19.0:
vp test run apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts -t 'refreshes ACP prompt instructions when the interaction mode changes': passed. The live ACP protocol fixture asserts/compactand whitespace-prefixed/repro-skillhave one text block, then verifies ordinary messages retain runtime instructions and mode transitions.- Provider ACP typecheck, focused lint/formatting, and
git diff --checkpassed. Lint reports three existing warnings outside the changed test code. - The full ACP test file did not finish locally and was stopped. Upstream CI subsequently passed at
66783f7, including all six server test shards. I did not run a real Copilot session or launch a client.
Implemented with GPT-6.1-Sol through the Codex harness in T3 Code.
Checks
Added 1 commit
- fix(acp): preserve native slash command prompt shape66783f7
Approvability
Verdict: Approved at 66783f7
Macroscope's review found this PR approvable — This is a small, localized ACP prompt-shape fix: native slash commands now remain single text blocks while ordinary prompts and mode-transition behavior remain unchanged. Targeted live tests cover both slash-command forms and preserve the existing prompt behavior for normal turns.
You can add or adjust custom eligibility rules. Learn more.
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:
915417c5-1bf6-4ace-8f48-8a82b7e2b677
📥 Commits
Reviewing files that changed from the base of the PR and between f99b20275359ff7acecdb916a9fa25ac33102b12 and 66783f784ac9cca4c5ee9cf19e0035145bdf50ae.
📒 Files selected for processing: 2
apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tspackages/provider-acp/src/server/adapter.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
📝 Walkthrough
The ACP adapter now omits runtime instructions when a prompt starts with
/. Tests check the prompt block counts for slash-command and default prompts, and retain the mode and prompt assertions for default and Plan turns.Changes: ACP slash-command prompts
Layer / File(s) Summary Slash-command prompt handling and tests
packages/provider-acp/src/server/adapter.ts,apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsThe adapter detects slash-command prompts and omits runtime instructions for them. Tests verify text-block counts for slash-command and default prompts, and check subsequent default and Plan turns. 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 66783
Slash commands retain their native prompt shape, and ordinary prompts retain runtime instructions. No merge-blocking issue is identified.
Architecture risk: 🔵 Low · up to 66783
The change affects 2 systems.
Changed systems: packages/provider-acp, apps/server
Architecture concerns No architecture-level concerns identified.
Review details
Systems and components
- 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:
rawProtocolPromptTextis replaced byrawProtocolPromptTextBlocks, which returns each valid text block from the prompt array separately instead of joining the texts into one string; invalid or non-text blocks are discarded. - observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts: The prompt test now reads text blocks separately, joins their text for existing prompt assertions, and checks block counts: one for
/compactand the whitespace-prefixed/repro-skill, and two for the first default request. The default-turn ordinals shift to accommodate the added request. - observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts: Default and Plan continuation checks are renumbered to follow the added whitespace-command and initial default turns; their prompt-content and mode assertions are retained.
- observed — Modified behavior in packages/provider-acp/src/server/adapter.ts:
resolvePromptPartsnow detects whether the user’s trimmed prompt starts with/and records it as a native slash command.
Pre-merge checks: 4
Passed checks: 4 passed
Check name Status Explanation Linked Issues check The changes satisfy the coding requirements in issue #19384.resolvePromptPartsdetects prompts whose leading whitespace is followed by/and skips the appended runtime-instructions text block. It…Out of Scope Changes check The pull request changes only ACP prompt construction and its focused protocol test. The test changes directly verify the slash-command prompt shape, ordinary runtime instructions, and mode behavior r… Description check The description covers the problem, change, scope, linked issue, verification results, limitations, and agent details. It follows the required template closely. Title check The title clearly and concisely describes the primary change: preserving the native slash-command prompt shape in ACP.
✨ 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.