Skip to content

Update dependencies and handle WebSocket heartbeats - #193

Merged
geffzhang merged 10 commits into
ontologyharnessactionfrom
main
Jul 27, 2026
Merged

geffzhang merged 10 commits into
ontologyharnessactionfrom
main

Conversation

@geffzhang

Copy link
Copy Markdown
Collaborator

This pull request introduces a WebSocket heartbeat mechanism to improve connection reliability in the web chat, and updates the GitHub Actions workflows to use newer versions of the actions/checkout and actions/setup-dotnet actions. It also adds logic to ignore heartbeat messages on the server and tests to ensure correct handling of these cases.

WebSocket Heartbeat Implementation and Handling:

  • Added a client-side heartbeat loop in webchat.js that periodically sends a heartbeat message to the server to keep the WebSocket connection alive. The heartbeat interval is configurable and the timer is properly started and cleared on connect/disconnect. [1] [2] [3] [4] [5] [6]
  • On the server side, updated WebSocketChannel.cs to ignore incoming heartbeat envelopes so they do not trigger message handling logic. Introduced the IsIgnorableClientEnvelope helper for this purpose. [1] [2] [3] [4]

Testing:

  • Added tests in WebSocketChannelTests.cs to verify that the request cancellation token is forwarded correctly and that heartbeat envelopes are ignored and do not result in user messages being processed. [1] [2]

CI/CD Workflow Maintenance:

  • Updated all usages of actions/checkout in workflow YAML files to a newer commit for improved security and reliability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Updated all usages of actions/setup-dotnet and actions/setup-go to newer commits in workflow YAML files. [1] [2] [3] [4] [5] [6] [7] [8]

These changes collectively enhance the reliability of WebSocket connections, ensure heartbeat messages are handled efficiently, and keep CI/CD dependencies up to date.

dependabot Bot and others added 10 commits July 21, 2026 06:13
Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@9c091bb...3d3c42e)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 5.4.0 to 6.0.0.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@26b0ec1...a98b568)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.5.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@924ae3a...b7ad1da)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Adds a periodic heartbeat sender in `webchat.js` (configurable via `heartbeatIntervalMs`) and ensures heartbeat timers are started/stopped with socket lifecycle events. On the server side, `WebSocketChannel` now treats `heartbeat` envelopes as ignorable so they do not emit inbound user messages. Includes a new test to verify heartbeat envelopes are ignored.
Pass the connection request cancellation token through `InboundMessage` in `WebSocketChannel` so downstream handlers can observe client/request aborts. Adds a regression test to ensure the token is forwarded and remains cancellable.
Sanitize `heartbeatIntervalMs` by handling non-finite config values and clamping the result to a safe timer range (1000 to 2147483647 ms). This avoids invalid or overflow-prone intervals when reading `OPENCLAW_WEBCHAT_CONFIG`.
…ions/checkout-7.0.1

build(deps): bump actions/checkout from 7.0.0 to 7.0.1
…ions/setup-dotnet-6.0.0

build(deps): bump actions/setup-dotnet from 5.4.0 to 6.0.0
…ions/setup-go-7.0.0

build(deps): bump actions/setup-go from 6.5.0 to 7.0.0
Handle WebSocket heartbeats end-to-end
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 215fe449-d837-407e-b258-e9a414bc6553

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
  • Commit unit tests in branch main

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.

@geffzhang
geffzhang merged commit 2d34a62 into ontologyharnessaction Jul 27, 2026
48 of 53 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.

2 participants