Repository navigation
refactor: consolidate remaining coercion helpers - #122020
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
6fac3b2 to
d3ae758
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 1:04 PM ET / 17:04 UTC. ClawSweeper reviewWhat this changesThe branch centralizes coercion logic in normalization-core and Plugin SDK facades, adds a declaration guard, repairs malformed Control UI draft parsing, and updates package/Docker dependency handling. Merge readinessKeep open for maintainer review. The available patch evidence addresses the prior Anthropic bound finding and fixes a real Control UI null-dereference, but the exact PR head and the required sibling Codex contract source were unavailable locally. Priority: P2 Review scores
Verification
How this fits togetherNormalization helpers convert external and persisted values for core, plugins, scripts, and the Control UI. Plugin SDK facades expose selected helpers to plugins, including the Codex app-server integration and packaged runtime dependencies. flowchart LR
A[Persisted and external values] --> B[Core, plugins, scripts, and UI]
B --> C[Normalization helpers]
C --> D[Plugin SDK facades]
C --> E[Control UI draft reader]
D --> F[Plugin and package consumers]
E --> G[Safe new-session display]
Decision needed
Why: Repository policy requires direct sibling Codex-source inspection for this dependency-backed extension path, and the available review environment cannot obtain it. Before merge
Agent review detailsSecurityNone. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Review the exact head in an environment containing the matching Codex source, confirm the app-server and package/Docker contracts, then retain the canonical helper replacements and explicit SDK compatibility exports. Do we have a high-confidence way to reproduce the issue? Yes for the Control UI defect: current main dereferences null draft-node entries in readDraftNodes, and the supplied regression case exercises that path. The full branch could not be run or inspected because its commit object was unavailable locally. Is this the best way to solve the issue? Unclear overall: canonical helper ownership is the right direction and the prior Anthropic omission appears addressed, but the exact implementation cannot be approved without the missing Codex dependency-contract and PR-head inspection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6792921deabe. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
acd862e to
305f230
Compare
|
@clawsweeper re-review The reported Anthropic bound regression is already resolved in the reviewed exact head.
The existing catalog tests already prove valid project and Desktop cwd values survive those paths, including Exact-head CI run https://github.com/openclaw/openclaw/actions/runs/31503561832 completed successfully, including |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
# Conflicts: # docs/.generated/plugin-sdk-api-baseline.jsonl
# Conflicts: # docs/.generated/plugin-sdk-api-baseline.jsonl
# Conflicts: # docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json # docs/.generated/plugin-sdk-api-baseline/agent-harness.json # docs/.generated/plugin-sdk-api-baseline/agent-runtime.json # docs/.generated/plugin-sdk-api-baseline/channel-core.json # docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json # docs/.generated/plugin-sdk-api-baseline/channel-message.json # docs/.generated/plugin-sdk-api-baseline/channel-outbound.json # docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json # docs/.generated/plugin-sdk-api-baseline/core.json # docs/.generated/plugin-sdk-api-baseline/discord.json # docs/.generated/plugin-sdk-api-baseline/inbound-reply-dispatch.json # docs/.generated/plugin-sdk-api-baseline/meeting-runtime.json # docs/.generated/plugin-sdk-api-baseline/plugin-entry.json # docs/.generated/plugin-sdk-api-baseline/plugin-runtime.json # docs/.generated/plugin-sdk-api-baseline/provider-catalog-runtime.json # docs/.generated/plugin-sdk-api-baseline/tool-plugin.json # docs/.generated/plugin-sdk-api-baseline/webhook-ingress.json
# Conflicts: # docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json # docs/.generated/plugin-sdk-api-baseline/agent-harness.json # docs/.generated/plugin-sdk-api-baseline/channel-core.json # docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json # docs/.generated/plugin-sdk-api-baseline/channel-message.json # docs/.generated/plugin-sdk-api-baseline/channel-outbound.json # docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json # docs/.generated/plugin-sdk-api-baseline/core.json # docs/.generated/plugin-sdk-api-baseline/discord.json # docs/.generated/plugin-sdk-api-baseline/inbound-reply-dispatch.json # docs/.generated/plugin-sdk-api-baseline/meeting-runtime.json # docs/.generated/plugin-sdk-api-baseline/plugin-entry.json # docs/.generated/plugin-sdk-api-baseline/plugin-runtime.json # docs/.generated/plugin-sdk-api-baseline/provider-catalog-runtime.json # docs/.generated/plugin-sdk-api-baseline/tool-plugin.json # docs/.generated/plugin-sdk-api-baseline/webhook-ingress.json
# Conflicts: # docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json # docs/.generated/plugin-sdk-api-baseline/agent-harness.json # docs/.generated/plugin-sdk-api-baseline/agent-runtime.json # docs/.generated/plugin-sdk-api-baseline/channel-core.json # docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json # docs/.generated/plugin-sdk-api-baseline/channel-inbound.json # docs/.generated/plugin-sdk-api-baseline/channel-message.json # docs/.generated/plugin-sdk-api-baseline/channel-outbound.json # docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json # docs/.generated/plugin-sdk-api-baseline/core.json # docs/.generated/plugin-sdk-api-baseline/discord.json # docs/.generated/plugin-sdk-api-baseline/inbound-reply-dispatch.json # docs/.generated/plugin-sdk-api-baseline/meeting-runtime.json # docs/.generated/plugin-sdk-api-baseline/plugin-entry.json # docs/.generated/plugin-sdk-api-baseline/plugin-runtime.json # docs/.generated/plugin-sdk-api-baseline/provider-catalog-runtime.json # docs/.generated/plugin-sdk-api-baseline/tool-plugin.json # docs/.generated/plugin-sdk-api-baseline/webhook-ingress.json
|
Maintainer owner decision: the remaining ClawSweeper verification request is satisfied for exact head I directly inspected sibling
The changed OpenClaw Codex guards preserve those contracts. The direct AI dependency and packed Docker graph are also proven: No ClawSweeper finding remains; the requested owner verification is complete. |
|
Merged via squash.
|
What Problem This Solves
The first coercion-helper consolidation in #121366 established shared normalization owners, but a second semantic-lookalike inventory still found 108 governed declarations across core, packages, the Control UI, plugins, and scripts. Those copies encoded subtly different string, record, timestamp, numeric, and error behavior; one Control UI reader also crashed when persisted draft nodes contained
nullor primitive entries.Why This Change Was Made
This semantic-lookalike round two moves the remaining compatible call sites onto precise canonical helpers instead of broad, lossy coercion aliases:
parseDateStringTimestampMsaccepts strings only and usesDate.parse, including its semantics for"0"and"2026";parseDateFirstTimestampMspreserves every finite numeric value unchanged and appliesDate.parseonly to strings;The AST guard now catches direct aliases plus function, variable, method, field, and object-property declarations, including authored files with fixture-like names. It retains 12 exact dependency-free, copied, generated, or serialized carve-outs. The inventory is now 36 declarations: 24 canonical owners and 12 explicit exceptions. The two additional canonical owners live in the existing dependency-free script error seam because pre-build tooling cannot load an unbuilt private workspace package.
Public Plugin SDK compatibility remains intact for the shipped
speech/speech-coreasObjectnames and thestring-coerce-runtimeasOptionalObjectRecord/asNullableObjectRecordnames. The deliberate removal ofparseDateTimestampMsis not a shipped break: it was introduced by #121366 infa03d9b9134340aa4c7147e136c40df7d90740c4, nov*release tag contains that commit, and its numeric-token-first semantics are not equivalent to either replacement. The public SDK grows by an intentional net +2 exports / +2 callables while wildcard re-exports shrink from 79 to 77.The AI package now owns its normalization dependency directly. Docker packaging promotes publishable packed dependencies but deliberately skips workspace-private
0.0.0-privatedependencies, keeping the source CLI and packed tarball dependency graphs correct.User Impact
This is primarily a maintenance and correctness refactor. Operators should see unchanged coercion behavior at migrated boundaries, while the New Session UI now safely ignores malformed
nulland primitive draft nodes instead of crashing. Plugin authors retain every shipped compatibility name, and packaged builds no longer require private workspace packages to appear as root runtime dependencies.Evidence
4c6f9162f22e96d5fb8f8667374d7cfbe43bc78f.origin/main: production/tooling 173 files, +797/-1161 (net -364); tests/support 42 files, +394/-392 (net +2); generated per-entrypoint Plugin SDK baseline 19 files, +19/-19 (net 0). Total: 234 files, +1210/-1572 (net -362).parseDateTimestampMshad shipped; directv*release-tag ancestry disproves that premise, so the unshipped and semantically incorrect alias remains removed.git diff --checkpasses.CHANGELOG.mdis intentionally unchanged; release generation owns it.