Skip to content

fix(server): preserve instructions around Claude skill chips - #13299

Closed
ScottN-PV wants to merge 1 commit into
pingdotgg:mainfrom
ScottN-PV:fix/13256-claude-skill-instructions
Closed

ScottN-PV wants to merge 1 commit into
pingdotgg:mainfrom
ScottN-PV:fix/13256-claude-skill-instructions

Conversation

@ScottN-PV

@ScottN-PV ScottN-PV commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

Keep the complete user instruction in the text block before a mid-prompt Claude skill invocation, with known skill mentions rewritten inline as slash names. Keep the final native invocation and its arguments, and retain the single command block for chip-first prompts.

Why

you will $implement fixes previously reached Claude's native expansion as you will followed by /implement fixes. The resulting model request contained an orphaned prefix and the expanded skill, but no intact sentence. Preserving you will /implement fixes in the earlier block keeps the instruction intact while the last block still loads the skill.

Fixes #13256.

Validation

  • 152 tests passed across ClaudeSkillDispatch.test.ts and ClaudeAdapter.test.ts, including instruction preservation and image/command ordering.
  • Targeted lint and formatting passed; server package typecheck passed (Effect suggestions only); git diff --check passed.
  • Reproduced the failure on main at f5ef0ddb90a8c36584e181b1913e7b8a5df30ffc using Claude Code CLI 2.1.280 on Windows with Node 24.13.1. A local fake Messages API captured the native post-expansion request. The baseline lost the sentence; the patch preserved it and expanded the skill.
  • Patched native captures passed for mid-sentence input, multiple paragraphs, an Ultrathink prefix, negation, multiple skill mentions, and chip-first invocation. Only the final skill expanded in the multiple-mention capture.

The fixture used temporary configuration and no real model inference. These results establish request serialization and native expansion, not subsequent model interpretation or tool execution. No live T3 UI or mobile session was tested. Full instructions repeat the arguments already supplied to the native invocation; no additional native invocation is introduced.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (not applicable: server request construction)
  • I included a video for animation/interaction changes (not applicable: serialized request capture)

AI assistance: OpenAI Codex; harness: Codex agent runtime (specific integration/version not exposed); host/interface: T3 Code; model: gpt-6-astra (GPT-6 Astra); reasoning/effort: medium; contribution: investigation, implementation, regression tests, automated native and repository checks, and drafting. Model, effort, and host are user-confirmed; the specific harness integration and version remain unverified. Human involvement: selected the issue, authorized implementation, and confirmed the attribution details during review of this draft; no manual testing or code review claimed.

Summary by CodeRabbit

  • Bug Fixes
    • Preserved the full request when dispatching a skill mention, including preceding instructions, multiline text, and text around images.
    • Earlier skill mentions are retained as slash commands in the request, while the final mention is dispatched separately.

Keep the complete prompt before a mid-prompt native skill invocation so
Claude expansion does not leave an orphaned sentence prefix. Cover full
instructions, Ultrathink prefixes, multiple mentions, and image ordering.

Fixes pingdotgg#13256

Co-authored-by: Codex <noreply@openai.com>
AI-Tool: OpenAI Codex
AI-Harness: Codex agent runtime; specific integration/version not exposed
AI-Host: T3 Code (user-confirmed)
AI-Model: gpt-6-astra (GPT-6 Astra; user-confirmed)
AI-Reasoning: medium (user-confirmed)
AI-Contribution: Investigation, implementation, regression tests, automated verification, and drafting
@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 Sep 23, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 23, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 24a3654

Macroscope's review found this PR approvable — This is a focused Claude server bug fix that preserves complete user instructions while retaining native skill expansion. The production change is localized to prompt construction and is covered by targeted dispatch and adapter tests, with no schema, deployment, default, or static-analysis changes.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

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

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d196e259-9314-4ab9-8636-908ae6ebf16f

📥 Commits

Reviewing files that changed from the base of the PR and between f5ef0dd and 24a3654.

📒 Files selected for processing (4)
  • apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.ts
  • apps/server/src/provider/Drivers/ClaudeSkillDispatch.ts
  • apps/server/src/provider/Layers/ClaudeAdapter.test.ts
  • apps/server/src/provider/Layers/ClaudeAdapter.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Claude skill dispatch now keeps the full prompt, with skill mentions rewritten as slash commands, in the leading text. It sends the final skill mention as command text. Adapter tests verify the resulting content blocks, including prompts with image attachments.

Changes

Claude skill dispatch

Layer / File(s) Summary
Rewrite the complete prompt
apps/server/src/provider/Drivers/ClaudeSkillDispatch.ts, apps/server/src/provider/Drivers/ClaudeSkillDispatch.test.ts
planClaudeSkillDispatch rewrites skill mentions in the complete prompt and keeps the final mention as command text. Unit tests cover prefixes, multiple mentions, trailing mentions, multiline text, and an Ultrathink: prefix.
Preserve prompt text in adapter blocks
apps/server/src/provider/Layers/ClaudeAdapter.ts, apps/server/src/provider/Layers/ClaudeAdapter.test.ts
Adapter tests expect the leading content block to retain the prompt prefix with the rewritten slash command, including when an image attachment is present. The adapter comment describes this behavior.

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

Suggested reviewers: t3dotgg

Merge Risk: ⚪ Minimal · up to 24a36

The prompt-preservation change is ready to merge after normal checks; no actionable regression was found.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preserving instructions around Claude skill chips.
Description check ✅ Passed The description explains what changed, why it changed, validation performed, issue linkage, scope, and checklist status. It also identifies UI and interaction items as not applicable.
Linked Issues check ✅ Passed The changes satisfy #13256. planClaudeSkillDispatch now keeps the complete request in leadingText and rewrites earlier skill mentions as inline /name commands. It keeps the final invocation and …
Out of Scope Changes check ✅ Passed The source change, comments, and updated tests directly support the Claude skill-dispatch fix in #13256. The changes do not add unrelated behavior or unrelated files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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 1, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 1, 2026 04:43

Dismissing prior approval to re-evaluate 24a3654

@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition.

This change touches ClaudeAdapter.ts, which the V2 merge removed. Claude execution now runs through ClaudeAdapterV2.

Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved.

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]: Mid-sentence Claude skill chips split the original request during native expansion

2 participants