Repository navigation
Conversation
Negotiate the audited unused notification set per connection while preserving streaming, turn liveness, usage, and native receipts. Keep initialization policy and version validation together outside the oversized transport client. A stock 0.154.0 synthetic probe removed one 218-byte startup notification (0.24% of notification bytes); no steady-state CPU reduction is established. No config, state, schema, or update-path change.
|
🦞👀 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, 1:29 PM ET / 17:29 UTC. ClawSweeper reviewWhat this changesThe Codex plugin requests suppression of 34 unused app-server notifications, extracts connection initialization, and adds compatibility coverage and documentation. Merge readiness⛔ Blocked before merge - 1 item remains Keep open. No blocking defect was found, and current main lacks this optimization. The overlapping same-author draft at #151998 does not establish supersession. Priority: P3 Review scores
Verification
How this fits togetherThe Codex plugin connects OpenClaw agent turns to the Codex app-server. Its notification dispatcher feeds streaming output, turn progress, session observations, and native subagent receipts back into OpenClaw. flowchart LR
A[New Codex connection] --> B[Initialize capabilities]
B --> C[Codex notification filter]
C --> D[Unused events suppressed]
C --> E[OpenClaw dispatcher]
E --> F[Streaming and turn progress]
E --> G[Sessions and subagent receipts]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +51, Tests +64, Docs +10. Total +125 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep notification suppression in the existing connection handshake, preserve all consumed and liveness events, and describe the benefit within the measured limits. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this is an optimization. Source confirms the omitted capability on main, and the body reports a real-binary before/after comparison; no runtime checks were executed during this read-only review. Is this the best way to solve the issue? Yes, for suppressing unused notifications: existing Codex negotiation avoids a second local filtering owner and preserves compatibility. The evidence does not establish a material performance improvement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 861e65d8c9fb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Closing without merging: the measurement in this PR is the useful output, the change is not. On the representative turn the opt-out removes one 218-byte notification (0.24% of bytes); 48% of bytes are rawResponseItem/completed and 40% are consumed deltas, none of which this list can suppress, so the extra initialize payload and a 34-entry exclusion list to maintain are not worth landing. The production profile implies far more app-server line volume per turn than this fixture produced, so the next step is a measurement on the live Gateway, not a fixture-derived exclusion list. |
What Problem This Solves
The Gateway decodes Codex app-server notifications for features it does not consume while handling concurrent streaming turns.
User Impact
New app-server connections ask stock Codex to suppress 34 unused notification methods. Streaming, native execution, usage, approvals, subagent receipts, and session observations keep their existing events.
Measured benefit is small: the representative fixture removes one 218-byte startup notification (0.24% of notification bytes). It does not demonstrate a material steady-state CPU reduction or solve the dominant parsing cost. The list adds 1,005 bytes to the initialize request once per connection; this fixture does not show a total bidirectional traffic saving.
Why This Change Was Made
The connection owner sends
optOutNotificationMethodsduringinitialize; previously it requested no exclusions. Connection initialization and version validation now live inclient-initialize.ts, keeping the existing oversized transport owner from growing. The list sits beside the initialize call, based on the pinned 0.154.0 protocol and every plugin notification subscriber. No local drop filter or stock Codex modification is needed. Servers that ignore the request continue through the normal decoder and dispatcher.Update behavior: no update-path, configuration, schema, or state change. Negotiation occurs per new app-server connection. Both the minimum supported 0.149.0 and pinned 0.154.0 derive Serde
Deserializefor capabilities withoutdeny_unknown_fields(unknown fields are ignored; optional fields default toNone, booleans use#[serde(default)]). Both already define this capability. The pinned binary also accepted an extra unknown capability in the live handshake. This does not broaden the supported-version floor.Protocol evidence personally inspected in sibling Codex source at
dcfcb570b2cd0a2500b1d47a7b04a7cb1b0a0bd2:codex-rs/app-server-protocol/src/protocol/v1.rs:43–65,app-server/src/request_processors/initialize_processor.rs:70–100,app-server/src/transport.rs:100–121, andapp-server-protocol/src/protocol/common.rs:1841+. Exact pinned release sources confirm capability/deserialization, connection negotiation, and exact-name filtering. Minimum-version capabilities have the same permissive contract.Dispatch audit for every exclusion
Paths below are relative to
extensions/codex/src/; line references describe the pre-change dispatch source. The pinned protocol contains 83 methods: 34 excluded, 49 retained.account/login/completed,app/list/updatedaccount/updated(command-plugins-runtime.ts:148,app-server/inference-routing.ts:50,app-server/client.ts:949); rate limits useclient-runtime.ts:265. No subscriber handles these two.command/exec/outputDelta,process/outputDelta,process/exitedapp-server/remote-workspace-media.ts:127,164consumes the finalcommand/execresponse, not stream notifications.client.ts:851records native execution on the request.sandbox-exec-server/processes.ts:227emits a same-named message on a separate protocol; it is not an app-server consumer.mcpServer/event/stream/notification,mcpServer/oauthLogin/completed,mcpServer/startupStatus/updatedapp-server/event-projector-native-tool-lifecycle.ts:173–230); no subscriber consumes these three.thread/goal/cleared,thread/queue/changed,project/changed,thread/project/updated,thread/environment/connected,thread/environment/disconnectedsession-catalog-events.ts:43–54,138) nor native monitor allowlist (app-server/native-subagent-monitor.ts:78–90,214) includes them. Their protocol payloads have no turn ID, so they do not drive turn progress.thread/realtime/closed,thread/realtime/error,thread/realtime/item/completed,thread/realtime/item/started,thread/realtime/item/transcript/delta,thread/realtime/itemAdded,thread/realtime/outputAudio/delta,thread/realtime/sdp,thread/realtime/started,thread/realtime/transcript/delta,thread/realtime/transcript/donecodex-rs/app-server-protocol/src/protocol/v2/realtime.rs:375+); the projector rejects them atapp-server/event-projector.ts:148, and the catalog/monitor allowlists reject them.deprecationNotice,externalAgentConfig/import/completed,externalAgentConfig/import/progress,fs/changed,fuzzyFileSearch/sessionCompleted,fuzzyFileSearch/sessionUpdated,remoteControl/status/changed,windows/worldWritableWarning,windowsSandbox/setupCompletedwarningandconfigWarning(app-server/turn-router.ts:423–440), then drops notifications without a thread route (:443–447).Preserved even without explicit method dispatch:
thread/goal/updated,modelProvider/authRecoveryStarted, andmodelProvider/authRecoveryCompletedcarry turn IDs and therefore refresh run progress/native hook relay lifetime (run-attempt-notification-controller.ts:111–117,run-attempt-turn-state.ts:150–167). All explicit projector cases remain, including no-op cases atevent-projector.ts:253–263. Both raw response methods remain for usage, native subagent delivery receipts, tool ordering, and abort markers. Future consumers must remove their method from the exclusion list.Evidence
Before changing production code, a real local stock
@openai/codex0.154.0 app-server ran one representative turn against a loopback Responses API fixture. It streamed 71 assistant text chunks, 44 reasoning-summary chunks, 44 reasoning-text chunks, and executed a harmless command with two streamed output chunks and exit code 0. The model side was deterministic SSE; zero paid model calls. One turn uses two fixture Responses requests because the command result is followed by the assistant answer. The protocol client support was inspected and used for the unit proof (createClientHarness); the real binary probe follows Codex's own mock Responses fixture contract.Bytes are UTF-8 stdout notification line bytes including LF, from initialize through turn completion; RPC responses and stderr are excluded. This is a synthetic workload, not a production distribution or CPU benchmark. Raw captures stay local and are not included in this PR. Dispatch paths in the table are relative to
extensions/codex/src/app-server/, at the pre-change revision.rawResponseItem/completedevent-projector.ts:224,native-subagent-notification.ts:43,116,attempt-notifications.ts:65,85,156item/agentMessage/deltaevent-projector.ts:161,native-subagent-monitor.ts:78item/reasoning/summaryTextDeltaevent-projector.ts:167,native-subagent-monitor.ts:78item/reasoning/textDeltaevent-projector.ts:168item/completedevent-projector.ts:181,client-runtime.ts:252item/startedevent-projector.ts:178,attempt-notifications.ts:18turn/completedevent-projector.ts:218,turn-router.ts:450thread/started../session-catalog-events.ts:43,native-subagent-monitor.ts:78thread/tokenUsage/updatedevent-projector.ts:203rawResponse/completedevent-projector.ts:221,ephemeral-turn.ts:57account/rateLimits/updatedclient-runtime.ts:265item/commandExecution/outputDeltaevent-projector.ts:184,client.ts:937thread/status/changed../session-catalog-events.ts:43,native-subagent-monitor.ts:78turn/startedturn-router.ts:459,native-subagent-monitor.ts:78remoteControl/status/changedturn-router.ts:423–447With the capability enabled, the same fixture yielded 187 notifications / 91,883 bytes.
remoteControl/status/changeddisappeared; every consumed method retained its count, and assistant/reasoning/command output and completion assertions passed. The direct excluded-byte saving is 218 bytes; the remaining one-byte total difference is variable payload length. This event is startup-scoped, so no per-turn saving is established.Consumed deltas account for 39.8% of baseline bytes; consumed raw-response items account for 48.1%. Most bytes belong to consumed raw items and deltas. No decoder change or speculative Buffer splitter is included; multiline recovery remains untouched.
Validation:
client.test.tsinitialize negotiation failed becauseoptOutNotificationMethodswas absent (1 failed, 1 passed, 54 skipped). The server-ignores-capability case passed.client*.test.tssuites, including the unchanged multiline decoder suite, passed 176/176 tests throughnode scripts/run-vitest.mjs. The initialize regression and ignored-capability case both passed.node scripts/check-changed.mjs: passed, including both extension typechecks, lint, all selected guards, six doctor contract tests, and zero runtime value import cycles.git diff --check: passed.No production Gateway, update mechanism, session projection, config option, or stock Codex binary was changed. No production CPU reprofiling or paid inference turn was performed.