feat(client): add websocket updates #337

Closed
opened 2026-02-22 23:41:24 +00:00 by freemo · 7 comments
Owner

Metadata

  • Commit Message: feat(client): add websocket updates
  • Branch: feature/m7-post-server

Background

WebSocket client subscribes to plan updates with reconnect and exponential backoff. Event schema maps plan status, progress, and log stream updates. Heartbeat/ping handling and resume from last event ID support reliable streaming.

Acceptance Criteria

  • Add WebSocket client for plan updates with reconnect/backoff policy.
  • Define event schema mapping for plan status/progress/log stream updates.
  • Add heartbeat/ping handling and resume from last event ID on reconnect.
  • Add event version negotiation and explicit error for incompatible server schema.
  • Add event de-duplication by event_id and ordered delivery guarantees.

Definition of Done

This issue is complete when:

  • All subtasks below are completed and checked off.
  • A Git commit is created where the first line of the commit message matches
    the Commit Message in Metadata exactly, followed by a blank line, then
    additional lines providing relevant details about the implementation. The
    commit body should be appropriate in size for a commit message and relatively
    complete in describing what was done.
  • The commit is pushed to the remote on the branch matching the Branch in
    Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and
    merged before this issue is marked done.

Subtasks

  • Add WebSocket client for plan updates with reconnect/backoff policy.
  • Define event schema mapping for plan status/progress/log stream updates.
  • Add heartbeat/ping handling and resume from last event ID on reconnect.
  • Add event version negotiation and explicit error for incompatible server schema.
  • Add event de-duplication by event_id and ordered delivery guarantees.
  • Add configurable reconnect backoff parameters in settings.
  • Add docs/reference/server_websocket.md with event types and reconnect rules.
  • Add examples of event payloads and resume behavior.
  • Tests (Behave): Add scenarios for reconnect and event ordering.
  • Tests (Robot): Add WebSocket mock tests.
  • Tests (ASV): Add benchmarks/server_ws_bench.py for message handling baseline.
  • Verify coverage >=97% via nox -s coverage_report. If coverage is <97% then review the current unit test coverage report at build/coverage.xml and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun nox -s coverage_report to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Section: ### Section 18: Deferred Work
Status: Open

## Metadata - **Commit Message**: `feat(client): add websocket updates` - **Branch**: `feature/m7-post-server` ## Background WebSocket client subscribes to plan updates with reconnect and exponential backoff. Event schema maps plan status, progress, and log stream updates. Heartbeat/ping handling and resume from last event ID support reliable streaming. ## Acceptance Criteria - [ ] Add WebSocket client for plan updates with reconnect/backoff policy. - [ ] Define event schema mapping for plan status/progress/log stream updates. - [ ] Add heartbeat/ping handling and resume from last event ID on reconnect. - [ ] Add event version negotiation and explicit error for incompatible server schema. - [ ] Add event de-duplication by event_id and ordered delivery guarantees. ## Definition of Done This issue is complete when: - All subtasks below are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. The commit body should be appropriate in size for a commit message and relatively complete in describing what was done. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. ## Subtasks - [ ] Add WebSocket client for plan updates with reconnect/backoff policy. - [ ] Define event schema mapping for plan status/progress/log stream updates. - [ ] Add heartbeat/ping handling and resume from last event ID on reconnect. - [ ] Add event version negotiation and explicit error for incompatible server schema. - [ ] Add event de-duplication by event_id and ordered delivery guarantees. - [ ] Add configurable reconnect backoff parameters in settings. - [ ] Add `docs/reference/server_websocket.md` with event types and reconnect rules. - [ ] Add examples of event payloads and resume behavior. - [ ] Tests (Behave): Add scenarios for reconnect and event ordering. - [ ] Tests (Robot): Add WebSocket mock tests. - [ ] Tests (ASV): Add `benchmarks/server_ws_bench.py` for message handling baseline. - [ ] Verify coverage >=97% via `nox -s coverage_report`. If coverage is <97% then review the current unit test coverage report at `build/coverage.xml` and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improves coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `nox -s coverage_report` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [ ] Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. **Section**: ### Section 18: Deferred Work **Status**: Open
freemo added this to the (deleted) milestone 2026-02-22 23:41:24 +00:00
freemo modified the milestone from (deleted) to v3.6.0 2026-02-23 00:07:05 +00:00
Author
Owner

Expected completion updated (Day 15 rebaseline): Day 50 / 2026-03-30 (previously Day 45 / 2026-03-25)

**Expected completion updated (Day 15 rebaseline):** Day 50 / 2026-03-30 (previously Day 45 / 2026-03-25)
freemo added the due date 2026-03-17 2026-02-23 18:42:00 +00:00
freemo self-assigned this 2026-02-24 21:53:10 +00:00
Author
Owner

Starting implementation of WebSocket updates client.

Plan:

  • Create src/cleveragents/client/ws_client.py with WebSocketClient
  • Plan update subscription with reconnect/exponential backoff
  • Event schema for plan status/progress/log stream
  • Heartbeat/ping handling, event de-duplication
  • Resume from last event ID on reconnect
  • Add websockets to pyproject.toml
  • Behave, robot, and benchmark tests
Starting implementation of WebSocket updates client. Plan: - Create `src/cleveragents/client/ws_client.py` with WebSocketClient - Plan update subscription with reconnect/exponential backoff - Event schema for plan status/progress/log stream - Heartbeat/ping handling, event de-duplication - Resume from last event ID on reconnect - Add websockets to pyproject.toml - Behave, robot, and benchmark tests
Author
Owner

PM Acknowledgment (Day 31):

Thank you @freemo. PR submitted and tracked.

Status: All server/UI PRs have merge conflicts against current develop (17 PRs merged Days 30-31). Please rebase when ready for review.

Priority: M6 work — continue at current pace. Your velocity is strong (5 merges Day 30).

**PM Acknowledgment (Day 31)**: Thank you @freemo. PR submitted and tracked. **Status**: All server/UI PRs have merge conflicts against current develop (17 PRs merged Days 30-31). Please rebase when ready for review. **Priority**: M6 work — continue at current pace. Your velocity is strong (5 merges Day 30).
Author
Owner

Implementation complete in commit 571a93b3fc on branch feature/m7-post-server. PR #1111 submitted for review.

All subtasks addressed:

  • WebSocket client with reconnect/backoff
  • Event schema for plan status/progress/log
  • Heartbeat/ping handling
  • Resume from last event ID
  • Event version negotiation
  • Event de-duplication
  • Configurable reconnect parameters
  • Reference documentation
  • Behave scenarios (16 scenarios)
  • Robot Framework smoke tests
  • ASV benchmark
Implementation complete in commit 571a93b3fcad5f6a139740f3e7237886eb335eac on branch `feature/m7-post-server`. PR #1111 submitted for review. All subtasks addressed: - [x] WebSocket client with reconnect/backoff - [x] Event schema for plan status/progress/log - [x] Heartbeat/ping handling - [x] Resume from last event ID - [x] Event version negotiation - [x] Event de-duplication - [x] Configurable reconnect parameters - [x] Reference documentation - [x] Behave scenarios (16 scenarios) - [x] Robot Framework smoke tests - [x] ASV benchmark
freemo added reference feature/m7-post-server 2026-03-23 00:21:00 +00:00
Author
Owner

PR #1111 reviewed — changes requested. Three blocking issues remain: (1) merge conflicts with master, (2) two files exceed the 500-line limit, and (3) unclean commit history. See PR #1111 review comment for full details.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer

PR #1111 reviewed — **changes requested**. Three blocking issues remain: (1) merge conflicts with master, (2) two files exceed the 500-line limit, and (3) unclean commit history. See [PR #1111 review comment](https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/1111#issuecomment-81158) for full details. --- **Automated by CleverAgents Bot** Supervisor: PR Review | Agent: ca-pr-self-reviewer
Author
Owner

PR #1111 has been merged successfully. Issue should now be resolved.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer

PR #1111 has been merged successfully. Issue should now be resolved. --- **Automated by CleverAgents Bot** Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Author
Owner

PR #1111 has been reviewed and changes requested. Three blocking issues remain (merge conflicts, 2 files over 500-line limit, unclean commit history). The code quality is excellent — once process issues are resolved, the PR is ready to merge.

See PR #1111 comment for full review.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer

PR #1111 has been reviewed and **changes requested**. Three blocking issues remain (merge conflicts, 2 files over 500-line limit, unclean commit history). The code quality is excellent — once process issues are resolved, the PR is ready to merge. See [PR #1111 comment](https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/1111#issuecomment-109084) for full review. --- **Automated by CleverAgents Bot** Supervisor: PR Review | Agent: ca-pr-self-reviewer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

2026-03-17

Blocks
#399 Epic: Post-MVP Server & Clients
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#337
No description provided.