Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(codex): discover project skills from workspace #5335

Closedt3-code-bot[bot](GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromt3code/codex-project-skillsopened View on GitHub

summary

  • discover codex skills against the active project or thread worktree
  • feed workspace-scoped skills into $ autocomplete
  • keep the global fallback while excluding repo skills discovered from the server launch directory
  • resolve workspace paths server-side instead of accepting arbitrary client paths

reproduction

  1. launch t3 code outside the target repository
  2. open a project containing .agents/skills/<name>/SKILL.md
  3. select codex and type $
  4. the project skill is now listed

tests

  • pnpm --filter t3 typecheck
  • pnpm --filter @t3tools/contracts typecheck
  • pnpm --filter @t3tools/client-runtime typecheck
  • pnpm --filter @t3tools/web typecheck
  • pnpm --dir apps/server exec vp test run src/server.test.ts -t "server.listProviderSkills"
  • pnpm --dir apps/server exec vp test run src/provider/Layers/ProviderRegistry.test.ts -t "cwd-scoped skill discovery"
  • pnpm lint
  • pnpm fmt:check

Note

Medium Risk New WS RPC and Codex subprocess probes on composer interaction add latency and failure modes; cwd is server-resolved from project/thread shells rather than client paths, which limits path injection risk.

Overview Fixes Codex $ autocomplete when T3 Code is launched outside the target repo by loading skills for the active project or thread worktree instead of only from the server’s launch directory.

Adds server.listProviderSkills (read scope): the server maps projectId / optional threadId to workspaceRoot or worktreePath, then calls provider listSkills(cwd). Codex runs a scoped skills/list probe against that cwd (10s timeout, fallback to cached global skills on failure). Full provider refresh still drops repo-scoped skills from the global snapshot so launch-dir repo skills don’t pollute the default list.

The web composer fetches skills via useProviderSkills when the skill menu is open, with short-lived caching for smoother UX; other providers without listSkills keep using snapshot skills.

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

Note

Discover project skills from workspace via server.listProviderSkills RPC

  • Adds a new server.listProviderSkills websocket RPC that resolves skills scoped to the active workspace root or worktree path, with auth requiring OrchestrationReadScope.
  • Implements listSkills(cwd) on the Codex provider driver in CodexDriver.ts, which spawns a short-lived app-server probe with a 10s timeout and falls back to snapshot skills on failure.
  • Refactors CodexProvider.ts to extract openCodexAppServerProbe as a reusable utility; snapshot skills now exclude repo-scoped entries.
  • The web ChatComposer fetches live provider skills via the new RPC when the skill trigger is active, caching results by environment/instance/project/thread and falling back to snapshot skills filtered to non-repo scope.
  • Risk: the 10s child-process timeout per listSkills call may add latency if the Codex app-server is slow to start.
Macroscope summarized 6df2036.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. One finding on error-log hygiene in the new Codex skill-discovery fallback. Everything else (subpath namespace imports, Effect.fn service methods, whole-channel Effect.catch, contract schemas, added focused tests) matches the conventions.

      Posted via Macroscope — Effect Service Conventions
      @@ -198,3 +204,18 @@
      198204 ),
      199205 );
      200206
      207+ const listSkills = (cwd: string) =>
      208+ listCodexProviderSkills({
      209+ binaryPath: effectiveConfig.binaryPath,
      210+ homePath: effectiveConfig.homePath,
      211+ launchArgs: resolveCodexLaunchArgs(effectiveConfig.launchArgs, processEnv),
      212+ cwd,
      213+ environment: processEnv,
      214+ }).pipe(
      215+ Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
      216+ Effect.scoped,
      217+ Effect.timeout(Duration.seconds(10)),
      218+ Effect.catch((error) =>
      219+ Effect.logWarning("Codex workspace skill discovery failed; using global skills.", {
      220+ cwd,
      221+ error: String(error),
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      String(error) puts arbitrary error text into the log payload — the failure channel here includes CodexAppServerSpawnError, whose message carries the resolved binary/app-server command and underlying spawn output. Consider logging a normalized tag instead (the pattern used by the other provider layers, e.g. errorTag/causeErrorTag from @t3tools/shared/observability), keeping the real error only as cause.

      -              error: String(error),
      +              errorTag: errorTag(error),

      Requires adding import { errorTag } from "@t3tools/shared/observability";.

      Posted via Macroscope — Effect Service Conventions
    3. Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6df2036979302527d81c2165f2d8573f6b14d34b. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -1182,4 +1217,5 @@
      11821217 ]);
      11831218
      11841219 const isComposerMenuLoading =
      1185- composerTriggerKind === "path" && pathTriggerQuery.length > 0 && workspaceEntries.isPending;
      1220+ (composerTriggerKind === "path" && pathTriggerQuery.length > 0 && workspaceEntries.isPending) ||
      1221+ (composerTriggerKind === "skill" && providerSkills.isPending && composerMenuItems.length === 0);

      Incomplete skill menu looks final

      Medium Severity

      The skill autocomplete menu ($) incorrectly shows only global skills as complete while project/repo-specific skills are still loading. This happens because the loading indicator is suppressed when fallback global skills are present, masking the pending state of the skill query.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6df2036979302527d81c2165f2d8573f6b14d34b. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -411,4 +425,6 @@
      411425 models: applyPreferredCodexDefaultModel(
      412426 appendCustomCodexModels(models, input.customModels ?? []),
      413427 ),
      414- skills: parseCodexSkillsListResponse(skillsResponse, input.cwd),
      428+ skills: parseCodexSkillsListResponse(skillsResponse, input.cwd).filter(
      429+ (skill) => skill.scope !== "repo",
      430+ ),

      Repo skill chips lost in timeline

      Medium Severity

      Repo-scoped skills are stripped from the Codex provider snapshot, but the message timeline still renders skill chips only from that snapshot. $repo tokens in history therefore stop turning into skill chips because timeline rendering was not switched to workspace-scoped skill discovery.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6df2036979302527d81c2165f2d8573f6b14d34b. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. Approvability

      Verdict: Needs human review

      This PR introduces a new feature for workspace-scoped skill discovery with new RPC endpoints and frontend integration. Additionally, there are unresolved review comments identifying potential bugs in loading state handling and timeline skill chip rendering that should be addressed.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Does this work for claude project level skills as well?

    6. waiting for this as well :P

    7. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      Closing this because #8778 and #9180 have merged. Codex skill discovery now runs in the selected project or worktree, supplies the composer, and works on mobile. The separate workspace-skill RPC in this PR is no longer needed.

Sign in to join this conversation.