refactor(computer): merge protocol-level RDP runtime into @midscene/computer#2380
refactor(computer): merge protocol-level RDP runtime into @midscene/computer#2380
Conversation
Deploying midscene with
|
| Latest commit: |
4187da0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4d75fa41.midscene.pages.dev |
| Branch Preview URL: | https://codex-evaluate-naming-differ.midscene.pages.dev |
1457484 to
6879bd0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 289cec48f5
ℹ️ 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".
| async connect(config: RDPConnectionConfig): Promise<RDPConnectionInfo> { | ||
| this.fatalHelperError = undefined; | ||
| await this.ensureHelperStarted(); | ||
| const response = await this.send({ | ||
| type: 'connect', | ||
| config, | ||
| }); |
There was a problem hiding this comment.
Terminate helper process after failed connect
When connect() receives a helper error (for example bad RDP credentials), it throws immediately after send() but never shuts down the spawned helper process. In retry-heavy flows like repeated agentFromComputer({ remote: ... }) attempts, each failed attempt can leave an rdp-helper child running, which wastes resources and can keep the parent process alive. Add cleanup in the failure path so unsuccessful connects do not leak a live helper.
Useful? React with 👍 / 👎.
| .rslib | ||
| **/.rslib | ||
| **/.native-build/ | ||
| docs/ |
There was a problem hiding this comment.
Restrict docs ignore rule to intended path
The docs/ pattern is unanchored, so it matches any docs directory in the repo, including apps/site/docs. That means new documentation files under the site docs tree will be hidden from git status unless force-added, making it easy to accidentally omit required EN/ZH doc updates. This should be scoped to the actual generated-output path (for example /docs/ if root-only) instead of globally ignoring all docs folders.
Useful? React with 👍 / 👎.
961b6ee to
4230180
Compare
Summary
This PR folds the protocol-level RDP runtime into
@midscene/computerand removes the standalone@midscene/rdppackage.After this change, RDP is maintained as a remote Windows runtime under the computer package instead of as a separate package with its own agent surface.
Why
The previous split introduced an unnecessary package boundary:
@midscene/computeralready owns the desktop automation surfaceRDPAgentadded no real behavior beyond wrappingPageAgent<RDPDevice>@midscene/rdppackage made the API and long-term ownership more fragmented than necessaryThe intended model is:
@midscene/computeragentFromComputer()What changed
Package and API consolidation
packages/computer/src/rdp/**packages/rdppackageRDPAgent/agentFromRdp()surfaceagentFromComputer()to support remote RDP targets viaremote: { type: 'rdp', ... }@midscene/computerRuntime and native helper ownership
@midscene/computerpackages/computer/native/rdp/**@midscene/computernow builds both:bin/darwin/phased-scrollbin/<platform>/rdp-helperTests and docs
packages/computer/tests/unit-test/rdp/**packages/computer/tests/ai/rdp/**computer-rdpAI test selection in the computer Vitest config@midscene/computerImpact
Validation
pnpm --filter @midscene/computer run build:nativeNX_TUI=false npx nx build @midscene/computer --skip-nx-cacheNX_TUI=false npx nx test @midscene/computer --skip-nx-cacheAI_TEST_TYPE=computer-rdp pnpm --filter @midscene/computer exec vitest --run tests/ai/rdp/login-form.test.tspnpm install --lockfile-onlypnpm run lintNotes
The fixture-based RDP AI flow passed after the consolidation.
The real-host RDP AI test is still environment-dependent. During the latest verification, the target host
10.75.166.249:3389rejected FreeRDP connections withERRCONNECT_CONNECT_FAILED, and the same failure reproduced outside the Midscene helper path withxfreerdp /auth-only, so that specific failure did not point to a code regression in this PR.