Skip to content

ci: get the test workflow green on dev - #341

Merged
pminevp merged 9 commits into
devfrom
dev-ci-green
Nov 6, 2026
Merged

pminevp merged 9 commits into
devfrom
dev-ci-green

Conversation

@pminevp

@pminevp pminevp commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

unit (linux) and unit (windows) have failed on all 380 retained dev runs, going back to 2026-09-18, so there was no green run to bisect from. I compared local runs with and without CI=true, then checked against this PR's CI, which split the failures into causes:

Product bugs

  • lunos agent run --max-time (XCOD-211, 63fed15): the parent armed its timer only after spawn() returned, so a child that stopped itself at the deadline was reported as "completed", not "time".
  • Sandbox detection (XCOD-279): a Docker CLI before 29 (ubuntu-24.04 runners) exits 0 from docker info when the daemon is down. That was taken as a working Docker, so the run failed later at docker pull. A new test covers it and fails without the fix.
  • Ripgrep on Windows: PowerShell Expand-Archive took over 30s on runners, so the test timeout killed it before rg.exe was written. It now extracts with System32\tar.exe (bsdtar) and keeps Expand-Archive as the fallback. Concurrent installs also get their own download dir and an atomic rename.

Runner environment leaking into tests

  • CI=true (bun-pty passes the parent env through) turned on the Welcome screen ci exemption (XCOD-273, ee0fa39), which broke ~22 pty tests. It also made budgets unattended (XCOD-298, 424d12d) and affected /global/account. The fix removes it in the preload and blanks it in the pty fixture.
  • /usr/bin/podman: a stand-in "not installed" podman now sits next to each fake docker.
  • System safe.directory=*: the dubious-ownership test uses GIT_CONFIG_NOSYSTEM.
  • Linux open uses its bundled xdg-open, so the fixture sets $BROWSER to the stand-in.

Tests stale after intentional changes

Left, pre-existing

  • Start-up budget (150 ms): 497/271/157/196 ms on dev, 156-161 here. The path waits on load session data (~300 ms of parallel worker GETs /path, /project/current, /config/providers, /provider). This is perf work.
  • unit (windows): the opencode package's suite hits the 45-min step timeout on every dev run. Turbo buffers its output, so its failures can't be seen.
  • Audit writer > two processes appending at once (Windows, 49/50 lines): an intermittent failure, also seen on 23 Oct.
  • e2e: the failing specs differ every run, and most of them are flaky.
  • e2e-matrix e2e (windows) contract replay (unnamed) [5000ms]: the same failure appeared on Upstream sync: anomalyco/opencode v1.19.5 into dev (conflicts) #325.
  • sdk-python on this PR runs because src/agent/** is in its paths. fix(sdk-python): regenerate for experimental.session.remote (XCOD-338) #339 fixes it.
  • Check generated client and HttpApi exerciser gates only run after the unit tests pass, so they have never run. check:generated is clean locally. test:httpapi reports 45 routes with no scenario, which is follow-up work.

🤖 Generated with Claude Code

pminev1 and others added 9 commits November 5, 2026 15:08
…t "completed" (XCOD-211)

The child aborts its session at the absolute deadline it is given (start + limit), but the
parent armed its own timer for the full limit only after spawn() returned, so it fired late. A
child that stopped itself and exited first was reported as reason "completed". Arm the timer
against the same deadline, and count a clean exit at or after it as "time". Seen as
"lunos agent run (subprocess) > the time limit stops a run that hangs" on Linux CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…D-273, XCOD-158, XCOD-298)

Three things on ubuntu-24.04 runners changed what the code under test did:
- CI=true: the Welcome screen's `ci` exemption skipped it in every pty test (bun-pty spawns the
  child on top of this process's environment), budgets treated every turn as unattended so
  on_limit "ask" never asked, and /global/account answered as exempt. Removed in the preload
  (as two tests already did locally) and blanked in the pty fixture; the tests of the CI
  exemption set it themselves.
- /usr/bin/podman: the sandbox tests keep /usr/bin on PATH next to a fake `docker`, so a
  "Docker is stopped" case fell through to the runner's real, working Podman. A stand-in
  podman that isn't installed now goes next to every fake docker and into the pty fixture's bin.
- safe.directory=* in the system gitconfig: trusted the repository the dubious-ownership case
  needs git to refuse. That test now ignores the system config (GIT_CONFIG_NOSYSTEM).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…D-194, XCOD-234, XCOD-247)

- createTuiAttention: the default notification title is "Lunos" since the TUI rebrand
  (b5861ac, XCOD-44); three tests still expected "opencode".
- Residency: Mistral counts as EU only at api.eu.mistral.ai since 5f1bd64 (XCOD-194), and a
  pre-flight check has no baseURL, so the "EU model that passes" in the subagent and agent-import
  tests is now Scaleway, EU at its default endpoint.
- Public event manifest: 91 types, with session.live.updated (XCOD-234) and
  installation.upgrade-progress (XCOD-247) now asserted by name.
- "prompt tools replace previous prompt tool rules" relied on upstream's keyless `opencode`
  provider for a default model; it now gets the test provider like its siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er; Windows test fixes (XCOD-336)

- RipgrepBinary: every install downloaded to the same archive path in the cache's bin and copied
  over the same rg, so parallel test processes (turbo) overwrote or deleted the zip another was
  expanding: Expand-Archive failures and 5 Ripgrep tests on Windows CI. Each install now
  downloads into its own temp directory and renames a staged copy into place; if another process
  won, its rg is used.
- Voice (#320, XCOD-336): three tests use POSIX stand-ins (#!/bin/sh, a ":"-split PATH) and are
  skipped on Windows like their two siblings already were.
- The Memory templates page test normalises CRLF, which a Windows checkout gives the docs page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stopped engine (XCOD-279)

Docker CLIs before 29 (GitHub's ubuntu-24.04 runners) print the --format template empty and exit
0 when the daemon can't be reached. probe() took that as a working Docker with no version, so a
sandboxed run got past detection and failed at `docker pull` instead of saying Docker isn't
running. No server version now counts as not running, like a non-zero exit. New lockout test for
it (fails without the fix); failure-log accepts either exit code in the log line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r stand-in on Linux (XCOD-279, XCOD-273)

- SandboxFailure.diagnose names Docker Desktop on macOS and Windows and the docker service on
  Linux, on purpose (b265b08). Three tests written on macOS expected the Desktop wording; they
  now expect diagnose()'s answer for the host.
- On Linux the `open` package runs its own bundled xdg-open, not the stand-in on PATH; with no
  desktop it falls back to $BROWSER, which the pty fixture now points at the same stand-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Expand-Archive

On Windows CI the Ripgrep tests still timed out at 30s after the per-install download dirs: the
download had finished and PowerShell's Expand-Archive was still running when the test's timeout
interrupted it (ChildProcess.exitCode / SIGTERM), so rg.exe was never written and every test
started over. Windows 10 and later ship bsdtar as System32\tar.exe, which reads zips quickly; use
it (never the tar on PATH, which may be Git's GNU tar), and keep Expand-Archive as the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows CI hit a 504 from the release CDN for the first three Ripgrep tests; the next two, after a
download got through, passed. Up to three retries with backoff, for 5xx only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on (XCOD-279)

Follows 1fd6af8: a Docker CLI before 29 exits 0 with no server version, which now counts as not
running; the bug-report's sandbox-doctor.txt shows that exit code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pminevp
pminevp merged commit 26239fe into dev Nov 6, 2026
11 of 23 checks passed
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.

2 participants