fix(claude): mid-sentence skill chips keep the full request #15253
main fromrefs/pull/15253/head·merged by juliusmarminge View on GitHubA Claude skill selected after other text lost the remainder of the surrounding request when the native CLI expanded its final command block. The planner now keeps the complete request, with recognized mentions written as /name, before that command block. Skill arguments and prompt-leading dispatch stay unchanged. Sends and steering share this path, including images and file references.
Original fix by @ScottN-PV in #15253. Fixes #13256. Maintainer takeover preserves the contributor commits, merges main, and replaces the duplicated adapter harness with cases in the existing attachment test.
Validation on Linux / Node 24:
- Two focused suites: 301→296 tests (
ClaudeAdapterV2.test.ts: 289→288;ClaudeSkillDispatch.test.ts: 12→8). All 296 pass. Temporarily restoring main's planner produces 5 failures / 291 passes; restoring the fix passes again. - Server typecheck, targeted lint, formatting, and diff checks pass. Lint retains an existing unused-layer warning.
- Native CLI before/after capture: the production message builder and installed Claude CLI ran against a local fake Messages API. A mid-sentence request changes from
you willtoyou will /echo-request fixesbeside the expanded skill. Multiline and Ultrathink requests retain their complete text; a leading skill is unchanged. Skill arguments expand correctly in all four layouts. The capture deliberately returns a terminal API error and performs no inference.
Independent Opus and Sol whole-PR reviews found no blockers in one round. Opus noted the intended duplication of trailing arguments and attachment notes: preserving the complete request while keeping native arguments unchanged can increase prompt size.
No visual layout changes. Browser startup was attempted in isolated worktree state, but remained on the splash screen under heavy build/typecheck load and was stopped. Actual client send/steer interaction, authenticated model execution, macOS, Windows, iOS, Android, and Electron desktop were not verified; SDK-boundary tests cover send/steer and attachment paths.
Prepared using GPT-6-Astra (tests), GPT-6.1-Sol (implementation/coordinator), Claude Opus 5.5 and GPT-6-Sol (independent reviews), through Codex and Claude Code in T3 Code. Unmerged.
- 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
2196e33Macroscope's review found this PR approvable — This is a narrowly scoped Claude prompt-dispatch bug fix that preserves the full request for mid-sentence skill chips while keeping existing prompt-leading and attachment/send/steer behavior covered by tests. It does not change product defaults, schemas, infrastructure, or static-analysis configuration.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).juliusmarminge added labelsmacroscope-review
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:
cc3c6d9b-7f24-4bc7-a9cf-791aad885526
📥 Commits
-
Reviewing files that changed from the base of the PR and between fbee41f82ebe4c2d7a0b38a07d7a661bc739f305 and 08b449d416bdb3c07d283b2e82a0e816593c8bd9.
📒 Files selected for processing: 4
-
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsapps/server/src/provider/Drivers/ClaudeSkillDispatch.test.tsapps/server/src/provider/Drivers/ClaudeSkillDispatch.ts
🚧 Files skipped from review as they are similar to previous changes: 1
-
- apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
📝 Walkthrough
-
Claude skill dispatch now rewrites recognized skill mentions throughout the prompt text while retaining the selected invocation and trailing text in a separate command block. Tests cover prompt formats, image attachments, initial prompts, and steering messages.
Changes: Claude Skill Dispatch
Layer / File(s) Summary Rewrite mentions and select the dispatch target
apps/server/src/provider/Drivers/ClaudeSkillDispatch.ts,apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.tsplanClaudeSkillDispatchrewrites recognized mentions in the full prompt forleadingText. The selected mention and its trailing text remain incommandText. Tests cover mention positions and prompt formats.Verify offered adapter messages
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts,apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsTests verify expanded skill prompts in initial messages and steering, including a prompt with an image attachment. A comment describes the request text and separate command block. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
maria-rcks
Merge Risk: ⚪ Minimal · up to
08b44-
The change preserves the request around a mid-sentence skill chip, with no identified issue that needs resolution before merge.
Security architecture risk: 🔵 Low · up to
08b44-
The change preserves the complete request without changing the selected skill or its arguments. Its scope is narrow, but some request text is now repeated, and live execution behavior was not independently verified.
Retained concerns No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- inferred — The demonstrated exposure is changed text within existing skill-enabled requests, including initial sends and steering. The inspected flow does not introduce another destination, credential, or execution identity.
Trust Boundaries and Controls
- observed — Request text can select only a recognized mention whose name belongs to the caller-supplied skill set. Selection still uses the last recognized mention, and the command arguments are unchanged from the base. The rewritten request remains user-role content rather than acquiring a higher-trust message role.
-
Pre-merge checks:
4-
Check name Status Explanation Linked Issues check Issue #13256requires mid-sentence skill chips to preserve the complete request during native expansion.planClaudeSkillDispatchnow keeps the full transformed prompt inleadingTextand preserves …Out of Scope Changes check The planner implementation, planner tests, adapter tests, and adapter comment directly support issue #13256. The PR does not implement the separately excluded setting for disabling typed$skill men…Title check The title clearly identifies the Claude skill-dispatch fix and the affected mid-sentence behavior. Description check The description covers the problem, implemented change, linked issue, approval context, focused verification, limitations, and tooling. It does not use the template headings, but the required informat… Full details: Linked Issues check
-
Explanation
Issue
#13256requires mid-sentence skill chips to preserve the complete request during native expansion.planClaudeSkillDispatchnow keeps the full transformed prompt inleadingTextand preserves the dispatched command with trailing text. Planner tests cover mid-prompt, multiline, repeated, digit-prefixed, currency-prefixed, leading-chip, andUltrathink:cases.ClaudeAdapterV2tests cover sends, images, and steering. The reported native and inference results also support preserved text and skill arguments.
Full details: Out of Scope Changes check
-
Explanation
The planner implementation, planner tests, adapter tests, and adapter comment directly support issue
#13256. The PR does not implement the separately excluded setting for disabling typed$skill mentions. No unrelated changes are identified in the reviewed scope.
Full details: Description check
-
Explanation
The description covers the problem, implemented change, linked issue, approval context, focused verification, limitations, and tooling. It does not use the template headings, but the required information is present and sufficiently detailed.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
@coderabbitai review
⚠️ Action not completed
Incremental review skipped.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
@coderabbitai review
✅ Action performed
Review finished.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
juliusmarminge assignedjuliusmarminge
Taking over this one for maintainer batch claude-08. I’ll trim the regression coverage, integrate current main, rebuild the focused fix, and run independent reviews before pushing. The original author’s commits will be preserved.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged this2b00ab1
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed