Expose project provider skills in chat#3982
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 887c718. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a new feature exposing project-aware provider skills in chat, including new RPC endpoints, skill discovery for Grok/Codex providers, and prompt rewriting logic. The scope and cross-cutting nature of these changes warrants human review. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 917ea83630
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const commandResult = yield* spawnAndCollect( | ||
| binaryPath, | ||
| ChildProcess.make(spawnCommand.command, spawnCommand.args, { | ||
| cwd: input.cwd, | ||
| ...(input.environment ? { env: input.environment } : {}), | ||
| shell: spawnCommand.shell, | ||
| }), | ||
| ).pipe( |
There was a problem hiding this comment.
When grok inspect hangs or is interrupted, this spawn is only attached to whatever ambient Scope happens to be running the RPC/adapter call; GrokDriver.listSkills exposes it as a normal service method and does not create a per-call scope. In that case the 10s timeout can return an error while the child process remains tied to a longer-lived provider/server scope, so repeated $ menu opens or sends with $skill tokens can accumulate stuck grok inspect processes until shutdown. Wrap the spawned spawnAndCollect probe in its own Effect.scoped before applying the timeout.
Useful? React with 👍 / 👎.
| if (input.cachedSkills?.targetKey === input.targetKey) { | ||
| return input.cachedSkills.skills; |
There was a problem hiding this comment.
Avoid serving cached skills after discovery failures
When the current cwd-aware skill query fails (for example, grok inspect exits non-zero), discoveredSkills is null and discoveryUnsupported is false, so this branch still returns the previous successful cache for the same target. That makes the menu offer stale skills while the provider is currently unable to rediscover them; selecting one then sends a $skill token that Grok re-checks at send time and fails, blocking the turn instead of surfacing the discovery failure in the composer.
Useful? React with 👍 / 👎.
| environmentId, | ||
| instanceId: selectedProviderStatus?.instanceId ?? null, | ||
| cwd: gitCwd, | ||
| enabled: composerTriggerKind === "skill", |
There was a problem hiding this comment.
Do not probe skills for env-var tokens
When the user types a shell/env-var token such as $PATH or $NODE_ENV, detectComposerTrigger still marks the token as a skill, so this enables server.listProviderSkills and spawns provider CLI probes even though the Grok send path explicitly filters uppercase env-var-style tokens. In prompts or docs involving env vars, merely placing the cursor after $PATH opens the skill menu and can run grok inspect; gate this query with the same env-var-style check or wait until the token can plausibly be a skill.
Useful? React with 👍 / 👎.

Summary
listSkillscapability, RPC, client query, and composer pipelinegrok --cwd <cwd> inspect --json$skillreferences to Grok native/skillsyntax only at the ACP boundary while retaining$skillin stored and rendered messagesThis supersedes #3901. The replacement generalizes the project-skill feature across Codex and Grok without adding a second filesystem scanner or provider-specific web/RPC paths.
Validation
pnpm exec vp checkpnpm exec vp run typecheck$skillchip storage, and successful native skill execution through ACP$skillregression checkNote
Medium Risk
Touches provider drivers, WebSocket RPC, and Grok turn preparation (child processes, timeouts); Grok prompt rewriting is behavior-changing at the ACP boundary but scoped to recognized skill tokens.
Overview
Adds project-scoped provider skill discovery end-to-end: optional
listSkillson provider instances,server.listProviderSkillsRPC, registry delegation, and a composer path that loads skills when the$menu is open with per-environment/instance/cwd caching and snapshot fallback only when discovery is unsupported.Codex lists skills via an exported
probeCodexAppServerProviderwithincludeModels: falseand auth-probe timeout. Grok addsgrok --cwd <cwd> inspect --jsonparsing (GrokSkillDiscovery) and, on send, rewrites enabled$skilltokens to/skillfor ACP only (skipping env-var-shaped tokens like$PATH); model selection is committed before skill discovery so a discovery failure does not roll back a model switch.The Lexical composer updates skill chip labels in place when metadata refreshes instead of rewriting editor state, avoiding focus loss during in-flight
$probes.collectComposerInlineTokensgainsincludeTrailingSkillTokenfor submitted prompts.Reviewed by Cursor Bugbot for commit 917ea83. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
[!NOTE]
Expose provider skills in the chat composer via a new
server.listProviderSkillsRPC endpointserver.listProviderSkillsWebSocket RPC endpoint that queries provider-specific skills for a given instance and working directory, returning a structured error when unsupported.listSkillson Codex and Grok provider drivers; Grok uses a newlistGrokSkillsutility that runsgrok inspect --jsonwith a 10s timeout.$skilltokens to/skillin Grok prompts when the discovered skill is enabled; all-uppercase tokens are excluded from discovery to avoid treating env vars as skills.Macroscope summarized 917ea83.