Skip to content

[codex] Fix TypeScript computer test contract and reconnect#1502

Draft
iqdoctor wants to merge 1 commit into
trycua:mainfrom
strato-space:codex/fix-ts-computer-tests
Draft

[codex] Fix TypeScript computer test contract and reconnect#1502
iqdoctor wants to merge 1 commit into
trycua:mainfrom
strato-space:codex/fix-ts-computer-tests

Conversation

@iqdoctor
Copy link
Copy Markdown

@iqdoctor iqdoctor commented May 13, 2026

Summary

  • fixes BaseComputerInterface.connect() so reconnect after a closed socket waits for the recreated WebSocket to open before sending commands
  • prevents failed initial connection attempts from scheduling uncontrolled background reconnects after caller disconnect()
  • updates MacOSComputerInterface tests to assert the current byte-transport file contract used by TS and Python generic interfaces
  • covers default offset: 0 and append: false transport parameters

Closes #1501.

Validation

cd libs/typescript
pnpm --filter @trycua/computer exec vitest run tests/interface/macos.test.ts
pnpm --filter @trycua/computer test --run
pnpm --filter @trycua/computer typecheck
pnpm --filter @trycua/core test --run
pnpm --filter @trycua/agent test --run
pnpm build
pnpm exec prettier --check computer/src/interface/base.ts computer/tests/interface/macos.test.ts
pnpm -r typecheck

Not run: pnpm -r test, because @trycua/playground has no test files and exits nonzero.

Replacement for #1500, recreated via local gh as iqdoctor.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1d459e8-ab82-43ed-8e5f-57d4aa6ccdb7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Fixes trycua#1501 by preserving the current file transport contract, making reconnect wait for the recreated WebSocket to open, and preventing failed/closed sockets from scheduling uncontrolled background retries.

Constraint: TypeScript readText/writeText already mirror the Python generic interface by encoding text through readBytes/writeBytes for chunking, offset, and append support.
Rejected: Switching TS readText/writeText back to direct read_text/write_text transport | would diverge from the existing Python generic implementation and lose shared byte-path behavior.
Rejected: Leaving close-triggered reconnect unconditional | failed initial connects can leak retry timers after caller disconnects.
Confidence: high
Scope-risk: narrow
Directive: Keep file API tests focused on public method behavior plus the transport defaults actually sent by the implementation; keep WebSocket reconnect ownership explicit.
Tested: pnpm --filter @trycua/computer exec vitest run tests/interface/macos.test.ts; pnpm --filter @trycua/computer test --run; pnpm --filter @trycua/computer typecheck; pnpm --filter @trycua/core test --run; pnpm --filter @trycua/agent test --run; pnpm build; pnpm exec prettier --check computer/src/interface/base.ts computer/tests/interface/macos.test.ts; pnpm -r typecheck
Not-tested: pnpm -r test, because @trycua/playground has no test files and exits nonzero.
@iqdoctor iqdoctor force-pushed the codex/fix-ts-computer-tests branch from 6dc7387 to fa391b8 Compare May 13, 2026 12:33
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 13, 2026

@iqdoctor is attempting to deploy a commit to the Cua Team on Vercel.

A member of the Team first needs to authorize it.

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.

TypeScript computer tests fail for file byte transport and reconnect after disconnect

1 participant