Repository navigation
improve(llm-task): constrain Codex output with task schemas - #137450
Conversation
|
Codex review: needs real behavior proof before merge. What this changesThis PR forwards small task schemas to isolated Codex generation and retries once after an explicit native-schema rejection. Example: A task requires an object with a string answer, using required:["answer"] and additionalProperties:false.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain This PR adds a useful capability absent from current main, with no concrete correctness finding; its paired request and maintainer engagement warrant keeping it open. Priority: P2 Decision needed
Before merge
FindingsNone. Provenance
Tests
Agent review detailsHow this fits togetherThe optional llm-task plugin sends a fresh inference request through the host completion broker and selected harness; Codex returns text that the plugin parses and validates. flowchart LR
A[Workflow caller] --> B[llm-task plugin]
B --> C[Isolated completion broker]
C --> D[Selected Codex harness]
D --> E[Native bounded turn]
E --> F[JSON parsing and validation]
F --> A
Technical reviewBest possible solution: Use the existing completion broker and Codex bounded-turn owner for advisory schemas, preserving authoritative local validation and the original execution deadline. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the missing schema handoff, but no live generation failure was reproduced and existing post-generation validation follows its documented contract. Is this the best way to solve the issue? The patch uses the appropriate existing owners and bounds recovery without changing runtime selection, tool isolation, or local validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8b251188f50. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +97, Tests +390, Docs +43. Total +530 across 27 files. Added test files: 2. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
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 HistoryReview history (22 earlier review cycles; latest 8 shown)
Reviewed October 25, 2026, 1:50 AM ET / 05:50 UTC (Revision 23). |
b33d504 to
219c605
Compare
219c605 to
f58d840
Compare
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f58d8407be
ℹ️ 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".
f58d840 to
82b4029
Compare
82b4029 to
b79f99e
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
6337947 to
09d2f4e
Compare
|
@clawsweeper re-review Please review current head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…#137450) * improve(llm-task): constrain Codex output with task schemas * test(codex): attest settled finalizer input * test(codex): adapt schema coverage to current client lifecycle
Closes #137432
What Problem This Solves
llm-taskvalidates its schema only after generation, so Codex-backed tasks can return valid JSON with missing fields or incorrect types despite native structured-output support.User Impact
Small task schemas can constrain isolated Codex generation. Schemas outside the native strict subset receive at most one prompt-constrained retry on the same route, within the original deadline. Local JSON parsing and schema validation remain authoritative.
Why This Change Was Made
Pass the optional advisory
outputSchemathrough the existing isolated-completion owners toturn/start. Preserve the documented 1 KiB forwarding budget, tool isolation, authentication, cancellation, and usage observation. Retry only an explicit native schema rejection, including Codex's HTTP-formatted 400 response; unrelated failures do not retry. Validate the exact submitted fallback input through the existing passive-turn attestation.Original implementation by @cavit99 (Cavit Erginsoy); contributor commits are preserved.
Evidence
a0b170fac1acregression:bounded-turn-output-schema.test.tsfails becauseturn/start.outputSchemais absent. The same regression passes with this change.debuginstallation cannot resolvems; no assertions ran. Exact-head CI must cover this remaining environment gap.pnpm prompt:snapshots:gencompleted with no snapshot delta. Independent P0–P2 review is clean after repairing native HTTP rejection classification.CI and review notes
Exact-head CI run 40166637781 reports an unrelated
check-lintfailure attest/helpers/claude-managed-settings.ts:21:no-recursive-readdirrejects the helper's forwarded options. Current maine8b251188f502b088dd037936062a1711ea302e1fails the same focused command,node scripts/run-oxlint.mjs --openclaw-focused-config --config config/oxlint/resource-safety.json test/helpers/claude-managed-settings.ts. Both the helper and rule module have identical Git blob hashes on main and this head. The newest scheduled main run, 40165856223, predates the rule change and passed lint; it is not claimed as a matching failing run. This baseline defect remains outside the schema feature.ClawSweeper found no code or security defect on this head. Its live-proof request remains covered by the limitation above. Documentation examples use a stable public model ID; they do not change runtime defaults. The core harness-forwarding assertion remains because the runtime-broker and native-client suites mock opposite sides of that boundary and cannot replace its dispatch coverage.