[codex] Fix Codex workspace skill autocomplete#2955
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 |
ApprovabilityVerdict: Needs human review This PR introduces new runtime behavior by propagating workspace context ( You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 6c5935d. Configure here.

Summary
Fix Codex
$skillautocomplete for project/worktree-local skills.Root cause
Codex provider status was probed from the server process cwd, so
codex app-server skills/listdid not receive the active project or worktree cwd. Project-local.agents/skillsentries could be parsed by Codex, but T3 Code's provider snapshot did not include them for the active workspace, leaving$create-stand similar skill queries with no matches.Changes
cwdcontext throughserver.refreshProviders, the WebSocket contract, provider registry refreshes, and managed provider snapshots.## Summary Fix Codex$skill` autocomplete for project/worktree-local skills.Root cause
Codex provider status was probed from the server process cwd, so
codex app-server skills/listdid not receive the active project or worktree cwd. Project-local.agents/skillsentries could be parsed by Codex, but T3 Code's provider snapshot did not include them for the active workspace, leaving$create-stand similar skill queries with no matches.Changes
cwdcontext throughserver.refreshProviders, the WebSocket contract, provider registry refreshes, and managed provider snapshots.skill autocomplete has the right skill list.
Related
Related to #2637, but this PR intentionally does not change
/command suggestions or close that issue.Related to #2048, but this PR only wires the cwd consumer for Codex; Claude project skill discovery remains separate.
Builds on the closed stale approach from #2330, with the cwd coming from the active workspace rather than only the server config cwd.
Supersedes draft #2954 with the requested
pabloszx/branch prefix.Validation
mise exec -- pnpm exec vp checkmise exec -- pnpm --filter @t3tools/web exec vp test run --project unit src/components/ChatView.logic.test.tsmise exec -- pnpm exec vp test run apps/server/src/provider/Layers/OpenCodeProvider.test.ts apps/server/src/provider/makeManagedServerProvider.test.ts apps/server/src/provider/Layers/ProviderRegistry.test.ts apps/web/src/localApi.test.tsmise exec -- pnpm exec vp run --filter t3 --filter @t3tools/web --filter @t3tools/contracts typecheckmise exec -- pnpm exec vp run typecheckNote
Fix Codex workspace skill autocomplete by passing workspace
cwdthrough provider refreshcwdso Codex (and OpenCode) status probes run in the correct workspace directory.makeManagedServerProvidernow takescheckProvideras a function receiving optionalProviderSnapshotRefreshInput, and remembers the last refresh input for subsequent background refreshes.ProviderRegistry.refreshandrefreshInstanceaccept and forward the optional input through to the underlying provider drivers.ChatViewcomponent triggers a Codex provider refresh with the active workspacecwdwhen a Codex provider is selected, with a fallback to the default instance if the targeted instance is not found.serverRefreshProvidersWS RPC schema andLocalApi/EnvironmentApicontracts are extended to carry optionalinstanceIdandcwdfields.ServerProviderShape.refreshis now a function that must be called rather than a plainEffect; all callers have been updated.Macroscope summarized 97cd5a8.
Note
Medium Risk
Changes the provider refresh contract and WS/API surfaces across server and web; behavior is well-tested but affects live provider snapshots and multi-instance Codex targeting.
Overview
Fixes Codex
$skillautocomplete for project/worktree-local skills by probing provider status against the active workspace directory instead of the server process cwd.The PR adds optional
cwdon provider refresh (ProviderSnapshotRefreshInput) and threads it through managed snapshots, the provider registry, WebSocketserverRefreshProviders, and local/environment APIs.ServerProvider.refreshandcheckProviderbecome callables that accept that context; managed providers remember an explicit refresh cwd so later background checks keep using the same workspace. Codex (and OpenCode) status probes userefreshInput.cwd ?? serverConfig.cwd.On the web client,
ChatViewrefreshes the active Codex instance when the workspace root (project cwd or thread worktree) changes, usingresolveProviderRefreshTargetto pick the right instance and optionally fall back to the default Codex instance if a custom id is stale. Failed refreshes clear the de-dupe key so retries can run.Tests cover cwd forwarding, registry refresh input, managed-provider context reuse, API forwarding, and refresh target selection.
Reviewed by Cursor Bugbot for commit 97cd5a8. Bugbot is set up for automated code reviews on this repo. Configure here.