Repository navigation
fix(security): stop Endor errors failing Endor-only scan jobs - #4488
Conversation
Endor-only jobs (added in #4411) let an Endor error fail the whole job, so most community code-plugin publishes recorded a failed scan job. Save a failed Endor analysis instead, as the full scan path already does, and fix the three causes seen in Production: - make the copied artifact readable by the container's node user (owner-only files failed with Permission denied); - skip pnpm packages, which endorctl cannot scan without pnpm; - raise the Endor report limit from 8 MiB to 64 MiB.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🦞👀 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. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Codex review: needs maintainer review before merge. What this changesThis PR saves Endor errors as failed analyses, makes copied artifacts readable, skips unsupported pnpm packages, and increases the report limit. Example: An automatic community code-plugin job runs Endor, which exits with code 1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — suspected predecessor, not a causality claim: source commit Possible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: current main still fails Endor-only jobs on scanner errors, and this maintainer-authored PR repairs that behavior. The prior pnpm-message finding is resolved; no actionable patch defects remain. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe security worker consumes leased release jobs and verified artifacts, runs Endor in an isolated container, and submits bounded reports through the backend completion action for display on the security audit page. flowchart LR
A[Leased release job] --> B[Verified artifact workspace]
B --> C[Disposable readable copy]
C --> D[Isolated Endor scanner]
D --> E[Bounded report or failed analysis]
E --> F[Lease checked completion]
F --> G[Release security audit]
Technical reviewBest possible solution: Share report-only error handling between both worker paths while retaining isolated scanning, bounded reports, and canonical lease-checked persistence. Do we have a high-confidence way to reproduce the issue? Current-main source shows that a nonzero Endor exit throws through the Endor-only branch into job failure; the added regression exercises this input with an executable fake Docker command, but no tests were run during this read-only review. Is this the best way to solve the issue? Best-fix verdict: best for the stated job-outcome bug; sharing the existing full-scan handler avoids divergent semantics, while adding pnpm to the scanner image would require separate credential-isolation work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6fe2dc0c9503. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
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 HistoryReview history (1 earlier review cycle)
Reviewed November 9, 2026, 1:02 AM ET / 06:02 UTC (Revision 2). |
|
/clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What this PR does
Since Nov 7, most community code-plugin scan jobs in Production have been recorded as failed jobs. This PR makes those jobs complete and store an Endor result, and it fixes the three causes of the failures.
scanMode: "endor-report-only") for automatic plugin publishes. In that path, an Endor error failed the whole job. The full scan path already saves an Endor error on the release as afailedanalysis. Both paths now share one helper,runEndorReport, that does that.nodeuser. Without that, files the artifact stored as0600failed withPermission denied.endorctlneeds pnpm for a package with apnpm-lock.yamland refused to start (host-check-failure). The scanner image only isolates npm and Yarn, so these are now saved asskipped: Endor cannot scan pnpm packages yet.Moderation and publication are unaffected, before and after: Endor-only jobs can only write
endorAnalysis.Proof
From the diagnostics artifacts of four Production worker runs on Nov 9 (
42565938606,42561922928,42564563877,42563274816), there were 87 plugin release jobs:maintodayunable to build target package)failedhost-check-failure: Cannot access the "pnpm" commandskipped(pnpm)cp: cannot open '/workspace/./openclaw.plugin.json' … Permission deniedTests:
endorAnalysis: { status: "failed" }. Run againstmain's worker, it fails:expected { completed: false, …(2) } to deeply equal { completed: true, …(2) }. With this PR it passes.0600file in a0700directory is readable after the copy; a package withpnpm-lock.yamlis skipped without starting Docker.run-endor-plugin-scan,endor/scan,run-codex-scan-worker-clawscanandrun-codex-scan-worker, 141 tests.bun run ci:staticandtsrs --noEmitalso pass.Not done here: running pnpm packages through Endor. That needs pnpm in the scanner image, behind the same credential-stripping shim as npm and Yarn, plus a rerun of the isolation harness. The dependency-resolution failures are genuine: Endor can't build those packages, so they're stored as
failed, not as clean.