Repository navigation
refactor(codex): remove redundant app-server forwarding - #140451
Conversation
|
🦞👀 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. |
| ? new WebSocket("ws://localhost/", { | ||
| ...websocketOptions, | ||
| createConnection: () => connectCodexAppServerUnixSocket(unixSocketPath), | ||
| createConnection: () => net.createConnection(unixSocketPath), |
9d829a9 to
a87d35a
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 5:25 PM ET / 21:25 UTC. ClawSweeper reviewWhat this changesThe Codex plugin removes private forwarding helpers, parses trusted subagent messages once, and reuses existing provider normalization and tool fingerprint operations without changing user-visible behavior. Merge readiness✅ Ready for maintainer review This remains a useful, maintainer-requested cleanup that is absent from current main. The narrowed patch preserves existing behavior, and the previously flagged socket change has been withdrawn. No actionable correctness or security defect was found. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s Codex plugin prepares agent sessions for the Codex app-server and processes native subagent completions. These helpers govern reviewer selection, tool-catalog identity for session reuse, and completion messages passed to the child-session lifecycle. flowchart TD
A[Model and process settings] --> B[Reviewer policy]
C[Available tool schemas] --> D[Stable tool fingerprint]
B --> E[Codex session preparation]
D --> E
E --> F[Codex app-server]
F --> G[Trusted completion parser]
G --> H[Child-session lifecycle]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -26. Total -26 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the simpler private call paths while retaining the existing validation, reviewer trust rules and fingerprint compatibility contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes redundant private operations rather than repairing a reported runtime failure; source comparison supports behavioral equivalence. Is this the best way to solve the issue? Yes: the patch directly reuses existing owners without adding abstractions or changing public contracts, and preserves the socket wrapper required by classification tooling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 270762e51d65. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '294df333c58f2da104eccffc623ccb3c4d43d4d8': (1802 commits) fix: clear stale diagnostics after Gateway changes (#140426) fix: keep plugin catalogs intact after discovery timeouts (#140441) perf(tui): prepare session picker rows once per overlay (#140462) refactor(config): reuse environment substitution for write-back (#140460) refactor(discord): remove retired auto-presence templates (#140463) fix(ui): finish roster refreshes during session activity (#140459) fix(setup): match prepared credentials to the model provider (#140461) fix: keep MiniMax discovery on the selected credential (#140438) refactor(tests): remove unused parent context cache reset (#140456) fix: avoid repeated xAI OAuth refresh during discovery (#140434) perf(routing): reuse prepared event session targets (#140454) fix(media): keep deferred audio and extraction providers discoverable (#139231) refactor(codex): remove redundant app-server forwarding (#140451) fix(test): avoid false native polling timeouts (#140119) test(gateway): retain saved source in reload fixtures (#140453) fix(gateway): reduce repeated model work when listing sessions (#140414) fix(feishu): fall back to post mode over table limit (#136382) fix: use the bundle-compatible Proxyline runtime under Bun (#140411) refactor(trace): reuse the canonical usage counter type (#140444) refactor(node-host): share execution policy result fields (#140446) ...
Related: #135868
What Problem This Solves
Codex app-server preparation contains private forwarding helpers and parses the same trusted communication twice. This is the maintainer-requested production deletion follow-up for concern C (stage 3) of the #135868 split.
Why This Change Was Made
Read the validated communication once, let the existing reviewer predicate normalize its provider, and call the canonical fingerprint operations directly. All public entrypoints, completion formats, validation, reviewer trust rules, fingerprint compatibility and cleanup ownership remain unchanged.
User Impact
No user-visible behavior change. Production shrinks by 26 lines (+9/−35); tests, tooling and docs are unchanged. No dependencies, configuration options or protocol changes.
Evidence
native-subagent-notification.ts:43parses once; the unchanged reader validates the assistant/commentary envelope, author/recipient/content types andtrigger_turn: false. The nonempty-content guard and author/path match remain.native-subagent-notification.test.ts:153,196,209covers extraction, mismatched authors and invalid envelopes;:39,62retains both receipt formats.app-server-policy.ts:18passes the provider toconfig-reviewer-policy.ts:74, which already trims and lowercases it. Its trust callees do not consume rawmodelProvider.app-server-policy.test.ts:157,184,223,296,331andconfig.test.tsretain provider, endpoint and effective-home trust behavior.thread-fingerprints.ts:13,28directly composes the same stabilization, sorting, serialization and hash. The complete-schema contract comment is retained.thread-fingerprints.test.ts:27,39,49,65retains model-visible descriptions, literal property names and ordering stability. All raw/hashed compatibility readers remain.Paths in the table are under
extensions/codex/src/app-server/. Symbol searches show only the removed private definitions and the migrated callers.git log -Sreachese357203be57for notification/provider helpers andb4b6afadd3cfor fingerprint forwarding; no separate public contract was identified for these private layers. This does not claim removal of a legacy protocol contract.Direct dependency inspection used sibling Codex tag
rust-v0.153.4, commit3d2ee51ca2d5db578f328aa75e20aa22c0197c9a:protocol.rs:804–840,core/src/agent/control.rs:612–663, andapp-server-protocol/src/protocol/v2/item.rs:250–260. Both completion producers and optional message phase remain current contracts and are retained. Prior compression PRs #139937 and #139953 were read; this change leaves their distinct cleanup evidence untouched.Five existing suites passed before and after: 242 cases, 29.68 s → 18.07 s. Final committed-branch independent review is scoped-clean through P2. No tests were changed or replaced with mocks.
The full selected changed-check plan passed on Blacksmith Testbox
tbx_01m1w9h8fy0tz1qcmh7angtxfw(run 34060799199): all three source hashes matched, command duration 7m25s, exit 0, and lease stopped. Local lint preparation had refused ancestornode_modules/punycodein the nested checkout; no dependency or guard change was made to bypass that boundary. The wrapper exit/timing record is the delegated proof; successful cleanup may cancel the backing Actions run.CI identified an additional ownership contract:
.github/codeql/openclaw-boundary/queries/raw-socket-callsite-classification.ql:81classifies the existingconnectCodexAppServerUnixSocketowner. The proposed five-line socket-wrapper deletion was withdrawn;transport-websocket.tsis byte-identical to the base. The classification rule and all baselines are unchanged.Final head
a87d35adeea2f1e28d0198043bdb4691b1ea7310passed exact-head CI run 34060782009, with the watcher reporting GREEN. ClawSweeper reviewed that head with no findings or before-merge/rank-up requests, including direct pinned Codex source inspection. Native review/prepare/merge landed it asbd6f54b8aba690eaa8f42b7c9d74b06641d679b2; GitHub state and main ancestry were verified.Main's concurrent Proxyline dependency update was reported by the merge wrapper. After refreshing the local lockfile install once, post-merge checks covered all 399 retained MCP/Codex focused cases: three MCP deadline cases initially failed in the combined run and passed on one isolated rerun without changing assertions/timeouts; the remaining suites passed. The checkout is clean.