Skip to content

Fix #31, close #31#35

Merged
web3-jeff merged 2 commits intomainfrom
fix/issue-31
Apr 9, 2026
Merged

Fix #31, close #31#35
web3-jeff merged 2 commits intomainfrom
fix/issue-31

Conversation

@web3-jeff
Copy link
Copy Markdown
Collaborator

Summary

Brief description of the changes.

Type

  • Bug fix
  • New feature / detection rule
  • Refactoring
  • Documentation

Testing

  • npm run build passes
  • npm test passes (32 tests)
  • Manually tested the change

Related Issues

Closes #

jeff and others added 2 commits April 9, 2026 16:48
On Windows and Linux, console.log() writes to a non-blocking stdout buffer.
The previous setTimeout(() => process.exit(0), 3000) could force-terminate
the process before the buffer was flushed, causing Claude to receive an empty
path and skip the MEDIA delivery step.

Two fixes:
1. Replace console.log + setTimeout/exit with process.stdout.write(path, callback)
   so the rest of the logic only runs after stdout is confirmed flushed.
2. Use process.exitCode = 0 instead of process.exit() to let Node drain all
   pending I/O naturally.

Also fix Windows browser open: 'start ""' is a cmd.exe built-in and must be
called as 'cmd /c start ""' when spawned via child_process.exec.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without .unref(), if exec child process (xdg-open, cmd /c start) hangs,
Node would never exit naturally and the 3s setTimeout would be the only
exit path — but only if it keeps the event loop alive. With .unref(), the
timer does not prevent natural exit but still fires as a hard fallback if
exec blocks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@web3-jeff web3-jeff merged commit 66c0af6 into main Apr 9, 2026
3 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.

1 participant