Repository navigation
feat(codex): pass explicit skill selections as structured turn input - #123441
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Thread OpenClaw-resolved explicit $skill selections through the reply pipeline to the Codex app-server harness and emit them as structured UserInput::Skill turn items when the Codex catalog (skills/list) knows the same SKILL.md path. Codex then injects the skill natively and blocks its text scanner from double-selecting the same name, while unmatched names stay scannable for Codex-native-only skills and the prompt instruction block keeps owning skills Codex cannot see. Catalog misses and RPC errors fail open to the instruction path; the turn never fails on skill lookup. Part of #123367
The doctor-contract closure guard forbids the SSRF barrel in the doctor/legacy-setup closure (cold-loads DNS, proxy state, logging); the static import landed with the managed llama-server switch (#123105) and first fails when a PR selects the guard lane. Defer to a dynamic import at download time per the guard's stated remedy.
87c0098 to
4986384
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 11:16 PM ET / August 14, 2026, 03:16 UTC. ClawSweeper reviewWhat this changesThe PR passes explicitly resolved inbound skill references through the embedded-runner flow into Codex app-server turns as structured skill inputs, while moving llama-cpp’s SSRF helper import to actual download time. Merge readinessKeep open for maintainer review. This protected maintainer PR implements the remaining phase of the canonical skill-reference work, but the review environment could not read the checkout or directly inspect the affirmative Codex app-server protocol dependency, so no safe correctness or merge verdict is possible. Priority: P2 Review scores
Verification
How this fits togetherInbound messages are parsed by the reply pipeline, which selects named skills and queues an embedded agent run. The Codex extension turns those selections into app-server turn input so Codex can inject matching skills without reselecting the same text reference. flowchart LR
A[Authorized inbound message] --> B[Reply pipeline]
B --> C[Explicit skill resolver]
C --> D[Queued embedded run]
D --> E[Codex app-server adapter]
E --> F[Codex skill catalog lookup]
F --> G[Structured turn input]
G --> H[Codex skill injection]
Decision needed
Why: The PR’s central behavior relies on Codex protocol and selection semantics, and the required direct dependency inspection was blocked before any source could be read. Before merge
Agent review detailsSecurityNone. PR surfaceSource +106, Tests +167. Total +273 across 19 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Verify the exact sibling Codex protocol and selection implementation, then review the full threaded data flow and focused regression evidence on the current head before merging. Do we have a high-confidence way to reproduce the issue? Unclear: the PR describes focused harness coverage, but the review environment could not inspect or run the current source and direct protocol verification is unavailable. Is this the best way to solve the issue? Unclear: structured turn inputs may be the right ownership boundary, but the exact Codex selection contract and full current-head callers could not be checked. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 502bdb2bb789. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…penclaw#123441) * feat(codex): pass explicit skill selections as structured turn input Thread OpenClaw-resolved explicit $skill selections through the reply pipeline to the Codex app-server harness and emit them as structured UserInput::Skill turn items when the Codex catalog (skills/list) knows the same SKILL.md path. Codex then injects the skill natively and blocks its text scanner from double-selecting the same name, while unmatched names stay scannable for Codex-native-only skills and the prompt instruction block keeps owning skills Codex cannot see. Catalog misses and RPC errors fail open to the instruction path; the turn never fails on skill lookup. Part of openclaw#123367 * fix(plugins): defer llama-cpp ssrf-runtime load out of the setup closure The doctor-contract closure guard forbids the SSRF barrel in the doctor/legacy-setup closure (cold-loads DNS, proxy state, logging); the static import landed with the managed llama-server switch (openclaw#123105) and first fails when a PR selects the guard lane. Defer to a dynamic import at download time per the guard's stated remedy.
Closes #123367 (Phase 2, final phase)
What Problem This Solves
Phase 1 (#123387) made explicit
$skill-namereferences resolve on every channel via the reply-pipeline instruction block. On the Codex app-server harness, Codex's own byte scanner also selects skills it discovers from the same$tokens, so a skill known to both products was handled twice (OpenClaw instruction + Codex native body injection), and OpenClaw had no way to hand Codex a structured, provenance-clean selection.Why This Change Was Made
OpenClaw-resolved selections now travel as data (
ExplicitSkillSelection { name, path }) from the inline-action resolver through the queue/drain and embedded-runner params to the Codex adapter, which matches them against the Codex catalog (skills/list, path-matched, enabled-only) and appends structuredUserInput::Skillitems to the turn input. Codex contract (verified in codex-rs at91d6f48992ad):UserInput::Skillexists in the v2 app-server protocol (app-server-protocol/src/protocol/v2/turn.rs:292-324) and structured skill inputs add their names toblocked_plain_names(skills/src/selection.rs:60-92), so Codex's text scanner cannot double-select the same skill while Codex-native-only names stay scannable. Catalog misses and RPC errors fail open to the instruction path — the turn never fails on skill lookup, and the instruction block keeps owning skills Codex cannot see.One red-main heal rides this PR per landing policy:
fix(plugins): llama-cpp'sllama-server-install.tsstatically imported thessrf-runtimebarrel inside the doctor/legacy-setup closure (landed with refactor(plugins): replace node-llama-cpp with managed llama-server #123105), failing the doctor-contract closure guard whenever a PR selects that lane. Deferred to a dynamic import at download time, the guard's stated remedy.run-attempt-state.test.tswas superseded mid-flight by c28e9a4 onmain, which settled ownership on the attempt-light lane; the commit was dropped from this PR after verifying the audit is green on the rebased head.)User Impact
Codex-harness agents get native skill injection for explicitly referenced skills with no double selection; behavior on other harnesses is unchanged. No config surface added.
Evidence
origin/main, proving the heal); doctor closure guard + llama-cpp suites green post-heal.pnpm plugin-sdk:surface:checkpassed (field flows structurally; no regen needed).