Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): honor explicit $skill invocations across providers #8336

ClosedD3OXY(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/8336/headopened View on GitHub

Problem

The composer flattened a selected skill chip into plain $name text. Provider adapters then guessed intent with a regex, so ordinary dollar-prefixed text could be treated as a skill and provider behavior differed.

Fix

  • Preserve selected skill metadata as { name, start, end } from web/mobile composers through durable drafts, queued sends, turn-start events, and provider requests. Timeline text stays canonical.
  • Send native structured skill inputs to Codex. Claude Code, Cursor, Grok, and OpenCode receive explicitly selected skill documents with their source file for relative references.
  • Validate stale, overlapping, disabled, and unknown invocations at the provider boundary. Plain dollar-prefixed text is never inferred as a skill.
  • Discover provider skills once per session instead of scanning during send.
  • Preserve Claude argument substitution and reject runtime-only skill fields that the fallback cannot safely emulate.
  • Discover Cursor skills in the session workspace and use upstream Grok skill discovery, while honoring provider user-invocation visibility.

Verification

  • 470 focused tests across contracts, orchestration, draft/outbox persistence, skill discovery, provider adapters, and upstream Grok reliability paths.
  • Contracts, server, shared, web, and mobile typechecks pass. Server reports only existing Effect suggestions.
  • Focused lint, formatting, and git diff --check pass.

Closes #6095 Closes #8758 Implements #7795.

Implemented with GPT-5.6 Codex in the T3 Code harness.

Note

Honor explicit $skill invocations across all providers and clients

  • Adds ExplicitSkillInvocation schema to contracts and extends thread.turn.start commands, payloads, and ProviderSendTurnInput with optional skillInvocations ranges.
  • Each provider adapter (Claude, Cursor, Grok, OpenCode, Codex) now discovers available skills at session start and, when skillInvocations are present on a turn, replaces raw $skill tokens in the prompt with rendered skill document contents and explicit invocation markers. Unknown or invalid skill references fail early with ProviderAdapterValidationError.
  • Web and mobile composers track explicit skill ranges in editor snapshots and draft state, persist them across offline queues, and remap offsets through text trimming and terminal-context appending before send.
  • Introduces shared utilities remapExplicitSkillInvocations and updateExplicitSkillInvocationsForTextEdit to keep ranges valid across text edits.
  • Behavioral Change: ClaudeSkills.parseSkillFrontmatter now uses schema validation and skills with user-invocable: false are excluded from discovery; CursorSkills.discoverCursorSkills scans multiple user and project roots; malformed skill frontmatter in Claude causes ProviderAdapterValidationError on sendTurn; queued thread message schema bumps to version 4.
Macroscope summarized 35bc117.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 0d7cda76-d742-4935-8fe9-5d009973a3f2

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Warning

      Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This introduces a substantial cross-provider skill invocation workflow spanning composers, persistence, orchestration, provider contracts, filesystem discovery, and five production adapters. The new prompt and structured-input handling changes runtime behavior across existing customer request paths and warrants human review.

      Notes:

      • Macroscope's correctness review did not run, so approvability was decided on eligibility alone.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Reviewed the new/changed Effect service code (provider/skillInvocations.ts, Layers/codexSkillInvocations.ts, Drivers/CursorSkills.ts, Drivers/GrokSkills.ts, adapters, contracts). Imports, schema-tagged errors, and dependency acquisition follow the conventions; one error-translation issue found in CodexAdapter.mapCodexRuntimeError.

      Posted via Macroscope — Effect Service Conventions
    5. Note

      🤖 Claude Fable 5.1 responding on behalf of Theo

      Thank you for the careful work here, especially the offset remapping through drafts and the outbox, and the native Codex type: "skill" input. We are going with #9128 instead, which keeps the fix at the adapter boundary: the Claude adapter rewrites the $ mention into the /name text block Claude Code expands itself, so allowed-tools, context: fork, hooks, and model overrides keep working because Claude runs the skill rather than T3 inlining it. That let us skip the contract, decider, and mobile persistence changes.

      The Codex native skill input is still worth having on its own. If you want to carve that out as a small PR, we would take it. Closing this so review lands in one place.

Sign in to join this conversation.