Skip to content

refactor(types): remove chained type assertions in extensions - #124079

Merged
steipete merged 2 commits into
mainfrom
steipete/chained-assert-w2
Aug 15, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/chained-assert-w2

Conversation

@steipete

@steipete steipete commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A maintainer-requested static-analysis campaign found 185 chained type assertions in this assigned plugin lane. These assertions discard type evidence, obscure real owner contracts, and prevent clean enablement of the new rule across extensions/*.

Why This Change Was Made

This removes the 57 sites that can be repaired without runtime behavior changes: preserving discriminants and literal structure, carrying typed objects through construction, narrowing dynamic values at existing boundaries, using the actual exporter capability constraint, and deleting stale Discord constructor compatibility. It also preserves the Codex binding normalizer's canonical no-op identity path after ClawSweeper identified an eager-clone regression. Sites that depend on SDK-private state, nominal duplicate dependencies, incomplete public contracts, or new runtime parsing are intentionally left for the rule-enablement or owner follow-up work below.

AI-assisted: yes. The final committed branch passed two independent Codex autoreview runs with no accepted/actionable findings.

User Impact

No user-visible behavior changes. The affected plugin code keeps the same runtime values and flow while gaining stronger compile-time evidence. Production code shrinks by 25 lines.

Evidence

  • Baseline chained-assertion scan: 185 findings across 119 assigned files.
  • Final chained-assertion scan: 128 findings, exactly matching the inventory below (57 fixed; 85 intentional; 43 deferred).
  • Focused tests: 28 colocated test files across 8 Vitest shards, 537 tests passed.
  • Follow-up Codex-focused reruns after lint cleanups: 15 passed, 72 passed, and 36 passed.
  • ClawSweeper P3 follow-up: Codex session-binding identity test, 49 passed.
  • node scripts/check-changed.mjs: passed the extensions and extensionTests lanes. Crabbox had no ready ci-fast provider, so the repository wrapper used its documented serialized local fallback.
  • Exact-head CI run 31871454829: all relevant plugin/extension checks passed; unrelated check-lint-core-4 failed on pre-existing no-shadow errors in ui/src/test-helpers/control-ui-e2e.ts:2746 and :2753, reproduced unchanged on current origin/main (d2be00e171f63).
  • git diff --check: passed.
  • Production LOC: +138/-163 (net -25). Tests: +0/-0.
  • Autoreview before commit: clean, no accepted/actionable findings.
  • Autoreview on committed branch against origin/main: clean, no accepted/actionable findings.
  • ClawSweeper rank-up moves: canonical binding identity restored; direct sibling Codex protocol/source verification cited below.
  • Direct Codex contract inspection: sibling Codex app-server-protocol/src/protocol/v2/thread_data.rs:256, item.rs:226, account.rs:282, turn.rs:407, plus app-server emission/refresh paths in bespoke_event_handling.rs:1287 and external_auth.rs:67.

Intentional and deferred leftovers

  • extensions/amazon-bedrock-mantle/mantle-anthropic.runtime.ts:196 — intentional — duplicate Anthropic SDK copies are nominally incompatible because of private fields.
  • extensions/anthropic-vertex/stream-runtime.ts:44 — intentional — undici and DOM fetch return types come from distinct response type universes.
  • extensions/browser/src/browser/bridge-server.ts:155 — deferred — Express registrar alignment is owned by the shared route contract outside this assigned file set.
  • extensions/browser/src/browser/chrome-mcp-result.ts:87 — deferred — external data needs a full narrow parser; adding one here would alter runtime rejection semantics.
  • extensions/browser/src/browser/pw-session-actions.ts:122 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/pw-session-actions.ts:98 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/pw-session.page-cdp.ts:39 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/pw-session.page-cdp.ts:57 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/pw-session.page-cdp.ts:96 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/pw-tools-core.interactions.navigation.ts:276 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/pw-tools-core.interactions.navigation.ts:368 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/pw-tools-core.state.ts:51 — intentional — Playwright/CDP overload and receiver typing is narrower than the runtime API.
  • extensions/browser/src/browser/server-context.remote-tab-ops.harness.ts:170 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/browser/src/browser/server-context.remote-tab-ops.harness.ts:21 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/browser/src/browser/system-chrome-cookies.ts:289 — deferred — external data needs a full narrow parser; adding one here would alter runtime rejection semantics.
  • extensions/browser/src/cli/browser-cli-actions-input/register.batch.ts:71 — deferred — external data needs a full narrow parser; adding one here would alter runtime rejection semantics.
  • extensions/browser/src/server.ts:85 — deferred — Express registrar alignment is owned by the shared route contract outside this assigned file set.
  • extensions/codex/src/app-server/codex-app-server.test-fixtures.ts:80 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/codex/src/app-server/event-projector-tool-transcript.ts:585 — deferred — emitted content intentionally exceeds the public AgentMessage content union; public surface cannot change in this lane.
  • extensions/codex/src/app-server/event-projector-tool-transcript.ts:603 — deferred — emitted content intentionally exceeds the public AgentMessage content union; public surface cannot change in this lane.
  • extensions/codex/src/app-server/run-attempt-resources.ts:63 — deferred — removing sentinel initialization requires a lifecycle-state refactor across attempt ownership.
  • extensions/codex/src/app-server/run-attempt-resources.ts:64 — deferred — removing sentinel initialization requires a lifecycle-state refactor across attempt ownership.
  • extensions/codex/src/app-server/run-attempt-resources.ts:66 — deferred — removing sentinel initialization requires a lifecycle-state refactor across attempt ownership.
  • extensions/codex/src/app-server/run-attempt-runtime.ts:104 — deferred — supervised native model intentionally has unknown numeric limits that the public Model contract requires.
  • extensions/codex/src/app-server/thread-lifecycle.test-fixtures.ts:106 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/copilot/harness.ts:316 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/copilot/src/attempt-execution.ts:360 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/copilot/src/attempt-execution.ts:378 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/copilot/src/attempt-execution.ts:383 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/copilot/src/attempt-transcript-journal.ts:43 — deferred — transcript metadata needs an honest local message extension type.
  • extensions/copilot/src/byok-proxy.ts:144 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/copilot/src/isolated-completion.ts:252 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/copilot/src/runtime.ts:179 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/copilot/src/tool-bridge.ts:858 — intentional — Copilot SDK session/stream/tool types are nominal or version-skewed across package entrypoints.
  • extensions/deepinfra/doctor-contract-api.ts:101 — deferred — raw config migration/patch shape needs an owning deep-partial or typed normalization contract.
  • extensions/diagnostics-otel/src/service.ts:278 — intentional — trusted exporter health is a host-injected capability deliberately hidden from the public plugin context.
  • extensions/diagnostics-prometheus/src/service.ts:1048 — intentional — trusted exporter health is a host-injected capability deliberately hidden from the public plugin context.
  • extensions/discord/src/approval-native.ts:198 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/discord/src/components.modal.ts:22 — intentional — fallback constructor keeps partial test mocks loadable.
  • extensions/discord/src/monitor/gateway-plugin.ts:272 — intentional — Discord gateway lifecycle accesses dependency-private mutable socket/client state.
  • extensions/discord/src/monitor/gateway-plugin.ts:68 — intentional — Discord gateway lifecycle accesses dependency-private mutable socket/client state.
  • extensions/discord/src/monitor/gateway-plugin.ts:72 — intentional — Discord gateway lifecycle accesses dependency-private mutable socket/client state.
  • extensions/discord/src/monitor/message-handler.hydration.ts:45 — intentional — Discord message hydration reads dependency-private client/fallback fields.
  • extensions/discord/src/monitor/message-handler.hydration.ts:64 — intentional — Discord message hydration reads dependency-private client/fallback fields.
  • extensions/discord/src/monitor/provider.startup-log.ts:9 — intentional — startup diagnostics read a dependency-private reconnect counter.
  • extensions/discord/src/monitor/thread-bindings.state.ts:389 — deferred — JSON round-trip persistence needs an owner validator without changing serialization semantics.
  • extensions/discord/src/monitor/threading.starter.ts:64 — intentional — runtime isThread proof bridges the SDK's incomplete structural thread type.
  • extensions/feishu/src/monitor.test-mocks.ts:25 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/github-copilot/index.ts:172 — deferred — raw config migration/patch shape needs an owning deep-partial or typed normalization contract.
  • extensions/github-copilot/index.ts:184 — deferred — raw config migration/patch shape needs an owning deep-partial or typed normalization contract.
  • extensions/google/realtime-voice-provider.ts:356 — intentional — Google Live preview fields and JSON Schema are accepted at runtime but absent/stale in SDK types.
  • extensions/google/realtime-voice-provider.ts:904 — intentional — Google Live preview fields and JSON Schema are accepted at runtime but absent/stale in SDK types.
  • extensions/google/transport-stream.ts:1666 — intentional — provider stream wrapper preserves a narrower generic return across SDK versions.
  • extensions/googlechat/src/approval-native.ts:241 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/googlechat/src/google-auth.runtime.ts:279 — deferred — external data needs a full narrow parser; adding one here would alter runtime rejection semantics.
  • extensions/imessage/src/approval-native.ts:103 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/line/src/outbound.ts:85 — intentional — LINE SDK tuple/message union cannot represent the dynamically assembled runtime batch.
  • extensions/llm-task/index.ts:26 — deferred — factory parameter variance is owned by the public AnyAgentTool contract.
  • extensions/longcat/doctor-contract-api.ts:94 — deferred — raw config migration/patch shape needs an owning deep-partial or typed normalization contract.
  • extensions/matrix/src/approval-native.ts:255 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/matrix/src/matrix/actions/summary.ts:109 — deferred — external data needs a full narrow parser; adding one here would alter runtime rejection semantics.
  • extensions/matrix/src/matrix/client/logging.ts:95 — intentional — Matrix SDK root logger exposes loglevel methods only at runtime.
  • extensions/matrix/src/test-runtime.ts:131 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/microsoft-foundry/shared.ts:738 — deferred — raw config migration/patch shape needs an owning deep-partial or typed normalization contract.
  • extensions/msteams/src/attachments/shared.ts:525 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members.
  • extensions/msteams/src/sdk-proactive.ts:170 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members.
  • extensions/msteams/src/sdk-proactive.ts:181 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members.
  • extensions/msteams/src/sdk.ts:193 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members.
  • extensions/msteams/src/sdk.ts:198 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members.
  • extensions/msteams/src/sdk.ts:303 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members.
  • extensions/msteams/src/sdk.ts:319 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members. (2 findings)
  • extensions/msteams/src/sdk.ts:377 — intentional — Teams root/deep entrypoints and classes are nominally incompatible because of private SDK members. (2 findings)
  • extensions/qa-lab/src/bus-server.ts:213 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/bus-server.ts:218 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/bus-server.ts:223 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/bus-server.ts:228 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/bus-server.ts:233 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/bus-server.ts:238 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/bus-server.ts:243 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/bus-server.ts:282 — deferred — HTTP body needs route-specific runtime parsing; adding it would change malformed-input behavior.
  • extensions/qa-lab/src/harness-runtime.ts:31 — intentional — QA harness runtime/symbol metadata is intentionally structural and test-owned.
  • extensions/qa-lab/src/suite-runtime-agent-session.ts:450 — intentional — QA harness runtime/symbol metadata is intentionally structural and test-owned.
  • extensions/reef/protocol/envelope.ts:366 — deferred — persisted/wire record needs a complete owner parser; partial validation would change legacy behavior.
  • extensions/reef/protocol/guard.ts:126 — deferred — persisted/wire record needs a complete owner parser; partial validation would change legacy behavior.
  • extensions/reef/src/doctor-durable-state.ts:144 — deferred — persisted/wire record needs a complete owner parser; partial validation would change legacy behavior.
  • extensions/reef/src/doctor-durable-state.ts:230 — deferred — persisted/wire record needs a complete owner parser; partial validation would change legacy behavior.
  • extensions/signal/src/approval-native.ts:76 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/slack/src/approval-native.ts:172 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/slack/src/monitor/events/agent.ts:20 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/slack/src/monitor/events/assistant.ts:133 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/slack/src/monitor/events/messages.ts:396 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/slack/src/monitor/slash.ts:1065 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/slack/src/monitor/slash.ts:1144 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/slack/src/monitor/slash.ts:1150 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/slack/src/progress-blocks.ts:38 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/slack/src/streaming.ts:367 — intentional — Slack SDK event/task/stream internals are runtime-supported but missing or stale in published types.
  • extensions/sms/src/channel.ts:457 — deferred — runtime adapter erasure needs an owning channel-runtime contract.
  • extensions/synology-chat/src/channel.ts:386 — deferred — plugin construction needs an owning structural plugin type.
  • extensions/synology-chat/src/test-http-utils.ts:13 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/synology-chat/src/test-http-utils.ts:56 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/telegram/src/approval-native.ts:130 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/telegram/src/client-fetch.ts:30 — intentional — grammy node-fetch and global DOM fetch use incompatible Response classes.
  • extensions/telegram/src/client-fetch.ts:34 — intentional — grammy node-fetch and global DOM fetch use incompatible Response classes.
  • extensions/telegram/src/doctor-contract.ts:354 — deferred — raw config migration/patch shape needs an owning deep-partial or typed normalization contract.
  • extensions/telegram/src/fetch.ts:150 — intentional — Node DNS/undici overloads differ from the unified fetch/lookup runtime contract.
  • extensions/telegram/src/fetch.ts:578 — intentional — Node DNS/undici overloads differ from the unified fetch/lookup runtime contract.
  • extensions/telegram/src/outbound-media.ts:151 — intentional — Telegram method/message unions are selected and checked dynamically at runtime.
  • extensions/telegram/src/telegram-ingress-supersede-auth.ts:69 — intentional — Telegram method/message unions are selected and checked dynamically at runtime.
  • extensions/tlon/src/urbit/story.ts:119 — deferred — synthetic inline metadata needs an explicit local discriminated union.
  • extensions/tlon/src/urbit/story.ts:234 — deferred — synthetic inline metadata needs an explicit local discriminated union.
  • extensions/twitch/src/test-fixtures.ts:12 — intentional — test/harness fake supplies only the runtime members exercised by the fixture.
  • extensions/voice-call/src/webhook.ts:317 — deferred — partial/full config alignment needs an owning config contract.
  • extensions/whatsapp/src/approval-native.ts:75 — intentional — lazy approval adapter erases invariant generic payload types at the core boundary.
  • extensions/whatsapp/src/inbound/group-metadata-cache.ts:241 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/whatsapp/src/inbound/group-metadata-cache.ts:248 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/whatsapp/src/inbound/group-metadata-cache.ts:260 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/whatsapp/src/inbound/message-delivery.ts:683 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/whatsapp/src/inbound/socket-session.ts:415 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/whatsapp/src/inbound/socket-session.ts:450 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/whatsapp/src/session.ts:421 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/whatsapp/src/session.ts:533 — intentional — Baileys event emitter/websocket callback overloads are narrower than the runtime hooks.
  • extensions/workboard/src/store-core.ts:91 — deferred — one physical fallback store multiplexes typed namespaces; repair needs persistence-owner redesign.
  • extensions/workboard/src/store-core.ts:95 — deferred — one physical fallback store multiplexes typed namespaces; repair needs persistence-owner redesign.
  • extensions/workboard/src/store-core.ts:97 — deferred — one physical fallback store multiplexes typed namespaces; repair needs persistence-owner redesign.
  • extensions/zalo/src/webhook-spool.ts:112 — deferred — external data needs a full narrow parser; adding one here would alter runtime rejection semantics.
  • extensions/zalouser/src/zca-client.ts:12 — intentional — dynamic zca-js module namespace differs across published module formats.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 15, 2026 07:13
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 4:36 AM ET / 08:36 UTC.

ClawSweeper review

What this changes

The branch removes selected chained TypeScript assertions across extensions by using typed construction, narrowing, and direct structural values.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open. The prior P3 binding-identity finding is fixed, but this maintainer-labeled PR still needs direct Codex-source contract review before a merge recommendation.

Priority: P3
Reviewed head: 511e8cc6d80889493418f15b413a260c48f6a5ca
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The prior identity issue is repaired and non-Codex extension checks found no defect, but direct Codex contract review remains unavailable.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-owned typing refactor has no changed user-visible flow requiring contributor real-behavior proof.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned typing refactor has no changed user-visible flow requiring contributor real-behavior proof.
Evidence reviewed 5 items Prior finding fixed: The normalizer now receives the original binding and returns the stored row unchanged when no legacy fingerprint requires rewriting.
Existing binding coverage: Current tests cover legacy hashing and canonical no-rehash values, though they do not assert object identity.
Discord constructor contract: The removed request workaround matches the local RateLimitError constructor, which accepts only response and rate-limit body.
Findings None None.
Security None None.

How this fits together

OpenClaw extensions translate provider, channel, and tool APIs into the shared plugin SDK. This PR refines typing at those boundaries while intending to preserve runtime data flow.

flowchart LR
  A[Provider or channel API] --> B[Extension adapter]
  B --> C[Typed boundary conversion]
  C --> D[Plugin SDK contract]
  D --> E[Agent or channel runtime]
Loading

Decision needed

Question Recommendation
Should this maintainer-owned Codex refactor wait for a reviewer with the required sibling Codex checkout to complete the protocol-contract pass? Complete the Codex source pass: Have a reviewer with the sibling Codex checkout validate the changed app-server protocol adaptations before merge.

Why: Repository policy requires the acting reviewer to inspect Codex source before a Codex-related merge verdict, and that source is unavailable here.

Before merge

  • Resolve merge risk (P1) - Codex protocol-facing conversions cannot be cleared without the direct sibling Codex-source review required by repository policy.
  • Resolve merge risk (P1) - The local checkout is one commit behind the supplied current-main SHA, and partial-clone hydration failed without DNS; this review cannot claim a complete current-main comparison.
  • Complete next step (P2) - A reviewer with sibling Codex source must complete the direct contract check; no safe mechanical repair is identified.
Agent review details

Security

None.

PR surface

Source -25. Total -25 across 34 files.

View PR surface stats
Area Files Added Removed Net
Source 34 138 163 -25
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 34 138 163 -25

Review metrics

Metric Value Why it matters
Production versus tests production +138/-163 (net -25); tests +0/-0 This broad extension cleanup is net-negative production code but adds no regression tests.

Stored data model

Persistent data-model change detected: serialized state: extensions/anthropic/session-catalog-history.ts, serialized state: extensions/codex/src/app-server/session-binding.ts, vector/embedding metadata: extensions/codex/src/app-server/event-projector-snapshot.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify the Codex protocol boundary (recommended)
    Check the changed token-refresh and terminal-turn conversions against sibling Codex source before merge.
  2. Pause pending contract source
    Keep the refactor open until a direct Codex contract pass is possible.

Technical review

Best possible solution:

Validate the changed Codex app-server request and response conversions against the sibling Codex source, then merge once exact-head checks are green.

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

Not applicable: this is a static type-refactoring PR, not a report of user-visible failure.

Is this the best way to solve the issue?

Unclear: the identity repair is appropriate, but the broader Codex protocol conversions need direct upstream-contract inspection before they can be called the best solution.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: The stated change is a behavior-preserving static type cleanup.
  • merge-risk: 🚨 compatibility: The PR changes Codex app-server protocol adaptation code whose upstream contract remains unverified in this review environment.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned typing refactor has no changed user-visible flow requiring contributor real-behavior proof.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current follow-up and the recent main commit containing the binding normalizer. (role: recent area contributor; confidence: high; commits: 2e90d6731212, 511e8cc6d808; files: extensions/codex/src/app-server/session-binding.ts)
  • Vincent Koc: Authored the predecessor commits that added and converged legacy binding fingerprint handling. (role: introduced legacy-fingerprint behavior; confidence: medium; commits: 6b688011ba10, b4db960616be; files: extensions/codex/src/app-server/session-binding.ts)
  • joshavant: Recent Codex binding and authority fixes provide adjacent ownership context. (role: recent adjacent contributor; confidence: medium; commits: a345ede6851c, bb873c8806d6; files: extensions/codex/src/app-server/session-binding.ts)

Rank-up moves

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

  • Validate Codex app-server conversions against sibling Codex source.
  • Wait for the remaining exact-head checks before merge.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-15T07:20:15.601Z sha 51b2aa4 :: found issues before merge. :: [P3] Preserve canonical binding identity on the no-op path
  • reviewed 2026-08-15T07:26:59.813Z sha 51b2aa4 :: found issues before merge. :: [P3] Preserve canonical binding identity on the no-op path

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Aug 15, 2026
@steipete
steipete merged commit 5d60123 into main Aug 15, 2026
131 checks passed
@steipete
steipete deleted the steipete/chained-assert-w2 branch August 15, 2026 08:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…aw#124079)

* refactor(types): remove chained assertions in extensions

* fix(codex): preserve canonical binding identity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: matrix Channel integration: matrix channel: msteams Channel integration: msteams extensions: amazon-bedrock extensions: anthropic extensions: browser extensions: codex extensions: diagnostics-otel Extension: diagnostics-otel extensions: firecrawl extensions: groq extensions: ollama extensions: onepassword 1Password plugin extensions: opencode maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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