Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add provider skill discovery #1905

Mergedjuliusmarmingemerged 12 commits intomain fromrefs/pull/1905/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Summary

  • Adds provider skill presentation and slash-command discovery so composer UI can surface provider capabilities more directly.
  • Updates server/provider orchestration and Codex app-server plumbing to carry the new skill metadata through session and turn flows.
  • Refactors several effect service tags and ID constructors to the newer ServiceMap/makeUnsafe patterns for consistency.
  • Adjusts CLI publish/package metadata and related tests to match the new build outputs and config behavior.

Testing

  • Not run
  • Existing unit and integration tests were updated alongside the feature changes
  • Full project checks still need to pass: bun fmt, bun lint, bun typecheck, and bun run test

Note

Medium Risk Extends the ServerProvider contract and provider health/probing flows to carry new capability metadata, and updates chat composer parsing/rendering and menu ranking logic; regressions could affect provider snapshots or composer input behavior across clients.

Overview Provider snapshots now include capability metadata: ServerProvider gains slashCommands and skills arrays (with decoding defaults for backward compatibility), and buildServerProvider populates them.

Server-side probing is extended to fill these fields: Claude’s SDK init probe now collects and dedupes slash commands (and caches the combined probe), while Codex switches from account-only probing to probeCodexDiscovery via the app-server JSON-RPC to return both account info and per-CWD skills.

The web composer UI now surfaces provider capabilities: it adds $skill token detection/rendering (Lexical ComposerSkillNode chips with tooltip descriptions), expands slash-command completion to include provider commands, adds skill search/completion, and refactors menu highlighting + ranking using a new shared searchRanking utility (also reused for workspace entry ranking). Tests and fixtures are updated accordingly.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 016dbfd0de7129d8ebfbb7b5b4e6acbebbd9d648. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add provider skill discovery and skill/slash-command support in the composer

  • Adds ServerProviderSkill and ServerProviderSlashCommand schemas to the contracts layer; both default to empty arrays when decoding legacy snapshots.
  • Probes the Codex provider via a new probeCodexDiscovery API to return discovered skills alongside account info, and parses Claude Agent SDK initialization commands into normalized slash commands.
  • Introduces a ComposerSkillNode Lexical node that renders inline skill chips with tooltips, and extends splitPromptTextIntoComposerSegments to parse $<name> tokens as skill segments.
  • Extends the composer command menu to show ranked, grouped results for both provider slash commands and skills, with correct /<command> and $<skill> insertion on selection.
  • Extracts a shared searchRanking package (scoreQueryMatch, insertRankedSearchResult, etc.) used by workspace entry search, skill search, and slash command search.
  • Risk: ComposerPromptEditor now requires a skills prop; any caller that does not pass it will get a type error.
Macroscope summarized 016dbfd.
    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

      Run ID: 1385ec2d-bc74-4b7b-b23e-c104f25cb89c

      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
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `t3code/server-provider-skills`

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

    3. Cursor Bugbot has reviewed your changes and found 2 potential issues.

      Autofix Details

      Bugbot Autofix prepared fixes for both issues found in the latest run.

      • ✅ Fixed: Ref assignments moved to useEffect cause stale reads
        • Moved the three ref assignments (composerMenuOpenRef, composerMenuItemsRef, activeComposerMenuItemRef) back to synchronous render phase by removing the useEffect wrapper, ensuring event handlers always read current values.
      • ✅ Fixed: Exported probeCodexAccount function is now unused
        • Removed the dead probeCodexAccount function from codexAppServer.ts since it has no remaining imports anywhere in the codebase.

      Create PR

      Or push these changes by commenting:

      @cursor push 2d23dae3cc
      Preview (pingdotgg/t3code@2d23dae3cc)
      diff --git a/apps/server/src/provider/codexAppServer.ts b/apps/server/src/provider/codexAppServer.ts
      --- a/apps/server/src/provider/codexAppServer.ts
      +++ b/apps/server/src/provider/codexAppServer.ts
      @@ -244,16 +244,3 @@
           });
         });
       }
      -
      -export async function probeCodexAccount(input: {
      -  readonly binaryPath: string;
      -  readonly homePath?: string;
      -  readonly signal?: AbortSignal;
      -}): Promise<CodexAccountSnapshot> {
      -  return (
      -    await probeCodexDiscovery({
      -      ...input,
      -      cwd: process.cwd(),
      -    })
      -  ).account;
      -}
      
      diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx
      --- a/apps/web/src/components/chat/ChatComposer.tsx
      +++ b/apps/web/src/components/chat/ChatComposer.tsx
      @@ -820,11 +820,9 @@
             [composerHighlightedItemId, composerMenuItems],
           );
       
      -    useEffect(() => {
      -      composerMenuOpenRef.current = composerMenuOpen;
      -      composerMenuItemsRef.current = composerMenuItems;
      -      activeComposerMenuItemRef.current = activeComposerMenuItem;
      -    }, [activeComposerMenuItem, composerMenuItems, composerMenuOpen]);
      +    composerMenuOpenRef.current = composerMenuOpen;
      +    composerMenuItemsRef.current = composerMenuItems;
      +    activeComposerMenuItemRef.current = activeComposerMenuItem;
       
           const nonPersistedComposerImageIdSet = useMemo(
             () => new Set(nonPersistedComposerImageIds),
      You can send follow-ups to the cloud agent here.
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces a significant new feature: provider skill and slash command discovery. It adds new user-facing capabilities including skill autocomplete via $ syntax, skill pills in the composer, provider slash commands in the command menu, and supporting search/ranking infrastructure. New features of this scope warrant human review to validate the design and integration.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      There are 3 total unresolved issues (including 2 from previous reviews).

      Autofix Details

      Bugbot Autofix prepared a fix for the issue found in the latest run.

      • ✅ Fixed: skills/list failure rejects entire account probe
        • Changed the skills/list error handler to gracefully fall back to an empty skills array instead of calling fail(), so account probing remains resilient when skills/list is unsupported or errors.

      Create PR

      Or push these changes by commenting:

      @cursor push 26dfbbe0ac
      Preview (pingdotgg/t3code@26dfbbe0ac)
      diff --git a/apps/server/src/provider/codexAppServer.ts b/apps/server/src/provider/codexAppServer.ts
      --- a/apps/server/src/provider/codexAppServer.ts
      +++ b/apps/server/src/provider/codexAppServer.ts
      @@ -205,12 +205,7 @@
       
             if (response.id === 2) {
               const errorMessage = readErrorMessage(response);
      -        if (errorMessage) {
      -          fail(new Error(`skills/list failed: ${errorMessage}`));
      -          return;
      -        }
      -
      -        skills = parseCodexSkillsResult(response.result, input.cwd);
      +        skills = errorMessage ? [] : parseCodexSkillsResult(response.result, input.cwd);
               maybeResolve();
               return;
             }
      You can send follow-ups to the cloud agent here.
    6. @cursor push 26dfbbe0ac

    7. juliusmarminge changed the title

    8. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Autofix Details

      Bugbot Autofix prepared a fix for the issue found in the latest run.

      • ✅ Fixed: Inconsistent field lookup for displayName vs shortDescription
        • Updated displayName lookup to check skill?.displayName first, falling back to display?.displayName, matching the same pattern used for shortDescription.

      Create PR

      Or push these changes by commenting:

      @cursor push 6b028d659a
      Preview (pingdotgg/t3code@6b028d659a)
      diff --git a/apps/server/src/provider/codexAppServer.ts b/apps/server/src/provider/codexAppServer.ts
      --- a/apps/server/src/provider/codexAppServer.ts
      +++ b/apps/server/src/provider/codexAppServer.ts
      @@ -64,8 +64,11 @@
                 ? { description: nonEmptyTrimmed(skill?.description) }
                 : {}),
               ...(nonEmptyTrimmed(skill?.scope) ? { scope: nonEmptyTrimmed(skill?.scope) } : {}),
      -        ...(nonEmptyTrimmed(display?.displayName)
      -          ? { displayName: nonEmptyTrimmed(display?.displayName) }
      +        ...(nonEmptyTrimmed(skill?.displayName) || nonEmptyTrimmed(display?.displayName)
      +          ? {
      +              displayName:
      +                nonEmptyTrimmed(skill?.displayName) ?? nonEmptyTrimmed(display?.displayName),
      +            }
                 : {}),
               ...(nonEmptyTrimmed(skill?.shortDescription) || nonEmptyTrimmed(display?.shortDescription)
                 ? {
      You can send follow-ups to the cloud agent here.
      apps/server/src/provider/codexAppServer.ts line 76Resolvedby juliusmarminge
    9. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Autofix Details

      Bugbot Autofix prepared a fix for the issue found in the latest run.

      • ✅ Fixed: Callback recreated on every keystroke causing unnecessary re-renders
        • Replaced the prompt state variable with promptRef.current in the setPromptFromTraits callback and removed prompt from the dependency array, restoring the stable ref-based pattern that prevents callback recreation on every keystroke.

      Create PR

      Or push these changes by commenting:

      @cursor push aadef2980e
      Preview (pingdotgg/t3code@aadef2980e)
      diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx
      --- a/apps/web/src/components/chat/ChatComposer.tsx
      +++ b/apps/web/src/components/chat/ChatComposer.tsx
      @@ -868,7 +868,8 @@
           // ------------------------------------------------------------------
           const setPromptFromTraits = useCallback(
             (nextPrompt: string) => {
      -        if (nextPrompt === prompt) {
      +        const currentPrompt = promptRef.current;
      +        if (nextPrompt === currentPrompt) {
                 scheduleComposerFocus();
                 return;
               }
      @@ -879,7 +880,7 @@
               setComposerTrigger(detectComposerTrigger(nextPrompt, nextPrompt.length));
               scheduleComposerFocus();
             },
      -      [composerDraftTarget, prompt, promptRef, scheduleComposerFocus, setComposerDraftPrompt],
      +      [composerDraftTarget, promptRef, scheduleComposerFocus, setComposerDraftPrompt],
           );
       
           const providerTraitsMenuContent = renderProviderTraitsMenuContent({
      You can send follow-ups to the cloud agent here.
    10. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Fix All in Cursor

      Bugbot Autofix prepared a fix for the issue found in the latest run.

      • ✅ Fixed: Double-lowercasing in shared scoring utility is redundant
        • Removed the redundant .trim().toLowerCase() calls inside scoreQueryMatch since all callers already pass pre-normalized inputs, replacing them with a direct destructure and a JSDoc contract documenting the pre-normalization requirement.

      Create PR

      Or push these changes by commenting:

      @cursor push 20f5a4b15c
      Preview (pingdotgg/t3code@20f5a4b15c)
      diff --git a/packages/shared/src/searchRanking.ts b/packages/shared/src/searchRanking.ts
      --- a/packages/shared/src/searchRanking.ts
      +++ b/packages/shared/src/searchRanking.ts
      @@ -77,6 +77,12 @@
         return bestIndex;
       }
       
      +/**
      + * Scores how well `value` matches `query` using tiered match strategies.
      + *
      + * **Expects pre-normalized inputs**: both `value` and `query` must already be
      + * trimmed and lowercased (e.g. via {@link normalizeSearchQuery}).
      + */
       export function scoreQueryMatch(input: {
         value: string;
         query: string;
      @@ -87,8 +93,7 @@
         fuzzyBase?: number;
         boundaryMarkers?: readonly string[];
       }): number | null {
      -  const value = input.value.trim().toLowerCase();
      -  const query = input.query.trim().toLowerCase();
      +  const { value, query } = input;
       
         if (!value || !query) {
           return null;
      You can send follow-ups to the cloud agent here. Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b0488e2c2eee8183bf2ec6d0aa6dde4d03a66348. Configure [here](https://www.cursor.com/dashboard/bugbot).
    11. juliusmarminge changed the title

    12. @cursor push 20f5a4b15c

    13. juliusmarminge merged this58e5f71

    14. juliusmarminge closed this

Sign in to join this conversation.