-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix workspace-scoped Codex skill discovery #3059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Quicksaver
wants to merge
91
commits into
pingdotgg:main
Choose a base branch
from
Quicksaver:fix/codex-skills
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 83 commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
68ddf72
Add provider skill listing to workspace
Quicksaver ace7991
Address CodeRabbit review comments
Quicksaver 5bc3d6e
Fix disabled Codex skill listing
Quicksaver c34dff3
Fix Codex skill listing refresh and validation
Quicksaver 1a1547f
Fix workspace skill refresh state
Quicksaver b38045b
Remove test skill file
Quicksaver 6acc264
Fix workspace-scoped Codex skill loading
Quicksaver 5b4e534
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 8f06032
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 00cebad
Bound workspace skill discovery requests
juliusmarminge 5c37b87
Preserve workspace skills during refresh
Quicksaver 05e81b6
Harden provider workspace skill cache
Quicksaver 307486b
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 22f37d0
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver e5496d6
Cover provider skill discovery failures
juliusmarminge f980381
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver be22f74
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver a5fb01d
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 1654062
Stabilize provider skills error messages
Quicksaver f75f6cd
Port provider skills diagnostic details
Quicksaver bd73e93
Show workspace skill chips in chat messages
Quicksaver 3199949
Load workspace skills lazily in composer
Quicksaver 3464e42
Restore provider skills failure reason contract
Quicksaver 3e2be11
Add provider skills error cause sanitizer
Quicksaver 973cb5c
Fix provider skills namespace imports
Quicksaver 89984e1
Fix provider skill typecheck fallout
Quicksaver 661a9f3
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver ebe1625
Normalize provider skills error cwd
Quicksaver 8d076f1
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 46a1603
Refactor route-layer dependency options in ws
Quicksaver 8f2dd72
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver c748279
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 2dc022d
Merge upstream timeline scroll updates
Quicksaver 2bd42cd
Fix timeline live-follow cancellation
Quicksaver f5930d6
Retry timeline scroll listener setup
Quicksaver 71a2a69
Fix timeline scroll listener and anchor cleanup
Quicksaver 67a43b9
Fix timeline listener retry exhaustion
Quicksaver 1bc887b
Fix exhausted timeline anchor state
Quicksaver c8c8dee
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 8bd26b0
Align workspace paths import in provider skills lister
Quicksaver 5a12942
Merge upstream and preserve Codex skill fixes
Quicksaver 34def14
Remove codex skill branch pollution
Quicksaver 4350f99
Merge upstream mobile tasks and Vite Plus updates
Quicksaver e84b0fb
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 5e9d607
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 0b571ea
Hide publish-only links from Connect discovery
Quicksaver 33581b8
Harden relay activity delivery maintenance
Quicksaver 0b5087f
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver bc17d95
Share workspace-aware provider skills with mobile
Quicksaver 3c78e6c
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 57fc6cf
Surface workspace skill errors with fallbacks
Quicksaver ba9b5fb
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver fa0563c
Remove remaining codex skills branch pollution
Quicksaver 0f8bc68
Add Codex skill loading branch details
Quicksaver 6b04a4c
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver aa42013
Gate timeline skill loading on sent skill references
Quicksaver 2183032
Recognize trailing skills in timeline loading
Quicksaver b1af7c3
Improve timeline skill reference detection
Quicksaver 345368c
Unify sent skill token boundaries
Quicksaver 78833da
Update mobile markdown lockfile dependencies
Quicksaver edda975
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver bbb0343
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver fe0480b
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 823202b
Enable pnpm global virtual store
Quicksaver b832625
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 58d8eca
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 5798b81
Stop fallback changes from refreshing skill probes
Quicksaver 6d09f51
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 55b7c23
Fix Codex skill probe and refresh state
Quicksaver eb0650d
Document pending workspace skill isolation
Quicksaver a973e27
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver a9b4a6a
Avoid probing skills for future worktrees
Quicksaver f28ce81
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver c39f371
Handle workspace skills while disconnected
Quicksaver 3c596ca
Document disconnected workspace skill behavior
Quicksaver a8b5e55
Preserve empty disconnected skill snapshots
Quicksaver 52e5cf9
Preserve skills across inactive lookups
Quicksaver 1ea2f67
Keep disconnected empty-skill fallback
Quicksaver 557ffd2
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 495faf3
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 82db6f7
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 1ba5414
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver bdeb801
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 59e3a0b
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 8b52e81
Fix mobile workspace skill state handling
Quicksaver 62f938b
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver c2c47b7
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 52d776c
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver bb00f1d
Retry failed provider skill lookups immediately
Quicksaver 8107df0
Merge remote-tracking branch 'upstream/main' into fix/codex-skills
Quicksaver 9388e7f
Make mobile thread skill lookup lazy
Quicksaver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # Codex Workspace Skill Loading | ||
|
|
||
| Fix Codex repo-local skill discovery in the composer by resolving skills for the active project/worktree cwd, instead of relying on the global provider status snapshot. | ||
|
|
||
| Expected behavior: | ||
|
|
||
| - Repo-local Codex skills for the active workspace appear in the `$` skill picker. | ||
| - The server exposes a workspace-aware `server.listProviderSkills` path and validates enabled Codex skill-listing requests against the requested cwd. | ||
| - The server routes skill listing through a bounded request lister that coalesces concurrent requests for the same provider/cwd, limits cross-workspace concurrency, and applies a short TTL so reconnects or repeated composer renders do not repeatedly spawn Codex app-server probes. | ||
| - The Codex provider requests `skills/list` with the current workspace cwd, times out hung app-server probes, and terminates the probe process when a timeout occurs. | ||
| - Provider skill-list failures preserve structured reason, operation, provider instance, normalized cwd, and bounded cause diagnostics for missing providers, invalid cwd, settings failures, Codex home preparation, probe timeouts, and probe failures while keeping stable user-facing messages. Raw thrown values are not sent directly to clients; the server keeps a small plain diagnostic shape so file paths, process output, and unexpected objects do not expand the wire payload. | ||
| - Non-Codex or disabled providers keep returning provider snapshot skills instead of failing workspace skill search. | ||
| - The client runtime keys provider-skill query state by environment, provider instance, and cwd, with a bounded stale window so reconnects refresh workspace-local skills without reusing another workspace's snapshot. Client-side fallback skill changes do not refresh the workspace query or respawn Codex skill probes. | ||
| - Web workspace-skill lookup follows the route environment's connection state. While disconnected, it does not start an RPC, retains only verified skills for the same environment/provider/cwd across lazy menu close/reopen cycles, otherwise falls back to provider snapshot skills with a non-pending reconnect error, and resumes the workspace refresh when the environment reconnects. | ||
| - The composer loads workspace skills lazily: it starts workspace skill discovery when the `$` skill menu is active or the prompt already contains a complete `$skill` token, rather than probing on every empty composer mount. It preserves already loaded repo-local skills while refreshing the same workspace, falls back to provider snapshot skills when a settled workspace lookup returns no skills or errors, keeps structured lookup errors visible alongside those fallback skills on web and mobile, and clears stale repo-local skills during workspace switches or settled no-data states. | ||
| - The conversation timeline renders sent user prompts against the same workspace-aware skill list as the composer, so repo-local `$skill-name` references display with the same skill chip treatment as user-level skills. Timeline lookup stays disabled until a sent user prompt contains a complete skill token, including one at the end of the message, so an empty draft does not probe Codex merely to decorate nonexistent messages. | ||
| - The shared client-runtime policy also drives mobile thread composers and feeds. Mobile shows loading and structured error feedback, refreshes an already-open `$` menu when skills arrive, decorates complete skill references, and prevents stale successful results from surviving a failed refresh. | ||
| - New-task drafts request workspace skills lazily only after a complete `$skill` reference. Local drafts resolve the selected checkout or project root, while future-worktree drafts deliberately have no cwd and use provider snapshots until the target directory exists. | ||
|
|
||
| Primary files: | ||
|
|
||
| - `apps/server/src/ws.ts` | ||
| - `apps/server/src/provider/ProviderSkillsLister.ts` | ||
| - `apps/server/src/provider/Layers/CodexProvider.ts` | ||
| - `apps/web/src/components/ChatView.tsx` | ||
| - `apps/web/src/components/chat/ChatComposer.tsx` | ||
| - `apps/web/src/components/chat/MessagesTimeline.tsx` | ||
| - `apps/web/src/lib/providerWorkspaceSkillsState.ts` | ||
| - `apps/mobile/src/state/providerWorkspaceSkillsState.ts` | ||
| - `apps/mobile/src/features/threads/new-task-provider-skills.ts` | ||
| - `apps/mobile/src/features/threads/thread-composer-skill-items.ts` | ||
| - `packages/client-runtime/src/state/providerWorkspaceSkills.ts` | ||
| - `packages/contracts/src/server.ts` | ||
| - `packages/client-runtime/src/state/server.ts` | ||
|
|
||
| Relevant tests live in: | ||
|
|
||
| - `apps/server/src/server.test.ts` | ||
| - `apps/server/src/provider/ProviderSkillsLister.test.ts` | ||
| - `apps/server/src/provider/Layers/CodexProvider.test.ts` | ||
| - `apps/server/src/provider/Layers/CursorProvider.test.ts` | ||
| - `apps/server/src/provider/Layers/GrokProvider.test.ts` | ||
| - `apps/web/src/components/chat/MessagesTimeline.test.tsx` | ||
| - `apps/web/src/lib/providerWorkspaceSkillsState.test.ts` | ||
| - `apps/mobile/src/features/threads/new-task-provider-skills.test.ts` | ||
| - `apps/mobile/src/features/threads/thread-composer-skill-items.test.ts` | ||
| - `packages/client-runtime/src/state/providerWorkspaceSkills.test.ts` | ||
| - `packages/client-runtime/src/state/runtime.test.ts` | ||
|
|
||
| Useful focused commands: | ||
|
|
||
| ```sh | ||
| (cd apps/server && pnpm exec vp test run --passWithNoTests src/provider/ProviderSkillsLister.test.ts src/provider/Layers/CodexProvider.test.ts src/provider/Layers/CursorProvider.test.ts src/provider/Layers/GrokProvider.test.ts) | ||
| (cd apps/web && pnpm exec vp test run --passWithNoTests --project unit src/lib/providerWorkspaceSkillsState.test.ts) | ||
| (cd apps/mobile && pnpm exec vp test run --passWithNoTests src/features/threads/new-task-provider-skills.test.ts src/features/threads/thread-composer-skill-items.test.ts) | ||
| (cd packages/client-runtime && pnpm exec vp test run --passWithNoTests src/state/providerWorkspaceSkills.test.ts) | ||
| ``` | ||
|
|
||
| ## Development Ports | ||
|
|
||
| - Web: `5735` | ||
| - Server/WebSocket: `13775` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.