Skip to content

fix(async-jobs): stop await-tool timers from hanging tests#3414

Open
mastertyko wants to merge 2 commits intogsd-build:mainfrom
mastertyko:fix/blocker-await-tool-hang
Open

fix(async-jobs): stop await-tool timers from hanging tests#3414
mastertyko wants to merge 2 commits intogsd-build:mainfrom
mastertyko:fix/blocker-await-tool-hang

Conversation

@mastertyko
Copy link
Copy Markdown
Contributor

TL;DR

What: Stops await_tool integration hangs by making completed-job eviction timers non-blocking and shutting test managers down explicitly.
Why: The async-jobs test lane could keep late-suite processes alive, which blocked honest local verification for multiple otherwise-correct fixes.
How: Unref the eviction timer in AsyncJobManager and add explicit manager teardown/assertions in the await-tool tests.

What

This change updates the shared async-jobs blocker used by the current verification round. It keeps completed-job eviction timers from holding the Node process open and tightens the await-tool tests so each test shuts its manager down explicitly.

Affected areas:

  • src/resources/extensions/async-jobs/job-manager.ts
  • src/resources/extensions/async-jobs/await-tool.test.ts

Why

This fixes a real late-suite hang in the await_tool integration family. Without it, unrelated issue branches could go green on targeted checks and still fail to finish the full local CI mirror honestly because the async-jobs test process stayed alive.

How

AsyncJobManager.scheduleEviction() now unref()s its timer when available, so completed-job eviction does not keep the process alive. The await-tool tests now also shut down their managers explicitly and assert the completed-job timer is unref'd.

Change type

  • fix — Bug fix
  • feat — New feature or capability
  • refactor — Code restructuring (no behavior change)
  • test — Adding or updating tests
  • docs — Documentation only
  • chore — Build, CI, or tooling changes

Scope

  • pi-tui — Terminal UI
  • pi-ai — AI/LLM layer
  • pi-agent-core — Agent orchestration
  • pi-coding-agent — Coding agent
  • gsd extension — GSD workflow
  • native — Native bindings
  • ci/build — Workflows, scripts, config

Breaking changes

  • No breaking changes
  • Yes — described above

Test plan

  • CI passes
  • New/updated tests included
  • Manual testing — steps described above
  • No tests needed — explained above

Verified locally with the full CI mirror gate:

  • npm run build
  • npm run typecheck:extensions
  • npm run test:unit
  • npm run test:integration

The final truth phase was re-run in a plain verification clone on the exact branch head after the worktree signal showed a late verifier-environment stall.

AI disclosure

  • This PR includes AI-assisted code — prepared with Codex and verified as described in the test plan above.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🟡 PR Risk Report — MEDIUM

Files changed 2
Systems affected 1
Overall risk 🟡 MEDIUM

Affected Systems

Risk System
🟡 medium Async Jobs
File Breakdown
Risk File Systems
🟡 src/resources/extensions/async-jobs/job-manager.ts Async Jobs
src/resources/extensions/async-jobs/await-tool.test.ts (unclassified)

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

Labels

bug Something isn't working High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant