Repository navigation
[2026.10.9] fix(discord): early-reject oversized vendored Zod input - #187296
Conversation
Passive macOS Gateway stops now preserve an absent current-profile service definition without invoking uninstall, while explicit low-level ghost recovery remains available. Release adaptation: the 2026.10.8 backport of #180390 removed the absent-plist guard from GatewayLaunchAgentManager's disable path without main's follow-up, so every passive stop with no LaunchAgent plist ran `openclaw gateway uninstall` (mac validation: GatewayProcessManagerTests "pause preserves unretainable services" [absent]). Stable has no migration-pending custody or `.authority` wrapper, so the guard checks `custody.definition.plist` directly. Mac-only post-tag fix; npm, Docker and Linux bytes are unaffected. (cherry picked from commit cb10ec4)
Port local adaptation 0c38cbb (roboclaw-bot, #187289) to release/2026.10.8. Locally adapt Colin McDonnell Zod a0ebf970f2d752e5f58527cd2942ff48be4f46bd (#6652); not an upstream OpenClaw cherry-pick or major migration. Test scaffolding: 8e6f7bd (roboclaw-bot), preserved in f0a0c53. Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. What this changesThis PR patches Discord’s bundled Zod parser to reject oversized arrays and sets before processing their elements. Example: Parse six buttons using the SDK’s five-button ShareInteraction limit.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it provides a focused, maintainer-authored mitigation for a verified dependency parser defect, with no discrete patch bug found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Discord plugin builds the embedded SDK into its Activity browser asset; SDK schemas validate values using the package’s vendored Zod implementation. flowchart LR
A[Discord plugin dependency] --> B[Exact version pnpm patch]
B --> C[SDK browser bundler]
C --> D[Activity browser asset]
D --> E[Vendored schema parser]
E --> F[Parsed value or size error]
Technical reviewBest possible solution: Keep the exact-version parser repair within the existing package-patch and SDK-build owners until a compatible upstream SDK supplies it. Do we have a high-confidence way to reproduce the issue? Published SDK source shows upper-bound failures continuing into element traversal, and its ShareInteraction schema supplies a concrete five-button bound; no reproduction was run during this read-only review. Is this the best way to solve the issue? The six early-return branches fix the owning parser without replacing its API or adding competing validation, while exact-version registration bounds the dependency change. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 54818f9e6756. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +208, Docs +36, Config +1, Other +60. Total +305 across 6 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 29, 2026, 12:40 AM ET / 04:40 UTC. |
Co-authored-by: RomneyDa <[email protected]>
Scope
Draft targeting
release/2026.10.8(observed base5413218d77df39edac0ee99b7838d7bac519002a, train-local qualification). Focused mitigation for the Zod parser embedded inside Discord’s browser SDK, not a broad dependency refresh or a claim of clean dependency audits.The published
@discord/[email protected]bundles its own Zod 3 implementation. Updating the separately installed Zod package does not change those bytes. A baseline regression invokes element refinements on an oversized array; the patch rejects the collection before element or outer-refinement work.Implementation and provenance
a0ebf970f2d752e5f58527cd2942ff48be4f46bd(colinhacks/zod#6652), referenced by GHSA-mrhx-c7xc-m3w5.invalid_union; regression coverage and the patch documentation make that compatibility change explicit. The bundled Zod-3 map API has no upper-size constraint.8e6f7bd28af9e7bebf03ff08bf0001e4fc7561be, authored byroboclaw-bot, preserved inf0a0c53aa23b80bd68267fc48cfdda020db77c26; this is not an upstream OpenClaw fix being backported. New early-rejection and compatibility coverage belongs to this isolated local adaptation.81e49dfa871e935641d9b9591ed789e837dc89e1), remains open; it is not a published compatible fix. This small patch avoids the previous whole-parser replacement.Validation
node scripts/run-vitest.mjs run test/scripts/discord-sdk-zod.test.ts: 7 tests pass, including both SDK entrypoints and the actual production browser build.node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.root.scripts.json --noEmit: pass.pnpm install --frozen-lockfile --ignore-scripts, package-patch guard andgit diff --check: pass. Native lifecycle / packaged-plugin qualification is not claimed.patches/README.md.Boundaries / remaining gates
This is the stable train-local backport of #187289 at exact source commit 0c38cbb (author: roboclaw-bot). The 58-line patch and 208-line test file are preserved exactly. Registration is adapted to this train and its lockfile is regenerated locally. Original source/proof and #186177 remain untouched; no extended-stable or A2UI work is included.
Both the Discord SDK regression file and owning package-patch guard tests pass: 15 tests total. The direct matrix passes 48 cases on this train's installed SDK. Regenerated patch matches after normalizing optional Git hunk function labels. All 196 published files were compared: only the two documented parser files differ. These are bounded checks, not a full repository build or native lifecycle/packaged-plugin qualification.
Keep DRAFT pending canonical independent full-context review and hosted required checks. No RFR, merge, forcepush, release, audit-exception or gate changes. Root Zod remains a separate advisory scope.
Initial package-patch fixtures failed because inherited GIT_CONFIG_COUNT survived while fixture helpers removed its keys; the unchanged 15 tests passed with env -u GIT_CONFIG_COUNT. Failed and corrected receipts are retained separately.