Repository navigation
fix(browser): use the headless shell where libcups cannot load chrome - #32210
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One rider: the new Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: let Browser Harness start and browse on Linux hosts whose libcups is too old for the full Chromium build (Amazon Linux 2). This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 6dda57d Description read[DESCRIPTION-READ] d71f94a406acc47db403c38e685384f213c6038be42c05c59d99e12e0eadb716 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The fallback is decided by a probe that only reads files, and the state, download and launch paths all take their answer from Notes
[DESIGN-REVIEWED] 6dda57d Description read[DESCRIPTION-READ] 5bce83b2087ccd070ec728ca3a750080e568753aa3020e696bc428adc1f49564 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Two reds on head Backend Tests shard 2 (Linux and Windows) / Coverage Gate: PR Policy / Cross-Platform Portability: the four flagged lines are |
|
More evidence, on a real Amazon Linux 2 userland as a normal user, so with Chrome's sandbox on (the container run in the body was root, which adds Host: a DevSpace from the
Not covered: that DevSpace runs Amazon Linux 2 userland on the Amazon Linux 2023 kernel, which allows unprivileged user namespaces. A host kernel with |
On a Linux host whose libcups lacks the symbols the full Chrome for Testing build imports (Amazon Linux 2: cups-libs 1.6.3), Kiro's Chromium exits 127 at load and Browser Harness reports a 60 s daemon timeout instead. Pick the same version's chrome-headless-shell there, which links no libcups. Download, state and launch all follow chromium.wanted_build, so a full build already on disk reads as not downloaded and the startup auto-install fetches the shell. The probe reads libcups' ELF dynamic symbol table from the linker's system directories, so the status path still launches nothing. Closes #32197
1db320b to
6dda57d
Compare
|
Rebased: main moved in test/test_security_gate_liveness.py line budget (#32252) and the Windows platform ignore list (#32209) since this head went red (0795ebc -> d27a5fd); CI re-running. Clean rebase, no code change. PR Policy was already green after |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (8 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: on a Linux host whose libcups lacks the symbols the full Chrome build needs, downloads and launches the headless shell build; with tests. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/modules/browser.md.
…#32210) On a Linux host whose libcups lacks the symbols the full Chrome for Testing build imports (Amazon Linux 2: cups-libs 1.6.3), Kiro's Chromium exits 127 at load and Browser Harness reports a 60 s daemon timeout instead. Pick the same version's chrome-headless-shell there, which links no libcups. Download, state and launch all follow chromium.wanted_build, so a full build already on disk reads as not downloaded and the startup auto-install fetches the shell. The probe reads libcups' ELF dynamic symbol table from the linker's system directories, so the status path still launches nothing. Closes #32197 (cherry picked from commit 23b4795)
…#32210) On a Linux host whose libcups lacks the symbols the full Chrome for Testing build imports (Amazon Linux 2: cups-libs 1.6.3), Kiro's Chromium exits 127 at load and Browser Harness reports a 60 s daemon timeout instead. Pick the same version's chrome-headless-shell there, which links no libcups. Download, state and launch all follow chromium.wanted_build, so a full build already on disk reads as not downloaded and the startup auto-install fetches the shell. The probe reads libcups' ELF dynamic symbol table from the linker's system directories, so the status path still launches nothing. Closes #32197 (cherry picked from commit 23b4795)
Problem / Motivation
Goal: Browser Harness starts and browses on Linux hosts whose libcups is too old for the full Chromium build, such as Amazon Linux 2.
On Amazon Linux 2 every Browser Harness start waits about 60 s and fails with
the Harness daemon did not start in time, whateverbrowser.choicesays. Kiro's Chromium (the full Chrome for Testing154.0.8037.0build) exits 127 at load withundefined symbol: ippValidateAttributes: it imports four libcups functions that cups-libs 1.6.3 does not define.Why it matters
On such a host the agent has no browser: the
browsertool, Settings' Test and the live view all fail, and the error names neither the browser nor the library. Settings offers no way out, because on a host without a display every choice launches the same binary. The earlier stacks carried a fallback for this (#2897, then #23585); #26950 retired them, and the fallback with them.Not a goal
pillow==12.3.0from source (it has no glibc 2.26 wheel); seen while testing on Amazon Linux 2, separate from this crash.What changed (motivation → approach → change)
A Linux host whose libcups lacks a function the full build imports now gets the same version's
chrome-headless-shell, which links no libcups. Every other host, macOS and Windows included, keeps the full build.browser_harness/libcups.py(new)libcups.so.2in the linker's system directories, neverLD_LIBRARY_PATH, and parses its dynamic symbol table in Python: nothing is launched and no binutils is needed. No readable library keeps the full build.browser_harness/chromium.pywanted_build()picks the build, and state, download and the executable the supervisor launches all follow it. The shell lives inchromium/154.0.8037.0-headless-shell/. A full build already on disk reads as not downloaded there, so the startup auto-install fetches the shell unasked. The status payload gainschromium.build.browser_harness/supervisor.py_choosereports akiro_chromiumchoice as headless when the build is the shell, so status, the live card and the startup warm never offer a window it cannot show.docs/system-specs/modules/browser.mdBackwards compatibility
Compatible: on a host with a current libcups the download URL, directory, executable and flags are what they were, and
chromium.buildis an added key. On an old-libcups host with a display, akiro_chromiumpin now reportsheadless: true, which is what runs. On an old-libcups host the full build is no longer launched; it never started there.Reader: src/kiro_crew/dashboard/handlers/browser_harness_status.py:_auto_components -- release -- reads
chromium.present; false for an unusable full build, so it adds thechromiumcomponent and the install fetches the shell (test_a_full_build_already_on_disk_is_no_browser_for_an_old_libcups_host)Reader: src/kiro_crew/dashboard/handlers/browser_harness_status.py:_warm_wanted -- release -- waits for
chromium.present, which the shell's install then makes trueReader: src/kiro_crew/browser_harness/supervisor.py:_launch_chromium -- chat -- launches
state.chromium.executable, now the shell on such a host (test_the_browser_an_old_libcups_host_launches_is_the_headless_shell)Reader: website/src/pages/settings/BrowserEngineSection.tsx:BrowserEngineSection -- crew page -- shows Install instead of Redownload until the shell is on disk; Redownload replaces the shell, the build that host runs
Tests
test/test_browser_harness_libcups.py(new) pins the probe against ELF files built in the test: Amazon Linux 2's shape is too old; one missing symbol is enough; a symbol the library only imports counts as missing; no file, an empty, non-ELF or truncated file is no evidence; a 32-bit or foreign-architecture copy is passed over for the next directory; the first native copy decides; only Linux is ever too old;LD_LIBRARY_PATHnever decides.test/test_browser_harness_chromium.pypins the build per platform, the shell's URL on both sources, its directory and executable, a full-build archive refused where the shell is wanted, the upgrade path from an existing full build, and thatinstall_state(home).chromium.executableis the shell. An autouse fixture pins the probe so the file does not depend on the host's libcups.test/test_browser_harness_supervisor.pypins that_chooseturns a windowedkiro_chromiumchoice headless when the build is the shell, and leaves the full build and the person's Chrome windowed.LD_LIBRARY_PATHconsulted, the probe ignored, state or download ignoring the wanted build, either half of the_choosecondition) each turn these tests red.-n0, 10/10 at-n 4 --dist loadgroup --max-worker-restart=2besidetest_browser_harness_install.pyandtest_browser_harness_discover.py, and their 40 ids in a shuffled order (seed 28709) green. With the supervisor test added, 20/20 at-n0; its-n 4and shuffled runs are left to CI.Proof: not provable -- other: the fix adds libcups.py, which both test files import, so prove.py's revert of the production hunks fails at collection (INCONCLUSIVE, and per hunk the dependent hunks fail to import); the nine mutants above are the substitute
Manual verification
In an
amazonlinux:2container (cups-libs 1.6.3, glibc 2.26), each tree installed and run throughinstall_sync(home)thenHarnessSupervisor(home).test(150),gotoandpage_info:test()origin/mainchrome-linux64/chromeerror,the Harness daemon did not start in timechrome-headless-shell-linux64/chrome-headless-shellconnected;gotoexample.com,page_infotitleExample Domainconnected, same pageThe container has no display, so the
_choosechange is covered by its unit test, not by this run. On an Amazon Linux 2023 host the probe keeps the full build, which connects as before. The headless shell over--remote-debugging-pipewith the supervisor's flags,--headless=newincluded, also passed navigation,Runtime.evaluate, a screenshot and a screencast frame on Amazon Linux 2.Related Issues
Closes #32197
Sibling sweep
Swept: git grep -n -E "chromium.launch|chromium.executable_path|launch_persistent_context|chrome-linux64|ms-playwright|playwright install" -- src/
Sibling: src/kiro_crew/builtin_skills/browser-recording/scripts/driver.mjs -- not affected --
chromium.launch()with Playwright's headless default runs its own headless shell, not the full buildSibling: src/kiro_crew/apps/builtins/dev_fleet/skills/feature-demo-recording/references/record_template.py -- not affected --
headless=Truewith no channel, Playwright's headless shellSibling: src/kiro_crew/apps/builtins/dev_fleet/skills/pod-e2e/scripts/pod-playwright.py -- not affected --
headless: Truewith no channel, Playwright's headless shellSibling: src/kiro_crew/apps/builtins/design_critique/skills/design-critique/scripts/render.mjs -- not affected -- launches the user's installed Chrome (
channel: 'chrome'), then Playwright's defaultPattern harvest
Rule candidate: review-prompt
Pattern: a refactor that retires a module deletes a platform fallback the module carried, with no test outside the module pinning that the fallback still exists
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)