Skip to content

fix(kirocrew): make Playwright reachable at runtime + install Chromium deps on AL2023 (follow-up to #94) - #97

Merged
royosherove merged 1 commit into
mainfrom
fix/kirocrew-playwright-runtime
Aug 23, 2026
Merged

fix(kirocrew): make Playwright reachable at runtime + install Chromium deps on AL2023 (follow-up to #94)#97
royosherove merged 1 commit into
mainfrom
fix/kirocrew-playwright-runtime

Conversation

@royosherove

Copy link
Copy Markdown
Member

Follow-up to #94 addressing three Codex P1s posted on commit 3e4984a814 after that PR was merged. All three affect the KiroCrew Playwright preinstall on the AL2023 ARM64 production target.

The three P1s

P1 #1playwright-cli not on the gateway service PATH

mise's global npm prefix is only on PATH during install; the systemd unit hardcodes PATH and does not activate mise, so the global playwright-cli was unreachable from gateway-spawned agents.

P1 #2 — mise node binary also missing from the gateway PATH

playwright-cli's launcher uses #!/usr/bin/env node; symlinking the launcher alone still fails with node: No such file or directory because node itself only lives under mise.

P1 #3--with-deps only supports apt-get; target is AL2023 (dnf)

Playwright's Linux dependency phase queues apt-get update/install. On AL2023 this silently no-ops or errors and leaves Chromium's system libs unavailable.

Two-layer fix for #1 + #2

a) packs/kirocrew/resources/kirocrew-gateway.service — prepend the mise shims directory (/home/ec2-user/.local/share/mise/shims) to the unit's Environment=PATH so node, npm and playwright-cli all resolve at service runtime the same way they do in an interactive shell.

b) packs/kirocrew/install.sh — belt-and-suspenders: symlink both playwright-cli and node into ~/.local/bin (already on the unit's PATH) in case shim generation lags or the user's mise layout differs.

Fix for #3

Replace playwright-cli install-browser --with-deps with an explicit dnf install of the AL2023 package names Playwright needs for Chromium (nss, nspr, atk, at-spi2-atk, cups-libs, libdrm, libxkbcommon, libX{composite,damage,fixes,randr}, mesa-libgbm, alsa-lib, pango, cairo), then run install-browser chromium without --with-deps for the browser binary itself.

Verification

  • bash -n packs/kirocrew/install.sh: OK
  • systemd-analyze verify on the .service: clean (existing __HOME__ placeholder warning is pre-existing and expected — deploy/bootstrap.sh substitutes it before enabling the unit)
  • Non-fatal warn paths preserved so a partial failure doesn't take down the whole install.

Refs

Not merging per Aug 22 20:34 rule.

…L2023

Follow-up to #94 addressing three Codex P1s posted on commit 3e4984a
after that PR was merged. All three affect the KiroCrew Playwright
preinstall on the AL2023 ARM64 production target.

P1 #1 — playwright-cli not on the gateway service PATH
  packs/kirocrew/install.sh:346 (before this commit)
  mise's global npm prefix is only on PATH during install; the systemd
  unit hardcodes PATH and does not activate mise, so the global
  playwright-cli was unreachable from gateway-spawned agents.

P1 #2 — mise node binary also missing from the gateway PATH
  packs/kirocrew/install.sh:358 (before this commit)
  playwright-cli's launcher uses '#!/usr/bin/env node'; symlinking the
  launcher alone still fails with 'node: No such file or directory'
  because node itself only lives under mise.

P1 #3 — --with-deps only supports apt-get; target is AL2023 (dnf)
  packs/kirocrew/install.sh:367 (before this commit)
  Playwright's Linux dependency phase queues apt-get update/install.
  On AL2023 this silently no-ops or errors and leaves Chromium's system
  libs unavailable.

Two-layer fix for #1 + #2:
  a) packs/kirocrew/resources/kirocrew-gateway.service — prepend the
     mise shims directory (/home/ec2-user/.local/share/mise/shims) to
     the unit's Environment=PATH so node, npm and playwright-cli all
     resolve at service runtime the same way they do in an interactive
     shell.
  b) packs/kirocrew/install.sh — belt-and-suspenders: symlink both
     playwright-cli AND node into ~/.local/bin (already on the unit's
     PATH) in case shim generation lags or the user's mise layout
     differs.

Fix for #3:
  Replace 'playwright-cli install-browser --with-deps' with an explicit
  dnf install of the AL2023 package names Playwright needs for Chromium
  (nss, nspr, atk, at-spi2-atk, cups-libs, libdrm, libxkbcommon, libX
  {composite,damage,fixes,randr}, mesa-libgbm, alsa-lib, pango, cairo),
  then run 'install-browser chromium' without --with-deps for the
  browser binary itself.

Non-fatal warn paths preserved so a partial failure doesn't take down
the whole install. bash -n clean on install.sh; systemd-analyze verify
clean on the .service (existing __HOME__ placeholder warning is
pre-existing and expected — deploy/bootstrap.sh substitutes it before
enabling the unit).

Refs:
  #94 (comment) (P1 x3 on 3e4984a)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a7a0b0426

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packs/kirocrew/install.sh
pango
cairo
)
if sudo dnf install -y "${_chromium_deps[@]}" 2>&1 | while IFS= read -r line; do log " dnf: ${line}"; done; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve Chromium dependency installation on Ubuntu

On a clean Ubuntu 22.04 deployment, which remains a supported OS in packs/kirocrew/manifest.yaml, this unconditional dnf command is unavailable, so the failure is merely warned about and install-browser chromium proceeds without installing the required shared libraries. The browser can therefore be downloaded successfully but fail when gateway agents launch it; select the dependency installation path by package manager, retaining an apt/--with-deps path for Ubuntu.

Useful? React with 👍 / 👎.

@royosherove
royosherove merged commit c2301c1 into main Aug 23, 2026
16 checks passed
@royosherove
royosherove deleted the fix/kirocrew-playwright-runtime branch August 23, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant