Add batched POST /chromium/configure with optional start_url#244
Add batched POST /chromium/configure with optional start_url#244hiroTamada wants to merge 3 commits into
Conversation
Single multipart request can apply display, policies, flags, extensions, and profile changes with one Chromium restart, then navigate via CDP after DevTools is ready. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop DETACHED run-docker mode, the powerset runner script, and related AGENTS.md notes. Co-authored-by: Cursor <cursoragent@cursor.com>
Monitoring Plan:
|
Batching keeps a single Chromium restart while preserving Kernel's configure order, propagating required-step failures, and keeping start_url best-effort. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2f7e5d6. Configure here.
| n++ | ||
| } | ||
| return n | ||
| } |
There was a problem hiding this comment.
Unnecessary stop/restart from inconsistent actionable checks
Medium Severity
cfgActionables uses policiesContentNonEmpty for policies (deep content check) but flagsNonEmpty for flags (shallow string check). A flagsContentNonEmpty helper exists and is tested but is never called in production code. This means inputs like {"flags":[]} pass the "at least one actionable" gate, and chromiumNeedsStopCycle (also using flagsNonEmpty) triggers a full Chromium stop cycle, only for chromiumValidateFlags to reject the input with a 400. Chromium is then unnecessarily restarted via the safety defer.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2f7e5d6. Configure here.
| Phase: oapi.NavigatePhase, | ||
| Message: msg, | ||
| }) | ||
| } |
There was a problem hiding this comment.
Multiple unused functions introduced as dead code
Low Severity
Several new functions have no callers anywhere in the codebase: cfg500Configure, cfg500Navigate, chromiumDisplayHasSizedRequest in chromium_configure.go, and the exported NavigateFirstPage in cdpclient.go. These are dead code that adds maintenance burden. chromiumDisplayHasSizedRequest also has a logic issue where its int type assertion branch can never succeed since json.Unmarshal into map[string]interface{} always produces float64 for numbers.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 2f7e5d6. Configure here.


Summary
POST /chromium/configure: one multipart request to batch display sizing, Chrome policies, Chromium flags, profile archive, extensions, and optionalstart_urlnavigation after a single Chromium restart.cdpclient.NavigateFirstPagefor post-readyPage.navigate(flattened CDP session, waits for load /domcontentloaded). Fixes concurrent WebSocket reads that caused flaky navigate failures.applyExtensionZipItemsused by configure and existing upload-and-restart.start_urltests; local runner script andDETACHED=1headlessrun-docker.shfor manual API use.make test: e2e package timeout raised to 120m (full suite exceeds default 10m).Test plan
go vet ./...and unit tests (go testexcluding/e2e)./scripts/run-local-chromium-configure-powerset.sh(31 permutations + start_url variants) against locally built headless imagego test -race -timeout 120m ./e2e/withE2E_CHROMIUM_HEADLESS_IMAGE/E2E_CHROMIUM_HEADFUL_IMAGEpointing at images built from this branchMade with Cursor
Note
Medium Risk
Adds a new multipart endpoint that can stop/start Chromium and mutate policies, flags, extensions, display, and user profile in one call; failures can leave partial side effects. Also changes Chromium supervisorctl invocation and CDP navigation behavior, which may impact runtime stability and e2e reliability.
Overview
Adds
POST /chromium/configureto apply multiple Chromium configuration changes in a single multipart request (display sizing, enterprise policies, launch flags, extension zips, and atar.zstprofile archive) with a single stop/start cycle and a structuredChromiumConfigureError(phase+ optionalstep).Introduces best-effort
start_urldispatch after DevTools readiness (including bare-host normalization), and expandscdpclientwith navigation helpers that manage flattened sessions and event waits.Refactors extension installation into shared
applyExtensionZipItems(used by both configure and the existing upload-and-restart path) with partial-install cleanup, addssupervisorctlstart/stop helpers, updates OpenAPI/generated client/server bindings, and adds unit/e2e coverage (including a powerset matrix) plus a longer e2e test timeout inmake test.Reviewed by Cursor Bugbot for commit 2f7e5d6. Bugbot is set up for automated code reviews on this repo. Configure here.