Repository navigation
fix(codex): list skills by name when skills_read can load them - #206995
Conversation
- Render the Codex skills catalog through the core owner compactCatalogForSkillRead, as the embedded route does: names only when skills_search is callable, names plus descriptions otherwise. - Locations go when skills_read resolves by name, so the Gateway-only location rewrite now runs only when skills_read is unavailable. - The full catalog was 9.5 KB of the 13.8 KB <thread_policy> sent on every Codex request.
…able - Read-enabled remote catalogs drop paths and the Gateway-only note; the no-read fallback keeps them.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesThe Codex plugin reuses core skill-catalog compaction according to whether skills_read and skills_search are available. Example: Codex has skills_read and skills_search available and an installed release-guide skill.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a useful, focused improvement that current main still lacks; no introduced correctness defect was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Codex adapter combines the prepared skill catalog with callable tool names to produce developer instructions sent to the native app-server. flowchart TD
A[Prepared skill catalog] --> C[Codex instruction renderer]
B[Callable dynamic tools] --> C
C --> D[Shared catalog compactor]
D --> E[Native thread instructions]
E --> F[Codex model]
F --> G[Host skill tools]
Technical reviewBest possible solution: Use the existing core compactor in the Codex renderer while preserving capability-dependent descriptions and no-read location handling. Do we have a high-confidence way to reproduce the issue? Source inspection establishes that current main retains full skill metadata in Codex instructions even when host skill tools can supply it on demand; no runtime reproduction was executed. Is this the best way to solve the issue? Reusing the established compactor is the smallest complete change and avoids the parallel parser and unconditional loading assumptions in the earlier proposal. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 519d22d2ca15. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests +24. Total +27 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 27, 2026, 6:14 PM ET / 23:14 UTC. |
…lot (#207061) ## Problem - `AgentHarnessSideQuestionRequest` was published in the Plugin SDK (#205963) only so the bundled Copilot plugin could name its side-question request. It has no other consumer. - Main's SDK budget check is red: #206995 added `compactCatalogForSkillRead` to `agent-harness-runtime` (consumer: bundled Codex harness) without a budget line. ## Change - Copilot declares its own `CopilotSideQuestionRequest`, the same four fields. The SDK export is removed. - Budgets: public −1 (the type) +1 (`compactCatalogForSkillRead`) = 3932, unchanged. Callable +1 = 2260, recorded with a budget line like `hasReplyRestartResume`. ## User impact None. The type is structural, so Copilot side questions send the same request. ## Evidence - ClawHub `sdk-export:openclaw/plugin-sdk/agent-harness-runtime#AgentHarnessSideQuestionRequest`: 0 public consumers (2338 complete / 432 partial / 3 failed coverage). The only bundled consumer is Copilot, migrated here. The export is in no released tag. - `pnpm plugin-sdk:surface:check`: pass (`no unauthorized removals`). `tsgo:extensions`: clean. - Copilot `side-question.test.ts`, `isolated-completion.*.test.ts`: 8/8 pass. - Adversarial review (Fable): no finding. The local type assigns both ways to the host's `prepareRequest`. Co-authored-by: Ayaan Zaidi <[email protected]>
## Problem #206995 added a Plugin SDK export without a surface budget line and merged with green PR CI. Main's SDK surface check then failed (`public exports 3933 > 3932`, `public callable exports 2260 > 2259`) until a follow-up added the line. Why PR CI did not catch it: - `check:changed` selects `plugin-sdk:check-exports` and `plugin-sdk:surface:check` for SDK paths. But PR CI calls it lint-only (`ci.yml`, "Run changed lint", `lintOnly: true`), so only lint commands run. - The only other runner is the `generated-doc-baselines` job in `workflow-sanity.yml`. It runs only on `workflow_dispatch`, never on a pull request. ## Fix The baseline-ratchets job (`scripts/ci-baseline-ratchets.mts`) already runs on every node PR. It now also runs `plugin-sdk:check-exports` and `plugin-sdk:surface:check` on every run: - The surface check is a large TypeScript program, so it runs in the same slot as the database-worker and database-dialect snapshots. They run one after another and never overlap (the memory rule from `c695d653`). The export check is light and joins the shared queue. - It runs on every PR, not only SDK-path PRs: the SDK import closure reaches far outside `src/plugin-sdk`. For example, adding `@deprecated` to `src/channels/chat-type.ts` moves the deprecated-export count, and no changed-path rule sees that. No new workflow or job. ## Impact Contributors: a PR that changes the SDK export surface without its budget line now fails `checks-fast-baseline-ratchets` instead of turning main red after merge. Cost per PR: one surface check (about 7 s and 3.5 GB peak locally) in the existing job. ## Evidence - Red/green on a PR-like change set: a scratch copy of main with #206995's export added on top of a tagged base, run with `pnpm check:baseline-ratchets --base <base> --no-merge-base`: - a new SDK function without a budget line: `plugin-sdk-surface` fails, `public exports 3933 > 3932`, `public callable exports 2261 > 2260`, exit 1; - the same change plus the budget lines: `[ok] plugin-sdk-exports`, `[ok] plugin-sdk-surface`, exit 0. - `test/scripts/ci-baseline-ratchets.test.ts`: the expected command list now includes both SDK checks in their slots (4/4). - Adversarial review: a first version selected the checks by changed path. The review showed that version missed real budget inputs outside `src/plugin-sdk` and reproduced a miss. This version drops path selection. - Local review on this head: patch is correct, 0 findings. - CI cost on this PR's runner: `plugin-sdk-surface` 8.48 s and `plugin-sdk-exports` 0.28 s inside `checks-fast-baseline-ratchets`, which took 4m50s in total. Co-authored-by: Ayaan Zaidi <[email protected]>
…law#206995) ## Problem The Codex runtime sends a 13.8 KB `<thread_policy>` developer message on every request. 9.5 KB of it is the full `<available_skills>` catalog: name, description and file location for every installed skill. The embedded runtime stopped doing this in openclaw#206537. When `skills_read` loads a skill by name, the location is unused. When `skills_search` is callable, it matches descriptions on demand. The Codex plugin renders its own catalog section and kept the full form. Measured on main `a62d6b8eff91` through an isolated Gateway: `<thread_policy>` 13,801 B, of which `<available_skills>` 9,469 B. ## Solution `renderCodexSkillsInstructions` (`extensions/codex/src/app-server/attempt-context.ts`) passes the catalog through the core owner `compactCatalogForSkillRead`, as the embedded route does: - `skills_read` and `skills_search` callable: names only; - only `skills_read` callable: names and descriptions; - `skills_read` not callable: unchanged XML with locations. The Gateway-only location rewrite still runs for remote workspaces. `compactCatalogForSkillRead` is added to `openclaw/plugin-sdk/agent-harness-runtime`, next to the other harness prompt builders. ## User impact - Population: every Codex-runtime turn with installed skills (Gateway and one-shot). - `<thread_policy>`: 13,801 → 4,511 B per request (−9,290 B). - No change to which skills exist or how they load. - Existing threads see the changed instructions on their next cold resume: one prompt-cache miss per thread. ## Evidence - Isolated Gateway bench, fake provider: `<thread_policy>` 13,801 → 4,511 B; tool schemas unchanged. - Codex-route behavior suite, gpt-5.4-mini, 3 trials per case, model-judged: - main 24/30, this PR 26/30; - skill loading 3/3 on both, through the same path (`skills_read` first in 6 of 6 trials, no extra tool search); - reply-directive 0/3 on both: an existing Codex-route gap, not caused here. - Tests: `dynamic-tool-skills.test.ts`, `run-attempt.remote-skills.test.ts` and `run-attempt.skills.native.test.ts` pass. `plugin-sdk:check-exports` passes. - Local ClawSweeper on this head: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
…lot (openclaw#207061) ## Problem - `AgentHarnessSideQuestionRequest` was published in the Plugin SDK (openclaw#205963) only so the bundled Copilot plugin could name its side-question request. It has no other consumer. - Main's SDK budget check is red: openclaw#206995 added `compactCatalogForSkillRead` to `agent-harness-runtime` (consumer: bundled Codex harness) without a budget line. ## Change - Copilot declares its own `CopilotSideQuestionRequest`, the same four fields. The SDK export is removed. - Budgets: public −1 (the type) +1 (`compactCatalogForSkillRead`) = 3932, unchanged. Callable +1 = 2260, recorded with a budget line like `hasReplyRestartResume`. ## User impact None. The type is structural, so Copilot side questions send the same request. ## Evidence - ClawHub `sdk-export:openclaw/plugin-sdk/agent-harness-runtime#AgentHarnessSideQuestionRequest`: 0 public consumers (2338 complete / 432 partial / 3 failed coverage). The only bundled consumer is Copilot, migrated here. The export is in no released tag. - `pnpm plugin-sdk:surface:check`: pass (`no unauthorized removals`). `tsgo:extensions`: clean. - Copilot `side-question.test.ts`, `isolated-completion.*.test.ts`: 8/8 pass. - Adversarial review (Fable): no finding. The local type assigns both ways to the host's `prepareRequest`. Co-authored-by: Ayaan Zaidi <[email protected]>
…aw#207167) ## Problem openclaw#206995 added a Plugin SDK export without a surface budget line and merged with green PR CI. Main's SDK surface check then failed (`public exports 3933 > 3932`, `public callable exports 2260 > 2259`) until a follow-up added the line. Why PR CI did not catch it: - `check:changed` selects `plugin-sdk:check-exports` and `plugin-sdk:surface:check` for SDK paths. But PR CI calls it lint-only (`ci.yml`, "Run changed lint", `lintOnly: true`), so only lint commands run. - The only other runner is the `generated-doc-baselines` job in `workflow-sanity.yml`. It runs only on `workflow_dispatch`, never on a pull request. ## Fix The baseline-ratchets job (`scripts/ci-baseline-ratchets.mts`) already runs on every node PR. It now also runs `plugin-sdk:check-exports` and `plugin-sdk:surface:check` on every run: - The surface check is a large TypeScript program, so it runs in the same slot as the database-worker and database-dialect snapshots. They run one after another and never overlap (the memory rule from `4d6287da`). The export check is light and joins the shared queue. - It runs on every PR, not only SDK-path PRs: the SDK import closure reaches far outside `src/plugin-sdk`. For example, adding `@deprecated` to `src/channels/chat-type.ts` moves the deprecated-export count, and no changed-path rule sees that. No new workflow or job. ## Impact Contributors: a PR that changes the SDK export surface without its budget line now fails `checks-fast-baseline-ratchets` instead of turning main red after merge. Cost per PR: one surface check (about 7 s and 3.5 GB peak locally) in the existing job. ## Evidence - Red/green on a PR-like change set: a scratch copy of main with openclaw#206995's export added on top of a tagged base, run with `pnpm check:baseline-ratchets --base <base> --no-merge-base`: - a new SDK function without a budget line: `plugin-sdk-surface` fails, `public exports 3933 > 3932`, `public callable exports 2261 > 2260`, exit 1; - the same change plus the budget lines: `[ok] plugin-sdk-exports`, `[ok] plugin-sdk-surface`, exit 0. - `test/scripts/ci-baseline-ratchets.test.ts`: the expected command list now includes both SDK checks in their slots (4/4). - Adversarial review: a first version selected the checks by changed path. The review showed that version missed real budget inputs outside `src/plugin-sdk` and reproduced a miss. This version drops path selection. - Local review on this head: patch is correct, 0 findings. - CI cost on this PR's runner: `plugin-sdk-surface` 8.48 s and `plugin-sdk-exports` 0.28 s inside `checks-fast-baseline-ratchets`, which took 4m50s in total. Co-authored-by: Ayaan Zaidi <[email protected]>
## Problem #206995 added a Plugin SDK export without a surface budget line and merged with green PR CI. Main's SDK surface check then failed (`public exports 3933 > 3932`, `public callable exports 2260 > 2259`) until a follow-up added the line. Why PR CI did not catch it: - `check:changed` selects `plugin-sdk:check-exports` and `plugin-sdk:surface:check` for SDK paths. But PR CI calls it lint-only (`ci.yml`, "Run changed lint", `lintOnly: true`), so only lint commands run. - The only other runner is the `generated-doc-baselines` job in `workflow-sanity.yml`. It runs only on `workflow_dispatch`, never on a pull request. ## Fix The baseline-ratchets job (`scripts/ci-baseline-ratchets.mts`) already runs on every node PR. It now also runs `plugin-sdk:check-exports` and `plugin-sdk:surface:check` on every run: - The surface check is a large TypeScript program, so it runs in the same slot as the database-worker and database-dialect snapshots. They run one after another and never overlap (the memory rule from `c695d653`). The export check is light and joins the shared queue. - It runs on every PR, not only SDK-path PRs: the SDK import closure reaches far outside `src/plugin-sdk`. For example, adding `@deprecated` to `src/channels/chat-type.ts` moves the deprecated-export count, and no changed-path rule sees that. No new workflow or job. ## Impact Contributors: a PR that changes the SDK export surface without its budget line now fails `checks-fast-baseline-ratchets` instead of turning main red after merge. Cost per PR: one surface check (about 7 s and 3.5 GB peak locally) in the existing job. ## Evidence - Red/green on a PR-like change set: a scratch copy of main with #206995's export added on top of a tagged base, run with `pnpm check:baseline-ratchets --base <base> --no-merge-base`: - a new SDK function without a budget line: `plugin-sdk-surface` fails, `public exports 3933 > 3932`, `public callable exports 2261 > 2260`, exit 1; - the same change plus the budget lines: `[ok] plugin-sdk-exports`, `[ok] plugin-sdk-surface`, exit 0. - `test/scripts/ci-baseline-ratchets.test.ts`: the expected command list now includes both SDK checks in their slots (4/4). - Adversarial review: a first version selected the checks by changed path. The review showed that version missed real budget inputs outside `src/plugin-sdk` and reproduced a miss. This version drops path selection. - Local review on this head: patch is correct, 0 findings. - CI cost on this PR's runner: `plugin-sdk-surface` 8.48 s and `plugin-sdk-exports` 0.28 s inside `checks-fast-baseline-ratchets`, which took 4m50s in total. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 7c16b31) Release adaptation: Add both existing SDK checks without overlapping the large SDK surface check with either large database check. Follow-up audit: No required nonselected PR/SHA follow-up. Other same-path candidates (9c9e3c7) are not selected prerequisites in the source assessment; owner proof below checks the selected stable contract. Co-authored-by: RomneyDa <[email protected]>
Problem
The Codex runtime sends a 13.8 KB
<thread_policy>developer message on every request. 9.5 KB of it is the full<available_skills>catalog: name, description and file location for every installed skill.The embedded runtime stopped doing this in #206537. When
skills_readloads a skill by name, the location is unused. Whenskills_searchis callable, it matches descriptions on demand. The Codex plugin renders its own catalog section and kept the full form.Measured on main
e916ef677a95through an isolated Gateway:<thread_policy>13,801 B, of which<available_skills>9,469 B.Solution
renderCodexSkillsInstructions(extensions/codex/src/app-server/attempt-context.ts) passes the catalog through the core ownercompactCatalogForSkillRead, as the embedded route does:skills_readandskills_searchcallable: names only;skills_readcallable: names and descriptions;skills_readnot callable: unchanged XML with locations. The Gateway-only location rewrite still runs for remote workspaces.compactCatalogForSkillReadis added toopenclaw/plugin-sdk/agent-harness-runtime, next to the other harness prompt builders.User impact
<thread_policy>: 13,801 → 4,511 B per request (−9,290 B).Evidence
<thread_policy>13,801 → 4,511 B; tool schemas unchanged.skills_readfirst in 6 of 6 trials, no extra tool search);dynamic-tool-skills.test.ts,run-attempt.remote-skills.test.tsandrun-attempt.skills.native.test.tspass.plugin-sdk:check-exportspasses.