Skip to content

feat(skills): enable self-learning review for Codex sessions - #114501

Merged
steipete merged 2 commits into
mainfrom
steipete/codex-harness-experience-review-j6w9
Jul 28, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/codex-harness-experience-review-j6w9

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where self-learning was enabled but successful, substantial openai/* sessions running through the Codex app-server harness never scheduled delayed experience review. Deterministic correction capture still worked, but this mainstream OpenAI-key route could not autonomously propose reusable procedures.

Why This Change Was Made

The Codex harness now reports the runtime facts the shared scheduler already requires: its resolved thread provider/model and auth profile, actual skill_workshop exposure, compaction state, and an exact model-iteration count derived from unique upstream rawResponse/completed events. It continues to use the harness's frozen current-turn transcript projection, which is mirrored to SQLite before agent-end scheduling; no new transcript reader, config surface, gateway protocol, or schema change is introduced.

Unknown or incomplete runtimes still fail closed. In particular, an explicitly missing Codex response count is reported as zero, and delayed review remains ineligible when model identity or Workshop availability is absent.

User Impact

Operators who enable self-learning can now receive delayed Skill Workshop proposals after eligible Codex app-server sessions serving openai/* models. The existing success, ten-iteration, idle-window, sandbox, tool-policy, and compaction gates remain unchanged.

Evidence

  • Live baseline before this change: Codex app-server sessions never scheduled experience review, while deterministic correction capture worked.
  • node scripts/run-vitest.mjs src/skills/workshop/experience-review.test.ts extensions/codex/src/app-server/event-projector.usage.test.ts: 29 tests passed on the rebased head.
  • node scripts/check-changed.mjs -- <9 changed files>: passed all selected typecheck, core/extension lint, SDK surface, max-lines, import-cycle, schema, and database-first guards on Blacksmith Testbox (run 30254863840).
  • Required broad local command node scripts/run-vitest.mjs src/skills/workshop extensions/codex exposed the existing order-dependent Codex test uses human approval instead of Guardian for auto exec on custom model providers; that exact test passed when isolated. Runtime-artifact tests also required unsetting an ambient NODE_PATH and then passed 4/4 in isolation.
  • Autoreview: clean, no accepted/actionable findings.

AI-assisted with Codex. I reviewed the implementation and understand the runtime/result, tool-availability, transcript, and fail-closed boundaries changed here.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: codex size: S maintainer Maintainer-authored PR labels Jul 27, 2026
@steipete
steipete marked this pull request as ready for review July 27, 2026 10:06
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 6:10 AM ET / 10:10 UTC.

ClawSweeper review

What this changes

The PR passes resolved Codex app-server runtime facts and exact upstream response counts into OpenClaw’s existing delayed Skill Workshop experience-review scheduler so eligible openai/* sessions can be reviewed.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 3 items remain

Keep open for normal maintainer review: the patch is a focused repair for an existing self-learning eligibility gap and its event-counting approach matches the Codex app-server contract, but the PR body provides tests and CI rather than after-fix evidence from a real eligible Codex session. The maintainer label also requires explicit maintainer handling rather than cleanup closure.

Priority: P2
Reviewed head: b8f82b5d645169db1f5fd00c2bd341c56d043f1b

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and contract-aligned, but real after-fix behavior proof is still a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR reports focused tests and CI plus a pre-fix baseline, but lacks redacted after-fix evidence from a real eligible Codex session showing delayed experience review scheduling; please add terminal output, runtime logs, or a recording and redact private data. Updating the PR body should trigger a fresh review; otherwise a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports focused tests and CI plus a pre-fix baseline, but lacks redacted after-fix evidence from a real eligible Codex session showing delayed experience review scheduling; please add terminal output, runtime logs, or a recording and redact private data. Updating the PR body should trigger a fresh review; otherwise a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items PR implementation boundary: The branch adds a Codex-only exact response-completion projection and forwards resolved model, auth, tool-availability, compaction, and iteration facts to the existing agent-end hook; it does not add config, schema, or protocol surface.
Scheduler preserves the existing fallback contract: Core scheduling still derives iterations from the frozen transcript when a harness provides no count, while an explicitly supplied invalid or zero count fails closed rather than inferring eligibility.
Upstream Codex protocol contract: The Codex app-server README specifies that experimental rawResponse/completed is emitted once per upstream Responses API completion with a response ID and nullable exact usage, supporting the branch’s response-ID de-duplication model.
Findings None None.
Security None None.

How this fits together

The Codex plugin translates app-server turn events into an embedded-agent result, then invokes core agent-end hooks. The Skill Workshop scheduler consumes those hook facts to decide whether a successful session is eligible for delayed experience review.

flowchart LR
  A[Codex app-server turn events] --> B[Codex event projector]
  B --> C[Run result and frozen transcript]
  C --> D[Agent-end hook context]
  D --> E[Experience-review scheduler]
  E --> F[Eligibility gates]
  F --> G[Delayed Skill Workshop review]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports focused tests and CI plus a pre-fix baseline, but lacks redacted after-fix evidence from a real eligible Codex session showing delayed experience review scheduling; please add terminal output, runtime logs, or a recording and redact private data. Updating the PR body should trigger a fresh review; otherwise a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The patch changes delayed-review eligibility for live Codex app-server sessions, but no redacted after-fix session evidence shows that app-server events, dynamic tool exposure, and agent-end scheduling combine as intended in a real setup.
  • Complete next step (P2) - This needs contributor-supplied real behavior proof followed by ordinary maintainer review, not an automated repair branch.
Agent review details

Security

None.

PR surface

Source +60, Tests +46, Docs +9. Total +115 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 77 17 +60
Tests 2 46 0 +46
Docs 1 11 2 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 134 19 +115

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the existing scheduler and narrow Codex adapter boundary, then add redacted live proof from an eligible openai/* Codex session that shows the delayed review was scheduled without weakening the existing fail-closed gates.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the existing scheduler and narrow Codex adapter boundary, then add redacted live proof from an eligible openai/* Codex session that shows the delayed review was scheduled without weakening the existing fail-closed gates.

Do we have a high-confidence way to reproduce the issue?

No high-confidence live reproduction is included in the review evidence. The source path and targeted tests make the missing eligibility facts reproducible at the harness boundary, but a real eligible Codex session has not been shown scheduling review after this change.

Is this the best way to solve the issue?

Yes, provisionally. Reusing the shared scheduler and adding only the Codex facts it already requires is narrower than introducing a Codex-specific review path; a live after-fix run should confirm the event-to-scheduler integration before merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b8e7f27ff254.

Labels

Label changes:

  • add P2: This repairs an opt-in self-learning workflow for the mainstream Codex/OpenAI session route, with limited blast radius and no demonstrated urgent outage.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests and CI plus a pre-fix baseline, but lacks redacted after-fix evidence from a real eligible Codex session showing delayed experience review scheduling; please add terminal output, runtime logs, or a recording and redact private data. Updating the PR body should trigger a fresh review; otherwise a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This repairs an opt-in self-learning workflow for the mainstream Codex/OpenAI session route, with limited blast radius and no demonstrated urgent outage.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests and CI plus a pre-fix baseline, but lacks redacted after-fix evidence from a real eligible Codex session showing delayed experience review scheduling; please add terminal output, runtime logs, or a recording and redact private data. Updating the PR body should trigger a fresh review; otherwise a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • PR implementation boundary: The branch adds a Codex-only exact response-completion projection and forwards resolved model, auth, tool-availability, compaction, and iteration facts to the existing agent-end hook; it does not add config, schema, or protocol surface. (extensions/codex/src/app-server/run-attempt-finalize.ts:434, b8f82b5d6451)
  • Scheduler preserves the existing fallback contract: Core scheduling still derives iterations from the frozen transcript when a harness provides no count, while an explicitly supplied invalid or zero count fails closed rather than inferring eligibility. (src/skills/workshop/experience-review.ts:301, b8f82b5d6451)
  • Upstream Codex protocol contract: The Codex app-server README specifies that experimental rawResponse/completed is emitted once per upstream Responses API completion with a response ID and nullable exact usage, supporting the branch’s response-ID de-duplication model. (codex-rs/app-server/README.md)
  • Focused regression coverage: The branch adds coverage for duplicate response notifications and for scheduling with an exact harness iteration count, including the explicit-zero fail-closed case. (extensions/codex/src/app-server/event-projector.usage.test.ts:86, b8f82b5d6451)
  • Proof gap: The PR body reports focused tests, changed-check validation, and a pre-fix live baseline, but it does not include a redacted after-fix run showing that an eligible Codex session actually schedules delayed experience review. Public docs: docs/tools/self-learning.md. (docs/tools/self-learning.md:126, b8f82b5d6451)

Likely related people:

  • joshavant: Recent repository history reported for the Codex app-server run-attempt path includes this contributor, making them a relevant routing candidate for harness lifecycle and runtime-fact behavior. (role: recent Codex app-server contributor; confidence: low; commits: 3ee03420613f; files: extensions/codex/src/app-server/run-attempt.ts)
  • steipete: Recent OpenClaw Codex runtime and release work places this contributor close to the affected app-server and OpenAI runtime boundary; this is supplementary routing evidence beyond authorship of this PR. (role: recent Codex runtime contributor; confidence: low; commits: 0b4fc26d4add, b4fdd1470b70, 50a2481652b6; files: extensions/codex/src/app-server/run-attempt.ts, docs/providers/openai.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Run an eligible openai/* Codex app-server session with self-learning enabled and attach redacted terminal output or logs showing the delayed review was scheduled.
  • Show the relevant resolved model, response-count, and skill_workshop eligibility facts so reviewers can verify the fail-closed path did not mask the run.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete steipete self-assigned this Jul 28, 2026
@steipete
steipete force-pushed the steipete/codex-harness-experience-review-j6w9 branch from b8f82b5 to c258579 Compare July 28, 2026 17:53
@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer landing disposition for exact head 80186562c04c438bea3236baefd1f98c913ff0e4:

  • Rank-up move “run an eligible openai/* Codex app-server session and attach redacted output showing delayed review scheduling”: skipped as additional live proof for this landing. The pre-fix live baseline is documented, the focused scheduler/projector regressions pass, and exact-head CI run 30385384119 is green. The maintainer accepts the absence of a new live transcript.
  • Rank-up move “show resolved model, response-count, and skill_workshop eligibility facts”: applied at the harness and dependency-contract boundaries. run-attempt-finalize.ts forwards the resolved thread provider/model and auth identity, counts actual available dynamic-tool specs for skill_workshop, and passes the projector’s unique response-completion count. The focused tests cover duplicate response IDs, exact-count scheduling, and explicit-zero fail-closed behavior. Fresh openai/codex source at fa1d4c40d0e63eef2e0ba8a9e004ccd0a80b77f5 confirms RawResponseCompletedEvent is exact per-upstream-completion data (codex-rs/protocol/src/protocol.rs:1820), app-server forwards responseId and usage (codex-rs/app-server/src/bespoke_event_handling.rs:1066), and each Responses completion emits that event (codex-rs/core/src/session/turn.rs:2501).

The branch rebased without conflicts. A first exact-head CI run, 30384920868, found event-projector.ts one line over its max-lines ratchet; the implementation was tightened without behavior change, targeted lint/format and 29 focused tests passed, and replacement run 30385384119 is green. Existing autoreview is clean with no accepted/actionable findings.

@steipete
steipete merged commit 826beb7 into main Jul 28, 2026
119 checks passed
@steipete
steipete deleted the steipete/codex-harness-experience-review-j6w9 branch July 28, 2026 18:21
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
…w#114501)

* feat(skills): enable Codex experience review

* style(codex): keep event projector within ratchet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant