Skip to content

feat: give plugin scanner commands a 30-minute budget - #151

Merged
Patrick-Erichsen merged 1 commit into
mainfrom
plugin-scanner-timeout
Nov 6, 2026
Merged

Patrick-Erichsen merged 1 commit into
mainfrom
plugin-scanner-timeout

Conversation

@Patrick-Erichsen

Copy link
Copy Markdown
Collaborator

Why

A plugin target is audited as one whole artifact: compiled output, embedded skills and hooks. The aig-mcp agent loop on a large plugin can exceed the 20-minute per-scanner budget. ClawHub's approved plugin rollout uses a 30-minute plugin scanner budget. The runner hard-coded 20 minutes for every scanner, and the CLI exposes no timeout flag, so a worker-side change alone could not raise it.

What changes

  • The runner now chooses the per-scanner command budget by target kind: 30 minutes for OpenClaw plugin targets, 20 minutes for skill, file and URL targets (unchanged).
  • aig-mcp's own fallback budget is 30 minutes, since it only scans plugins.
  • The judge (20 min) and overview (5 min) budgets are unchanged.
  • There is no new flag or configuration.
  • Cancellation still flows through the same context deadline on the host and Docker paths. The rejection of failed model calls and exhausted iterations, the read-only tools and the runtime patch are untouched.
  • The runtime image is unchanged (runtime tree ddfec1285eaf19beb3043e9e5ad043a0d274cb53), so the production contract binding still applies.

Consumers need outer headroom for the worst case: 30 (scanner) + 20 (judge) + 5 (overview) minutes. The whole pipeline is not bounded at 30 minutes.

Before / after

Test main e2d64e1 this PR
TestPluginScannersGetThirtyMinutesAndSkillScannersKeepTwenty FAIL: plugin aig-mcp-scan timeout = 20m0s, want 30m0s PASS: plugin 30m, skill aig-skill-scan 20m
TestProfilePluginSelectionUsesPluginBudget (clawhub shape: skill scanners plus pluginScanners: [aig-mcp]) FAIL: plugin run timeouts = map[aig-mcp-scan:20m0s] PASS: plugin run only aig-mcp-scan at 30m; skill run only aig-skill-scan at 20m
TestScannerTimeoutDependsOnlyOnTargetKind n/a (new helper) PASS: plugin 30m, skill and URL 20m, aig-mcp default 30m
TestDockerSandboxPassesPluginBudgetToTheHost n/a PASS: the Docker invocation gets 30m

go vet ./..., go test -count=1 ./... and make docs-site pass.

A plugin target is audited as one whole artifact, and aig-mcp's agent
loop over compiled output and embedded skills can exceed the 20-minute
per-scanner budget. Scanner commands run against plugin targets now get
30 minutes; skill, file and URL targets keep 20 minutes, and the judge
and overview budgets are unchanged. Cancellation still flows through the
same context deadline in both the host and Docker paths.
@Patrick-Erichsen
Patrick-Erichsen requested a review from a team as a code owner November 6, 2026 01:43
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. 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. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Give scanner commands for OpenClaw plugin targets 30 minutes while retaining 20 minutes for other targets.

Example: A plugin audit needs 25 minutes and has no shorter caller deadline.

  • Before: The scanner command is cancelled after 20 minutes.
  • After: The scanner command can finish within its 30-minute budget.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-verified implementation with passing exact-head checks; behavioral evidence is limited to in-process tests rather than the shipped CLI.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor proof gate; its supplied evidence covers target selection and host/Docker budget forwarding through recording runners, with no claimed live demonstration of the longer deadline.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Large whole-plugin audits can be cancelled by ClawScan's 20-minute command deadline before completing.
Reason: The collaborator who authored the existing plugin scanner records the direction here, and the small shared-runner change addresses the stated limitation without adding configuration or changing judge policy.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR supplies a useful target-specific budget change that main does not contain; no actionable correctness or security defect was found.

Priority: P2
Reviewed head: 64f5adcbe15d296cd5abe4d8cd94231d74e1ce75

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied timeout evidence exercises Run with recording command runners rather than showing a shipped CLI plugin audit continuing beyond 20 minutes.
Agent review details

How this fits together

The runner resolves a CLI target, selects its scanner adapters, and passes command budgets through the host or Docker runner before recording raw scanner evidence.

flowchart LR
  A[CLI target] --> B[Resolve target kind]
  B --> C[Select scanner budget]
  C --> D[Scanner adapter]
  D --> E[Host or Docker command runner]
  E --> F[Raw scanner artifact]
Loading

Technical review

Best possible solution:

Land the target-kind budget selection through the existing runner while preserving caller deadlines and scanner failure handling.

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

Main source demonstrably supplies a 20-minute plugin command budget; the PR reports failing base tests for that value, but no long-running audit was executed during this review.

Is this the best way to solve the issue?

The change belongs in the shared runner because a worker cannot extend its hard-coded child-command budget, and target-kind selection preserves the profile-independent contract without introducing another setting.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e2d64e17e641.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change and current-main comparison: The pinned diff changes Run's scanner timeout from a fixed 20 minutes to target-kind selection and changes only aig-mcp's zero-value fallback to 30 minutes; the original main blobs retain 20 minutes. (internal/runner/runner.go:606, 64f5adcbe15d)
  • Existing cancellation owner retained: boundCommandRunner caps the supplied budget to any earlier caller deadline, Docker forwards that budget to its host runner, and defaultCommandRunner applies context.WithTimeout and exec.CommandContext. (internal/runner/lifecycle.go:35, 64f5adcbe15d)
  • Owner direction and supplied validation: The complete PR body records the collaborator's decision to increase plugin budgets without adding configuration, reports base/head regression results and full Go, vet and docs checks, and acknowledges outer pipeline headroom. (64f5adcbe15d)
  • Exact-head checks: Eight checks succeeded and two were skipped at the reviewed head; none failed. (64f5adcbe15d)
  • Feature history and related implementation: The original scanner execution commit introduced the fixed budget, and merged feat: audit OpenClaw plugins with the A.I.G MCP scanner #149 added the plugin-only adapter with the same fallback; both and subsequent runner refactors identify Patrick Erichsen as the central area contributor. (internal/runner/aig_mcp_scanner.go:159, 56d17aaa423c)
  • Repository policy and inspection limits: Read the complete root AGENTS.md; no nested governing AGENTS.md, maintainer notes, or pr-simplify skill was found. The explicit single-reviewer, read-only instructions supersede helper and execution requirements. Some historical object reads failed with lazy fetching disabled; current and pinned base blobs were available. No tests or review helper ran, and the checkout remains clean. (AGENTS.md, 64f5adcbe15d)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A focused improvement for long-running plugin audits, without evidence of an urgent released regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A focused improvement for long-running plugin audits, without evidence of an urgent released regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 5, 2026, 8:56 PM ET / November 6, 2026, 01:56 UTC.

@Patrick-Erichsen
Patrick-Erichsen merged commit bc69d8f into main Nov 6, 2026
13 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the plugin-scanner-timeout branch November 6, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant