Skip to content

fix(capture): bound cleanup and force exit so a wedge fails loudly - #36

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
fix/capture-script-watchdog
Aug 29, 2026
Merged

fix(capture): bound cleanup and force exit so a wedge fails loudly#36
ScriptedAlchemy merged 1 commit into
mainfrom
fix/capture-script-watchdog

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Main's latest CI failed with runtime-playground-capture.test.ts timing out at its full 600s with zero output — the capture script never exited. Fixture boot and cleanup (fixture.close(), browser.close()) were unbounded, and any lingering handle kept the process alive even after the capture settled.
  • Adds a phase-reporting watchdog (480s, under the test's 600s budget) that exits with the wedged phase on stderr, bounds every cleanup step to 30s, and force-exits once the run settles so leaked handles cannot hold the process.
  • Failures now also report the last capture phase, so the next CI flake names its hang site instead of an opaque rstest timeout.

Test plan

  • pnpm rslint and node --check clean
  • runtime-playground-capture.test.ts passes locally with the reworked script (2/2)

@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ab07c55

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T19:08:28.667204Z ab07c55 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: ab07c55923

ℹ️ 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".


export const cleanupCaptureResources = async ({ browser, fixture, restores }) => {
const settledRestores = await Promise.allSettled(restores.map(async (restore) => restore()));
phase('cleanup');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the capture phase before entering cleanup

When any capture phase fails normally, the catch stores that error and then calls cleanupCaptureResources, which unconditionally replaces currentPhase with cleanup. Consequently, the rejection handler always reports Last capture phase: cleanup even when cleanup succeeds and the actual failure occurred during fixture-boot, compile-error, or another named phase. Preserve the phase associated with the primary failure and report cleanup only when cleanup itself is what failed or wedged.

Useful? React with 👍 / 👎.

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@36
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@36

commit: ab07c55

@ScriptedAlchemy
ScriptedAlchemy merged commit 6c20d82 into main Aug 29, 2026
9 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the fix/capture-script-watchdog branch August 29, 2026 19:25
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