Skip to content

[2026-12-04t13-00-02-227z] main-red-fixer - #850

Merged
danii1 merged 1 commit into
mainfrom
feature/2026-12-04t13-00-02-227z
Dec 4, 2026
Merged

danii1 merged 1 commit into
mainfrom
feature/2026-12-04t13-00-02-227z

Conversation

@danii1

@danii1 danii1 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Why

Task 2026-12-04t13-00-02-227z: main-red-fixer

CI run 47333401234 on main (commit 1e605fd) succeeded. The offline e2e suite had 2 failures, both in worker-doctor.test.ts.

  1. Stale expectation (real). The test "worker doctor passes a valid local workspace…" expects the no-systemd-bus doctor --json next steps to be exactly ["run-foreground"]. The CLI now returns ["run-foreground", "try-first-task"]. Commit 90a76a6 ([local-agent-setup-default-the-markdown-tasks-f] Agent setup: default the markdown tasks folder and offer try-first-task once ready #841) made try-first-task appear on any ready workspace. Commit 3aee08c ([local-worker-doctor-init-no-service-install-st] Worker doctor/init: no service-install step on hosts without a service manager #842) then added the run-foreground swap and wrote its assertion without try-first-task. The CLI behaviour is deliberate, so the test was wrong.
  2. Environmental. The test "worker doctor --json offers try-first-task…" expects ["service", "try-first-task"] but gets ["run-foreground", "try-first-task"]. This sandbox blocks the systemd user bus (systemctl --user fails with "Operation not permitted"), so the CLI correctly reports no service manager. It failed on both solo reruns and I changed nothing for it. It should pass on a host with a user bus.

What changed

packages/e2e/tests/local/worker-doctor.test.ts: the no-bus assertion now expects ["run-foreground", "try-first-task"]. No product code changed. This is a test-only fix for the e2e gate. The CI gate was not red.

Scope

This covers the stale expectation in one file. I searched packages/e2e for other run-foreground assertions. worker-init-noninteractive.test.ts uses toContain, so it is unaffected. I did not touch the environmental failure.

Tradeoffs

None meaningful. The change adds one expected id to match the intended output. No assertion was weakened or skipped.

Blast Radius

Only the e2e test file changed, so the product, CI and the released package are unaffected. The e2e suite gates @getdevintern/code releases, so this unblocks the next release run, except that the environmental test still needs a host with a systemd user bus.

Verification

  • gh run list on main: all 5 recent CI runs succeeded. Latest is run 47333401234 (commit 1e605fd), a push to main.
  • HEAD equals origin/main (1e605fd).
  • bun install --frozen-lockfile and bun run --filter @getdevintern/code build both succeeded (the dist/index.js build was present).
  • AGENT_CLI_PATH=bun bun run --filter @devintern/e2e test before the fix: 498 pass, 16 skip, 3 todo, 2 fail (519 tests, 138 files).
  • Two solo reruns of worker-doctor.test.ts: the same 2 tests failed both times.
  • Open-PR check (main-red-fixer in title, and e2e): no existing fix. The e2e search returned a list of unrelated open PRs, which I did not open.
  • After the fix, worker-doctor.test.ts: 1 pass, 1 fail. The fail is the environmental test.
  • bun run format:check: passed. bun run lint and bun run typecheck: no errors shown in the tail of the output, but I did not check their exit codes.
  • Not run: the full offline suite after the fix, AGENT_CLI_PATH=bun bun run test, and bun run build as a CI step.

🤖 Opened by DevIntern from 2026-12-04t13-00-02-227z

@danii1 danii1 added the devintern-authored Pull request written by DevIntern working its own backlog label Dec 4, 2026
@danii1

danii1 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Artifacts & verification

Run: 1721 · Commit: 1d250923f59ac5c179f985239fff38ca240c42d8

Verification report

Produced by __verify-1, execution 1 at 1d250923f59ac5c179f985239fff38ca240c42d8.

Show artifact
{
  "summary": "The one-line change is correct. In the no-systemd-bus case of worker-doctor.test.ts, the expected next steps become [\"run-foreground\",\"try-first-task\"]. buildWorkerDoctorReport (packages/code/src/lib/observability/readiness-json.ts:~560-575) adds run-foreground in place of service when serviceUnavailable is set. It then adds try-first-task last whenever setup is ready or complete and the plan lists at least one repo. The try-first-task step came from 90a76a62. The run-foreground swap came from 3aee08cc (#842), which left this assertion stale. The change updates a stale expectation to the new intended output, so it doesn't weaken the test: it still asserts the exact ordered ids, and the nextSteps[0] command and message assertions are untouched. I ran worker-doctor.test.ts once. The edited test passes. The other test in the file fails at line 331, where it expects [\"service\",\"try-first-task\"] and receives run-foreground. That test runs with no env override, so it most likely fails because this sandbox has no usable systemd user bus. That is an environmental failure, not a regression. I did not run the full offline suite, the CI steps, or the two-rerun flake check on the failing file.",
  "items": [
    {
      "priority": "low",
      "confidence": "medium",
      "category": "testing",
      "file": "packages/e2e/tests/local/worker-doctor.test.ts",
      "line": "331",
      "issue": "The test 'offers try-first-task on a ready workspace' expects the `service` step. It depends on the host having a systemd user bus. On a bus-less host (this sandbox, containers, CI without a user session) it gets `run-foreground`. This is environmental, not caused by the diff.",
      "evidence": "Ran `AGENT_CLI_PATH=bun bun test tests/local/worker-doctor.test.ts`: 1 pass, 1 fail. The failure is at line 331, with `service` expected and `run-foreground` received. Line 322 sets up the fixture with no XDG_RUNTIME_DIR or DBUS override. I did not confirm that the sandbox hides the bus at /run/user/1000/bus.",
      "suggestion": "Report it as environmental. Don't change code for it. Optionally accept either `service` or `run-foreground` as the first step, or pin the bus env in a follow-up. Do not weaken it in this fix."
    },
    {
      "priority": "info",
      "confidence": "medium",
      "category": "testing",
      "file": "packages/e2e/tests/local/worker-init-noninteractive.test.ts",
      "line": "82",
      "issue": "Sibling assertions for run-foreground exist here and use toContain, so they are unaffected by the added try-first-task step.",
      "evidence": "rg showed lines 82 and 84 using `toContain` and `find(...)`. Line 122 checks only that one of the two ids is present.",
      "suggestion": "No action."
    }
  ],
  "approved": true
}

Auto-review summary

Produced by auto-review, execution 1 at 1d250923f59ac5c179f985239fff38ca240c42d8.

Show artifact
{
  "iterations": 0,
  "success": true,
  "finalFeedback": {
    "summary": "The PR changes one e2e assertion in the no-systemd-bus doctor case. It now expects `try-first-task` after `run-foreground`. The assertion matches `buildWorkerDoctorReport` in `packages/code/src/lib/observability/readiness-json.ts:556-579`. That function pushes `runForegroundStep` when the service is unavailable. Then, for setup `ready` or `complete` with at least one repo, it appends `tryFirstTaskStep` as the last step. The test reaches that path: the same test asserts `noBusDocument.setup` is `ready`, and its `plan` has a `fixture` repo. I proved this by reading the code (pointed). I did not run the e2e test, which is skipped unless the CLI is built (`skipIf(!builtCli)`).",
    "items": [
      {
        "priority": "info",
        "confidence": "medium",
        "category": "testing",
        "file": "packages/e2e/tests/local/worker-doctor.test.ts",
        "line": "180-184",
        "issue": "The test now also pins the exact step order and count. The unit tests in `packages/code/tests/worker-doctor-json.test.ts:24-57` cover `try-first-task` but not alongside `run-foreground`. The e2e test is the only place that checks the two together. That makes it stricter than before, but it is correct. The e2e test is not in PR CI (per AGENTS.md), so it was not run here.",
        "evidence": "readiness-json.ts:559-575 (run-foreground push, then try-first-task push when setup is ready/complete and repos exist); the test's own `setup` is `ready` and `plan.repos` has `fixture`.",
        "suggestion": "Run `bun run test` in `packages/e2e` against a built CLI before merging to confirm. No code change is needed."
      }
    ],
    "approved": true
  },
  "unresolved": [],
  "stopReason": "approved",
  "commitSha": "1d250923f59ac5c179f985239fff38ca240c42d8",
  "history": [
    {
      "iteration": 1,
      "feedback": {
        "summary": "The PR changes one e2e assertion in the no-systemd-bus doctor case. It now expects `try-first-task` after `run-foreground`. The assertion matches `buildWorkerDoctorReport` in `packages/code/src/lib/observability/readiness-json.ts:556-579`. That function pushes `runForegroundStep` when the service is unavailable. Then, for setup `ready` or `complete` with at least one repo, it appends `tryFirstTaskStep` as the last step. The test reaches that path: the same test asserts `noBusDocument.setup` is `ready`, and its `plan` has a `fixture` repo. I proved this by reading the code (pointed). I did not run the e2e test, which is skipped unless the CLI is built (`skipIf(!builtCli)`).",
        "items": [
          {
            "priority": "info",
            "confidence": "medium",
            "category": "testing",
            "file": "packages/e2e/tests/local/worker-doctor.test.ts",
            "line": "180-184",
            "issue": "The test now also pins the exact step order and count. The unit tests in `packages/code/tests/worker-doctor-json.test.ts:24-57` cover `try-first-task` but not alongside `run-foreground`. The e2e test is the only place that checks the two together. That makes it stricter than before, but it is correct. The e2e test is not in PR CI (per AGENTS.md), so it was not run here.",
            "evidence": "readiness-json.ts:559-575 (run-foreground push, then try-first-task push when setup is ready/complete and repos exist); the test's own `setup` is `ready` and `plan.repos` has `fixture`.",
            "suggestion": "Run `bun run test` in `packages/e2e` against a built CLI before merging to confirm. No code change is needed."
          }
        ],
        "approved": true
      },
      "addressed": [],
      "commitSha": "1d250923f59ac5c179f985239fff38ca240c42d8"
    }
  ]
}

@danii1
danii1 merged commit 7d0d2da into main Dec 4, 2026
1 check passed
@danii1
danii1 deleted the feature/2026-12-04t13-00-02-227z branch December 4, 2026 13:15
@danii1

danii1 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Auto-merge: merged (squash) at 1d25092.

Every changed file is inside the workspace's safe paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merged devintern-authored Pull request written by DevIntern working its own backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant