Skip to content

Conversation

@sirtimid
Copy link
Contributor

@sirtimid sirtimid commented Dec 17, 2025

Closes #657

Add 10-second timeout for network message sends and 30-second timeout for URL redemptions using AbortSignal.timeout. Both timeouts clean up pending operations and trigger appropriate error handling. Includes comprehensive test coverage for timeout scenarios.


Note

Adds 10s timeout for network writes and 30s timeout for ocap URL redemption using AbortSignal.timeout, with cleanup, reconnection handling, and comprehensive tests aided by a new AbortSignal mock.

  • OCAP Kernel Remotes:
    • RemoteHandle.redeemOcapURL:
      • Add 30s timeout via AbortSignal.timeout; race reply vs. timeout; clean pending map and listeners on completion/error.
    • remotes/network.ts:
      • Introduce writeWithTimeout(channel, message, 10_000) using AbortSignal.timeout.
      • Use writeWithTimeout in sendRemoteMessage and flushQueuedMessages; on timeout, log, requeue, and trigger reconnection.
  • Tests:
    • RemoteHandle.test.ts: add timeout tests for URL redemption, including cleanup assertions.
    • network.test.ts: add "message send timeout" suite covering hangs, success-before-timeout, concurrent writes, and error propagation.
  • Test Utilities:
    • Add packages/repo-tools/src/test-utils/abort-signal.ts with makeAbortSignalMock; export from test-utils/index.ts.
  • Config:
    • Minor coverage threshold adjustments in vitest.config.ts.

Written by Cursor Bugbot for commit 198ac7c. This will update automatically on new commits. Configure here.

@sirtimid sirtimid requested a review from a team as a code owner December 17, 2025 15:42
FUDCo
FUDCo previously approved these changes Dec 17, 2025
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

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

Well OK then.

@sirtimid sirtimid force-pushed the sirtimid/remote-comms-timeouts branch from 7a2aa3c to 198ac7c Compare December 17, 2025 22:11
@sirtimid sirtimid enabled auto-merge (squash) December 17, 2025 22:12
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

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

Oh yeah

@sirtimid sirtimid merged commit 5874acb into main Dec 17, 2025
26 checks passed
@sirtimid sirtimid deleted the sirtimid/remote-comms-timeouts branch December 17, 2025 22:21
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.

Remote comms: Add Timeout Mechanisms

3 participants