Repository navigation
perf(codex): suppress unused app-server notifications - #151998
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. |
|
Codex review: blocked before merge. Reviewed September 18, 2026, 2:00 PM ET / 18:00 UTC (Revision 3). ClawSweeper reviewWhat this changesThe Codex plugin requests suppression of 37 unused app-server notifications, shares that policy with event projection, and adds documentation and regression coverage. Merge readiness⛔ Blocked before merge - 1 item remains The prior line-growth finding is resolved, and no actionable correctness or security findings remain. The optimization remains absent from the reviewed main revision; the related earlier PR closed without merging. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin connects OpenClaw agent turns to Codex app-server. Incoming notifications feed chat output, progress tracking, process cleanup, and session discovery. flowchart LR
A[Plugin notification policy] --> B[Connection initialization]
B --> C[Codex app-server]
C --> D{Notification requested?}
D -->|Suppressed| E[No transport payload]
D -->|Retained| F[OpenClaw decoder]
F --> G[Chat, progress, and session consumers]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +55, Tests +87, Docs +11. Total +153 across 7 files. 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. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep notification selection in the Codex plugin's connection handshake, preserving events needed for progress, cleanup, approvals, and transcript projection. Do we have a high-confidence way to reproduce the issue? Not applicable as a correctness bug: this is a performance optimization, with supplied native before/after measurements and source-confirmed unnecessary subscriptions. Is this the best way to solve the issue? Yes. Using the existing server-side filtering capability avoids unnecessary transport and parsing work without introducing another decoder or changing retained event handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b40b81637df7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
Negotiate 37 unused notifications out of each app-server connection while retaining progress, cleanup, transcript, approval, and catalog consumers. Guard the initialize payload and future consumer overlap; document the handshake policy.
e24be0b to
5630a22
Compare
Parse and project native catalog pages in one client-owned worker while preserving transport order, bounded display previews, cancellation routing, and joined worker shutdown. Keep complete native control metadata for canonical forks and direct-input checks. Publish affirmative ephemeral metadata before settling native requests, so helper shutdown cannot lose catalog exclusion while a passive worker refresh is pending. The existing catalog index owns deletion, stale-read fencing, and persistence. Synchronize worker-backed fixtures without changing deadlines or weakening assertions, and register the standalone synthetic benchmark. Main-baseline comparisons reproduced the PR regressions before repair. Focused worker, catalog, guarded-request, canonical-fork, and SQLite-restart proof plus changed checks passed; independent Codex review is scoped-clean through P2. Exact-head CI is required before landing. Related: #152035, #151998, #152257.
Negotiate 37 unused notifications out of each app-server connection while retaining progress, cleanup, transcript, approval, and catalog consumers. Guard the initialize payload and future consumer overlap; document the handshake policy.
Parse and project native catalog pages in one client-owned worker while preserving transport order, bounded display previews, cancellation routing, and joined worker shutdown. Keep complete native control metadata for canonical forks and direct-input checks. Publish affirmative ephemeral metadata before settling native requests, so helper shutdown cannot lose catalog exclusion while a passive worker refresh is pending. The existing catalog index owns deletion, stale-read fencing, and persistence. Synchronize worker-backed fixtures without changing deadlines or weakening assertions, and register the standalone synthetic benchmark. Main-baseline comparisons reproduced the PR regressions before repair. Focused worker, catalog, guarded-request, canonical-fork, and SQLite-restart proof plus changed checks passed; independent Codex review is scoped-clean through P2. Exact-head CI is required before landing. Related: #152035, #151998, #152257.
Parse and project native catalog pages in one client-owned worker while preserving transport order, bounded display previews, cancellation routing, and joined worker shutdown. Keep complete native control metadata for canonical forks and direct-input checks. Publish affirmative ephemeral metadata before settling native requests, so helper shutdown cannot lose catalog exclusion while a passive worker refresh is pending. The existing catalog index owns deletion, stale-read fencing, and persistence. Synchronize worker-backed fixtures without changing deadlines or weakening assertions, and register the standalone synthetic benchmark. Main-baseline comparisons reproduced the PR regressions before repair. Focused worker, catalog, guarded-request, canonical-fork, and SQLite-restart proof plus changed checks passed; independent Codex review is scoped-clean through P2. Exact-head CI is required before landing. Related: openclaw#152035, openclaw#151998, openclaw#152257.
What Problem This Solves
Reduces main-thread CPU spent decoding Codex app-server notifications that OpenClaw does not use during concurrent turns.
User Impact
No intended change to chat output, tools, approvals, compaction, native subagents, or session discovery. New app-server connections request fewer notifications. Existing connections pick up the policy when recreated; no configuration or state migration is required.
Why This Change Was Made
Three supplied five-second production CPU profiles put app-server
JSON.parseat 16–19% of main-thread busy time (403–583 ms per window), with roughly another 5% in line/string decoding. The client requested experimental APIs but subscribed to unused notifications, including a cumulative diff after each file change.The initialize handshake now opts out of 37 exact methods from one plugin-owned policy: 34 notifications without an incoming consumer or turn-progress role, cumulative turn diffs, and two retired events. Retained file-change items carry the individual changes. The projector uses the same policy to recognize these events if a server still sends them.
The consumer audit includes client cleanup, native subagents, approval correlation, client runtime, compaction, ephemeral turns, native tool lifecycle, assistant projection, the turn router, and catalog observers. Some apparent projector no-ops are real progress consumers: MCP progress, streamed patch updates, reasoning section markers, and model metadata remain enabled. Terminal interaction also preserves
nativeExecutionObservedcleanup evidence. Turn/item lifecycle, usage, raw response, warning, approval, and catalog events remain enabled.The harness guide documents this policy. The regression guard rejects opted-out method literals in production consumers, with one precise exception for an outgoing
process/exitedevent on the separate exec-server protocol.Evidence
optOutNotificationMethodswas absent, then passed with the change. Focused client, consumer-guard, decoder, and projector coverage: 427 tests across 24 files passed.The unchanged decoder replayed each captured transcript 200 times per sample, with two warm-up passes and seven alternating measured samples using process CPU time. This workload used 80.1% fewer wire bytes and 78.1% less decoder CPU, leaving 21.9% of decode work. These are synthetic measurements, not a production speedup claim.
Residual work includes required item/raw-response payloads and RPC responses. No pre-parse sniff is added: a method alone cannot discard a partially consumed notification, and raw-newline continuation recovery makes a line-only shortcut unsafe without another structural parser. Worker-thread decoding remains a follow-up if post-deployment profiles justify it. No live Gateway was changed; a new production profile remains the validation gap.
Codex source contract and compatibility citations
Personally inspected the sibling source and the minimum supported release. The current source commit is publicly resolvable.
deny_unknown_fields.