Skip to content
Source
Sign inSign up
TanStack/ai

test(ai-harness): count a zombie child as stopped in the bash timeout test #2169

MergedAlemTuzlakmerged 1 commit intomain fromtest/harness-live-process-checkmerged by AlemTuzlak View on GitHub

AlemTuzlakcommented

The ai-harness test "stops the commands that a command started when the timeout ends it" fails on every TanStack Source run that affects @tanstack/ai-harness. It passes on GitHub. The test now counts a zombie child as stopped, the same fix as #2138 for the Blaxel test.

🎯 Changes

  • packages/ai-harness/tests/workspace-tools.test.ts: isRunning(pid) still calls process.kill(pid, 0). When that succeeds, it reads /proc/<pid>/stat and returns false for state Z (zombie). With no /proc (Windows, macOS), the process counts as running, as before.
  • Only a test changes, so there is no changeset and no docs change.

Root cause

  • Issue. On TanStack Source CI, the test expects the node child to stop within 5 s after the timeout, and it never does.
  • Cause. The bash tool kills the child. In the CI container, PID 1 never reaps it, so the child stays a zombie. process.kill(pid, 0) succeeds for a zombie, so isRunning returns true.
  • Fix. isRunning treats a zombie as stopped.

Possible alternatives

  • Run the CI container with an init process that reaps zombies. That changes the forge image for all jobs. It was not taken, because #2138 already chose the test-side fix for the same cause.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.
  • Docs: I updated docs/ for this change, or this change is not user-facing.
  • Changeset: I added a changeset (pnpm changeset), or this PR does not change a published package.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Testing

Commands run

  • vitest run tests/workspace-tools.test.ts in packages/ai-harness on Windows: 90 tests pass. Windows has no /proc, so this run shows only that the test still passes where processes are reaped.
  • tsc for packages/ai-harness: no errors in this file.
  • Not run locally: Linux, where a zombie can stay. The forge CI of this PR runs the test there.

Evidence from CI

On #2163, which changes @tanstack/ai and so runs the ai-harness tests, this test failed on 3 forge runs in a row, including a rerun of only the failed job:

FAIL @tanstack/ai-harness tests/workspace-tools.test.ts > bash > stops the commands that a command started when the timeout ends it
AssertionError: expected true to be false
❯ waitFor.timeout tests/workspace-tools.test.ts:1431:52

Manual test

  1. On TanStack Source CI, run the ai-harness tests on main: this test fails.
  2. Run them on this branch: it passes.

How this PR makes testing easy

The forge test job of this PR runs the changed test.

Risk / rollback

Low risk: one test helper. To roll back, revert this PR.

Summary by CodeRabbit

  • Tests
    • Process status checks now distinguish Linux zombie processes from active processes, improving accuracy when evaluating whether a process is running.
    • If the operating system’s process-status information cannot be read, checks continue to treat a process as running.
    1. ⚠️ No Changeset found

      Latest commit: ac53fd262282be335e70c738668b2f9f80a2e409

      Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

      This PR includes no changesets

      When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

      Click here to learn what changesets are, and how to add one.

      Click here if you're a maintainer who wants to add a changeset to this PR

    2. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The test helper now checks /proc/<pid>/stat after a successful process.kill(pid, 0) check. It returns false for zombie processes, treats an unreadable process state as running, and retains the existing false result when the signal-zero check fails.

      Changes: Process liveness check

      Layer / File(s)Summary
      Check process state
      packages/ai-harness/tests/workspace-tools.test.ts
      The helper reads /proc/<pid>/stat after a successful process.kill(pid, 0) check. It returns false for state Z and treats a read failure as running.

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Other

      Possibly related PRs

      • TanStack/ai#2146: The change also treats a zombie process as stopped after a signal-zero check.
      • TanStack/ai#2138: The change applies the same zombie-as-stopped rule to a related process liveness check.

      Suggested reviewers: tombeckenham

      Merge Risk: Minimal · up to ac53f

      This only changes a test helper so a zombie child process counts as stopped in the bash timeout test. It has no production impact, and merge risk is minimal.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the main change: a test helper now counts a zombie child process as stopped in the bash timeout test. It matches the raw summary, which describes the isRunning change that treats state…
      Description checkPassedThe description follows the template sections (Changes, Checklist, Release Impact) and adds a root cause, testing evidence, and risk notes. It explains the zombie-child cause and the fix in the test h…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the main change: a test helper now counts a zombie child process as stopped in the bash timeout test. It matches the raw summary, which describes the isRunning change that treats state Z as not running. The title is specific and concise, and it names the test area.

      Full details: Description check

      Explanation

      The description follows the template sections (Changes, Checklist, Release Impact) and adds a root cause, testing evidence, and risk notes. It explains the zombie-child cause and the fix in the test helper. Minor gaps: the local test checkbox is unchecked and no reason is given for skipping it, and the Changes section does not state explicitly that no docs or changeset are needed, though it says so in a bullet. The Changes section also says there is no changeset, but the Changeset checkbox is checked, which is inconsistent. Those are non-critical. The description is mostly complete.

      Finishing Touches

      Generate unit tests (beta)

      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      Share

      Recent review info

      Run configuration

      • Source mode: Auto
      • Repository: TanStack/ai
      • Branch: main
      • File: .coderabbit.yaml
      • Commit: 1433ce1
      • Layers: Repository YAML
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 498e8d13-ae65-4d6b-bf52-2f49224b44c7
      Commits

      Reviewing files that changed from the base of the PR and between 1433ce119fb478792d80034985c91412755bf2ce and ac53fd262282be335e70c738668b2f9f80a2e409.

      Files selected for processing: 1

      • packages/ai-harness/tests/workspace-tools.test.ts

      Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

    3. View your CI Pipeline Execution ↗ for commit ac53fd262282be335e70c738668b2f9f80a2e409

      CommandStatusDurationResult
      nx run-many --targets=test:coverage --projects=...✅ Succeeded<1sView ↗
      nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded2m 17sView ↗
      nx run-many --targets=build --exclude=examples/...✅ Succeeded4sView ↗

      💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


      ☁️ Nx Cloud last updated this comment at 2026-11-16 11:34:49 UTC

    4. Open in StackBlitz

      @tanstack/ai

      npm i https://pkg.pr.new/@tanstack/ai@2169

      @tanstack/ai-acp

      npm i https://pkg.pr.new/@tanstack/ai-acp@2169

      @tanstack/ai-angular

      npm i https://pkg.pr.new/@tanstack/ai-angular@2169

      @tanstack/ai-anthropic

      npm i https://pkg.pr.new/@tanstack/ai-anthropic@2169

      @tanstack/ai-bedrock

      npm i https://pkg.pr.new/@tanstack/ai-bedrock@2169

      @tanstack/ai-byteplus

      npm i https://pkg.pr.new/@tanstack/ai-byteplus@2169

      @tanstack/ai-claude-code

      npm i https://pkg.pr.new/@tanstack/ai-claude-code@2169

      @tanstack/ai-client

      npm i https://pkg.pr.new/@tanstack/ai-client@2169

      @tanstack/ai-cloudflare

      npm i https://pkg.pr.new/@tanstack/ai-cloudflare@2169

      @tanstack/ai-code-mode

      npm i https://pkg.pr.new/@tanstack/ai-code-mode@2169

      @tanstack/ai-code-mode-snippets

      npm i https://pkg.pr.new/@tanstack/ai-code-mode-snippets@2169

      @tanstack/ai-codex

      npm i https://pkg.pr.new/@tanstack/ai-codex@2169

      @tanstack/ai-cohere

      npm i https://pkg.pr.new/@tanstack/ai-cohere@2169

      @tanstack/ai-compaction

      npm i https://pkg.pr.new/@tanstack/ai-compaction@2169

      @tanstack/ai-computer-local

      npm i https://pkg.pr.new/@tanstack/ai-computer-local@2169

      @tanstack/ai-computer-playwright

      npm i https://pkg.pr.new/@tanstack/ai-computer-playwright@2169

      @tanstack/ai-computer-sandbox

      npm i https://pkg.pr.new/@tanstack/ai-computer-sandbox@2169

      @tanstack/ai-computer-use

      npm i https://pkg.pr.new/@tanstack/ai-computer-use@2169

      @tanstack/ai-devtools-core

      npm i https://pkg.pr.new/@tanstack/ai-devtools-core@2169

      @tanstack/ai-durable-stream

      npm i https://pkg.pr.new/@tanstack/ai-durable-stream@2169

      @tanstack/ai-effect

      npm i https://pkg.pr.new/@tanstack/ai-effect@2169

      @tanstack/ai-elevenlabs

      npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@2169

      @tanstack/ai-event-client

      npm i https://pkg.pr.new/@tanstack/ai-event-client@2169

      @tanstack/ai-fal

      npm i https://pkg.pr.new/@tanstack/ai-fal@2169

      @tanstack/ai-gemini

      npm i https://pkg.pr.new/@tanstack/ai-gemini@2169

      @tanstack/ai-grok

      npm i https://pkg.pr.new/@tanstack/ai-grok@2169

      @tanstack/ai-grok-build

      npm i https://pkg.pr.new/@tanstack/ai-grok-build@2169

      @tanstack/ai-groq

      npm i https://pkg.pr.new/@tanstack/ai-groq@2169

      @tanstack/ai-harness

      npm i https://pkg.pr.new/@tanstack/ai-harness@2169

      @tanstack/ai-harness-cli

      npm i https://pkg.pr.new/@tanstack/ai-harness-cli@2169

      @tanstack/ai-isolate-cloudflare

      npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@2169

      @tanstack/ai-isolate-daytona

      npm i https://pkg.pr.new/@tanstack/ai-isolate-daytona@2169

      @tanstack/ai-isolate-e2b

      npm i https://pkg.pr.new/@tanstack/ai-isolate-e2b@2169

      @tanstack/ai-isolate-node

      npm i https://pkg.pr.new/@tanstack/ai-isolate-node@2169

      @tanstack/ai-isolate-quickjs

      npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@2169

      @tanstack/ai-isolate-quickjs-bun

      npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs-bun@2169

      @tanstack/ai-llmgateway

      npm i https://pkg.pr.new/@tanstack/ai-llmgateway@2169

      @tanstack/ai-lovable

      npm i https://pkg.pr.new/@tanstack/ai-lovable@2169

      @tanstack/ai-mcp

      npm i https://pkg.pr.new/@tanstack/ai-mcp@2169

      @tanstack/ai-memory

      npm i https://pkg.pr.new/@tanstack/ai-memory@2169

      @tanstack/ai-mistral

      npm i https://pkg.pr.new/@tanstack/ai-mistral@2169

      @tanstack/ai-muse

      npm i https://pkg.pr.new/@tanstack/ai-muse@2169

      @tanstack/ai-neon

      npm i https://pkg.pr.new/@tanstack/ai-neon@2169

      @tanstack/ai-octane

      npm i https://pkg.pr.new/@tanstack/ai-octane@2169

      @tanstack/ai-ollama

      npm i https://pkg.pr.new/@tanstack/ai-ollama@2169

      @tanstack/ai-ollaya

      npm i https://pkg.pr.new/@tanstack/ai-ollaya@2169

      @tanstack/ai-openai

      npm i https://pkg.pr.new/@tanstack/ai-openai@2169

      @tanstack/ai-opencode

      npm i https://pkg.pr.new/@tanstack/ai-opencode@2169

      @tanstack/ai-openrouter

      npm i https://pkg.pr.new/@tanstack/ai-openrouter@2169

      @tanstack/ai-perplexity

      npm i https://pkg.pr.new/@tanstack/ai-perplexity@2169

      @tanstack/ai-persistence

      npm i https://pkg.pr.new/@tanstack/ai-persistence@2169

      @tanstack/ai-preact

      npm i https://pkg.pr.new/@tanstack/ai-preact@2169

      @tanstack/ai-react

      npm i https://pkg.pr.new/@tanstack/ai-react@2169

      @tanstack/ai-reactor

      npm i https://pkg.pr.new/@tanstack/ai-reactor@2169

      @tanstack/ai-remix

      npm i https://pkg.pr.new/@tanstack/ai-remix@2169

      @tanstack/ai-sandbox

      npm i https://pkg.pr.new/@tanstack/ai-sandbox@2169

      @tanstack/ai-sandbox-blaxel

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-blaxel@2169

      @tanstack/ai-sandbox-boxd

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-boxd@2169

      @tanstack/ai-sandbox-cloudflare

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-cloudflare@2169

      @tanstack/ai-sandbox-daytona

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-daytona@2169

      @tanstack/ai-sandbox-docker

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-docker@2169

      @tanstack/ai-sandbox-e2b

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-e2b@2169

      @tanstack/ai-sandbox-local-process

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-local-process@2169

      @tanstack/ai-sandbox-railway

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-railway@2169

      @tanstack/ai-sandbox-sprites

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-sprites@2169

      @tanstack/ai-sandbox-upstash-box

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-upstash-box@2169

      @tanstack/ai-sandbox-vercel

      npm i https://pkg.pr.new/@tanstack/ai-sandbox-vercel@2169

      @tanstack/ai-skills

      npm i https://pkg.pr.new/@tanstack/ai-skills@2169

      @tanstack/ai-solid

      npm i https://pkg.pr.new/@tanstack/ai-solid@2169

      @tanstack/ai-svelte

      npm i https://pkg.pr.new/@tanstack/ai-svelte@2169

      @tanstack/ai-typesafe

      npm i https://pkg.pr.new/@tanstack/ai-typesafe@2169

      @tanstack/ai-utils

      npm i https://pkg.pr.new/@tanstack/ai-utils@2169

      @tanstack/ai-vercel-gateway

      npm i https://pkg.pr.new/@tanstack/ai-vercel-gateway@2169

      @tanstack/ai-vertex

      npm i https://pkg.pr.new/@tanstack/ai-vertex@2169

      @tanstack/ai-vue

      npm i https://pkg.pr.new/@tanstack/ai-vue@2169

      @tanstack/ai-worldlabs

      npm i https://pkg.pr.new/@tanstack/ai-worldlabs@2169

      @tanstack/openai-base

      npm i https://pkg.pr.new/@tanstack/openai-base@2169

      @tanstack/preact-ai-devtools

      npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@2169

      @tanstack/react-ai-devtools

      npm i https://pkg.pr.new/@tanstack/react-ai-devtools@2169

      @tanstack/solid-ai-devtools

      npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@2169

      @tanstack/svelte-ai-devtools

      npm i https://pkg.pr.new/@tanstack/svelte-ai-devtools@2169

      commit: ac53fd2

    5. tanstack-sourceBotcommented Only here. This is not on GitHub.

      Useful: same test-side zombie check as the already-merged #2138, now for the ai-harness bash timeout test. No open duplicate, and this PR does not link an issue.

      TanStack Source bot, value agent

    6. Coverage

      ✅ Coverage held across 34 compared package(s).

      Each package is measured twice in this job — on this PR and on its merge-base with main — and compared. A metric fails only when it is at or above 60% on the merge-base and under 60% on this PR. Other drops are listed but do not fail. Packages your PR doesn't affect are not measured and not listed.

      packagestatementsbranchesfunctionslines
      ai-acp83.40% (0.00)72.32% (0.00)79.01% (0.00)85.05% (0.00)ok
      ai-claude-code88.95% (0.00)77.47% (0.00)86.66% (0.00)90.42% (0.00)ok
      ai-code-mode93.83% (0.00)86.33% (0.00)91.48% (0.00)94.73% (0.00)ok
      ai-code-mode-snippets87.13% (0.00)75.67% (0.00)91.11% (0.00)88.39% (0.00)ok
      ai-codex94.59% (0.00)85.41% (0.00)89.09% (0.00)95.58% (0.00)ok
      ai-computer-local97.29% (0.00)85.71% (0.00)88.00% (0.00)96.84% (0.00)ok
      ai-computer-playwright92.85% (0.00)96.55% (0.00)92.59% (0.00)93.44% (0.00)ok
      ai-computer-sandbox96.25% (0.00)87.50% (0.00)100.00% (0.00)96.05% (0.00)ok
      ai-computer-use96.08% (0.00)92.22% (0.00)95.53% (0.00)98.28% (0.00)ok
      ai-durable-stream86.70% (0.00)82.25% (0.00)92.30% (0.00)88.72% (0.00)ok
      ai-grok-build81.12% (0.00)66.61% (0.00)77.87% (0.00)83.12% (0.00)ok
      ai-harness93.80% (0.00)88.14% (0.00)93.62% (0.00)95.58% (0.00)ok
      ai-harness-cli91.08% (0.00)83.24% (0.00)83.85% (0.00)92.12% (0.00)ok
      ai-isolate-cloudflare94.30% (0.00)71.60% (0.00)100.00% (0.00)94.16% (0.00)ok
      ai-isolate-daytona90.99% (0.00)80.82% (0.00)100.00% (0.00)90.64% (0.00)ok
      ai-isolate-e2b92.38% (0.00)81.75% (0.00)97.43% (0.00)95.21% (0.00)ok
      ai-isolate-node86.04% (0.00)48.33% (0.00)100.00% (0.00)85.36% (0.00)ok
      ai-isolate-quickjs88.84% (0.00)76.92% (0.00)91.66% (0.00)89.87% (0.00)ok
      ai-isolate-quickjs-bun7.36% (0.00)7.53% (0.00)4.76% (0.00)7.94% (0.00)ok
      ai-mcp94.79% (0.00)89.59% (0.00)96.85% (0.00)96.86% (0.00)ok
      ai-opencode79.07% (0.00)71.30% (0.00)75.23% (0.00)81.21% (0.00)ok
      ai-sandbox79.53% (0.00)83.99% (0.00)76.68% (0.00)80.19% (0.00)ok
      ai-sandbox-blaxel87.66% (0.00)77.18% (0.00)82.26% (0.00)89.69% (0.00)ok
      ai-sandbox-boxd95.40% (0.00)86.42% (0.00)93.42% (0.00)98.05% (0.00)ok
      ai-sandbox-cloudflare70.61% (0.00)59.86% (0.00)75.32% (0.00)71.89% (0.00)ok
      ai-sandbox-daytona81.25% (0.00)82.20% (0.00)67.12% (0.00)83.62% (0.00)ok
      ai-sandbox-docker82.89% (0.00)73.57% (0.00)81.16% (0.00)84.67% (0.00)ok
      ai-sandbox-e2b94.84% (0.00)90.71% (0.00)93.24% (0.00)98.64% (0.00)ok
      ai-sandbox-local-process69.27% (0.00)53.59% (0.00)77.01% (0.00)70.30% (0.00)ok
      ai-sandbox-railway94.87% (0.00)92.68% (0.00)90.90% (0.00)97.65% (0.00)ok
      ai-sandbox-sprites73.10% (0.00)60.00% (0.00)73.83% (0.00)75.95% (0.00)ok
      ai-sandbox-upstash-box94.61% (0.00)91.52% (0.00)91.04% (0.00)97.42% (0.00)ok
      ai-sandbox-vercel54.20% (0.00)54.46% (0.00)46.42% (0.00)54.68% (0.00)ok
      ai-skills83.94% (0.00)67.95% (0.00)88.00% (0.00)86.03% (0.00)ok
    7. tanstack-sourceBotcommented Only here. This is not on GitHub.

      Ready to merge: every factory step passed on ac53fd2.

      • spam: not-spam
      • assign: no-match
      • audit: clean
      • classify: recorded
      • value: useful
      • review: no-findings
      • ci-heal: not-a-code-problem

      TanStack Source bot

    8. github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: maintainer

    9. AlemTuzlak merged thisfaff776

    10. AlemTuzlak merged thisfaff776

    11. AlemTuzlak closed this

Sign in to join this conversation.