Skip to content

feat(computer): add health check in connect method#2014

Merged
quanru merged 2 commits intomainfrom
claude/add-health-check-iTF2P
Feb 14, 2026
Merged

feat(computer): add health check in connect method#2014
quanru merged 2 commits intomainfrom
claude/add-health-check-iTF2P

Conversation

@yuyutaotao
Copy link
Collaborator

Adds a health check that runs after device connection to verify
screenshot capture and mouse control are functional. Prints each
step's progress and result, and calls process.exit(1) on failure.

https://claude.ai/code/session_01Hq1A7zcygrUbksNURbj3Hk

Adds a health check that runs after device connection to verify
screenshot capture and mouse control are functional. Prints each
step's progress and result, and calls process.exit(1) on failure.

https://claude.ai/code/session_01Hq1A7zcygrUbksNURbj3Hk
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: e181353799

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

Comment on lines +377 to +379
console.error(`[HealthCheck] Screenshot failed: ${error}`);
process.exit(1);
}

Choose a reason for hiding this comment

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

P1 Badge Throw health-check failures instead of exiting process

Calling process.exit(1) here makes ComputerDevice.connect() terminate the entire Node.js process on a transient screenshot/mouse failure, which is a breaking behavior change for library consumers (for example agentFromComputer() and MCP tool hosts) that previously could catch and recover from connection errors. This should propagate an exception instead so callers can decide whether to retry, degrade, or shut down gracefully.

Useful? React with 👍 / 👎.

Comment on lines +402 to +405
const movedPos = libnut.getMousePos();
console.log(
`[HealthCheck] Mouse position after move: (${movedPos.x}, ${movedPos.y})`,
);

Choose a reason for hiding this comment

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

P2 Badge Assert the mouse position changed during health check

This health check logs the post-move cursor position but never validates it, so the method can still report success even when mouse movement is effectively non-functional (for example when the move call is ignored/no-op in restricted desktop environments). Since the feature’s purpose is to verify control works, this should fail when movedPos does not reflect the requested move.

Useful? React with 👍 / 👎.

@quanru quanru merged commit 356422e into main Feb 14, 2026
5 of 6 checks passed
@quanru quanru deleted the claude/add-health-check-iTF2P branch February 14, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants