Skip to content

refactor(codex): keep lifecycle and provider files within size limits - #157980

Merged
steipete merged 1 commit into
mainfrom
fix/swarm-strict-lint-prerequisite-20260925bm
Sep 25, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/swarm-strict-lint-prerequisite-20260925bm

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Native PR preparation fails when Codex and OpenAI files exceed the repository's strict size limits. This is a prerequisite for #157347.

User Impact

No intended user-visible change. Maintainer preparation can run with the existing limits enforced.

Why This Change Was Made

Move existing protocol validators, lifecycle error classification, HTTP helpers, provider configuration projections, and literal test data into their owning modules. Function and test bodies remain intact; consumers and the explicit test mock follow the moved helpers.

Evidence

Full extension lint, production and test types, normal build, and independent Codex review passed. The build's report-only UI size check measured startup JavaScript at 371,503 bytes gzip against a 371,332-byte limit; this is an advisory overage, not a budget pass. OpenAI policy coverage and Codex inference/lifecycle coverage passed, followed by 77 checks for the additional startup, supervision, and recovery moves.

Measured changed-test costs: OpenAI policy file 4.56 seconds for 74 tests; turn-recovery file 3.54 seconds for 3 tests, each with one worker.

One local native cold-recovery run hit its existing 60-second deadline. A bounded instrumented replay passed in about 30 seconds, but did not establish the original cause or a fix. The diagnostic was removed, the failure is retained, and deadlines and scheduling are unchanged. The native inference fixture also passed; live provider proof was not selected for this refactor.

Move existing protocol, error, HTTP and provider helpers to their owning
modules and relocate the literal OpenAI policy test matrix. Preserve the
existing lifecycle, retry, authority and cleanup behavior while unblocking
strict local PR preparation.

Related: #157347
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 25, 2026 06:41
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 25, 2026, 3:27 AM ET / 07:27 UTC.

ClawSweeper review

What this changes

Moves private Codex provider, relay, protocol, and lifecycle helpers into smaller local modules and relocates an OpenAI policy test table to test support.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main still has the oversized Codex files this PR addresses. The introduced moves are coherent, and the reviewed hunks show no concrete behavioral or security defect.

Priority: P3
Reviewed head: 77b79f23020a151cc5f115b0ed70b369e1a49a89

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused extraction has relevant reported validation and no identified introduced defect; the contributor proof gate is inapplicable.
Proof confidence 🌊 off-meta tidepool Not applicable: The moved helpers feed native Codex inference and lifecycle paths; the PR reports a native inference fixture pass, but claims no changed runtime behavior. The supplied Repository State classifies the author as MEMBER, so contributor after-fix proof is not required for this internal refactor; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The moved helpers feed native Codex inference and lifecycle paths; the PR reports a native inference fixture pass, but claims no changed runtime behavior. The supplied Repository State classifies the author as MEMBER, so contributor after-fix proof is not required for this internal refactor; no stored-data contract changes.
Evidence reviewed 8 items Enforced source limit: Extension production TypeScript files have a 700 counted-line max-lines rule.
Current main still needs the extraction: The current-main inference routing file has 778 raw lines, and the new provider helper module is absent from that revision; the latest release also lacks it.
Provider extraction: The introduced provider configuration module contains the existing route projection and provider field handling; its consumer now imports those local helpers.
Findings None None.
Security None None.

How this fits together

OpenClaw's Codex plugin sends agent turns through Codex App Server and routes native inference through a local relay. Provider settings and thread responses feed these paths, which produce model turns and lifecycle results.

flowchart LR
A[OpenClaw agent turn] --> B[Codex plugin lifecycle]
B --> C[Codex App Server]
C --> D[Native provider settings]
D --> E[Provider routing]
E --> F[Local inference relay]
F --> G[Provider endpoint]
G --> C
C --> H[Turn result]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +27, Tests +2. Total +29 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 10 202 175 +27
Tests 3 25 23 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 227 198 +29

Review metrics

Metric Value Why it matters
Code growth by role production +27 lines, tests +2 lines The small net growth comes from module boundaries around relocated logic.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/codex/src/app-server/inference-proxy-http.ts, migration/backfill/repair: extensions/codex/src/app-server/inference-proxy.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep provider projection, relay HTTP behavior, and lifecycle validation in their private plugin owners while meeting the enforced source-line budget.

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

Not applicable: no runtime bug is alleged. The source-line rule and oversized current-main files establish the maintenance need.

Is this the best way to solve the issue?

Yes: moving unchanged private helpers to owner-local modules meets the existing limit without adding a public plugin API.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is an internal file-size cleanup with no intended user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The moved helpers feed native Codex inference and lifecycle paths; the PR reports a native inference fixture pass, but claims no changed runtime behavior. The supplied Repository State classifies the author as MEMBER, so contributor after-fix proof is not required for this internal refactor; no stored-data contract changes.

Label justifications:

  • P3: This is an internal file-size cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The moved helpers feed native Codex inference and lifecycle paths; the PR reports a native inference fixture pass, but claims no changed runtime behavior. The supplied Repository State classifies the author as MEMBER, so contributor after-fix proof is not required for this internal refactor; no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • stevenlee-oai: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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

Copy link
Copy Markdown
Contributor Author

Reviewed the data-model compatibility checklist in the ClawSweeper review. The two flagged relay files only relocate the existing HTTP overload response and header-filtering helpers. Their constants and function bodies match the parent exactly after removing the new export modifiers; no stored schema, persistence format, migration, or upgrade path changes. Compatibility proof is not applicable to this extraction.

The reviewed head 77b79f23020a151cc5f115b0ed70b369e1a49a89 has green CI, passing extension lint/types, owning regression coverage, a completed normal build, and an independent review with no actionable findings. The native cold-recovery timeout and advisory UI size overage remain disclosed in the PR evidence.

@steipete
steipete merged commit 0680663 into main Sep 25, 2026
194 of 196 checks passed
@steipete
steipete deleted the fix/swarm-strict-lint-prerequisite-20260925bm branch September 25, 2026 07:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
…ts (openclaw#157980)

Move existing protocol, error, HTTP and provider helpers to their owning
modules and relocate the literal OpenAI policy test matrix. Preserve the
existing lifecycle, retry, authority and cleanup behavior while unblocking
strict local PR preparation.

Related: openclaw#157347
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex extensions: openai P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant