Skip to content

[TASK] Phase 5 SignalR clients #11

Description

@nam20485

Task Description

Implement Phase 5 of the LLM response routing plan by wiring resilient SignalR clients for both the Blazor web UI and the Consolonia console UI so downstream chat/dashboard features can subscribe to real-time task events.

Implementation Plan

  • Add Microsoft.AspNetCore.SignalR.Client to the web/console projects, add DotnetAgents.Core references where needed, and introduce TaskHub client configuration (base URL → /taskHub).
  • Define a shared TaskHub client contract (interfaces + payload helpers) inside DotnetAgents.Core so both frontends can rely on the same strongly typed events.
  • Implement TaskHubService in DotnetAgents.Web with automatic reconnect, subscribe/unsubscribe helpers, lifecycle logging, and DI registration/startup/shutdown wiring.
  • Implement ConsoleTaskHubService plus lightweight UI hooks (status text, connection lifecycle) so the console app also establishes and maintains a hub connection using the shared contract.
  • Add guardrail tests for the new TaskHub client components, update the Phase 5 walkthrough/verification docs, and capture manual AppHost run logs showing successful hub connections.

Acceptance Criteria

  • Web UI registers ITaskHubClient as a singleton, starts the hub connection on startup, and exposes typed events (TaskStatusChanged, TaskProgress, etc.).
  • Console app starts the same hub client implementation (console-specific) and surfaces connection status without crashing if the hub is unavailable.
  • Shared TaskHub contract + DTOs live in DotnetAgents.Core (no anonymous payloads or duplicated types in clients) and are referenced by both frontends.
  • dotnet build + dotnet test succeed, and manual Aspire/AppHost run logs show clients connecting to /taskHub with no unhandled exceptions.

Testing Plan

  • dotnet build DotnetAgents/DotnetAgents.slnx
  • dotnet test DotnetAgents/DotnetAgents.Tests/DotnetAgents.Tests.csproj
  • New unit tests covering TaskHub client event serialization/handling
  • Manual AppHost run (dotnet run DotnetAgents/DotnetAgents.AppHost) to verify both clients log successful SignalR connections.

Implementation Notes

  • Base hub URL should come from Aspire service discovery (services:agentapi:https:0) with fallback to AGENT_API_BASE_URL env var and https://localhost:7000 default for standalone console runs.
  • Hook IHostApplicationLifetime (web) / Avalonia lifetime (console) to stop the hub gracefully on shutdown.
  • Document new environment variable expectations and console usage updates inside docs/Phase5_Web_SignalR_Client_Walkthrough.md.

Related Issues/PRs

  • LLM Response Routing Implementation Plan (Phase 5 section)

Activity

  1. added theissue type on Nov 23, 2025
  2. nam20485 commented on Nov 23, 2025

    @nam20485
    MemberAuthor

    Progress Update (Phase 5 SignalR)\n\n- [x] Shared TaskHub client contract/base + endpoint resolver live in DotnetAgents.Core.\n- [x] Web SignalR client + hosted service registered; lifecycle + logging in place.\n- [x] Console client now surfaces connection state and reuses the shared abstractions.\n- [x] Phase 5 walkthrough updated to describe the new architecture and verification steps.\n- [ ] Remaining work: expand automated tests, run dotnet build/test for validation, and capture Aspire log evidence for the verification doc.\n\nHappy to adjust focus if you need other items tackled first.

  3. nam20485 commented on Nov 23, 2025

    @nam20485
    MemberAuthor

    Phase 5 validation update

    • Latest commit 5431b50 contains all Workstreams A–E plus the shared SignalR lifecycle + docs/tests.
    • Validation reran locally prior to the push:
      • dotnet build DotnetAgents/DotnetAgents.slnx ✔️
      • dotnet test DotnetAgents/DotnetAgents.Tests/DotnetAgents.Tests.csproj ✔️ (19 tests, 1 skipped — warning MTP0001 only)
    • SonarCloud Code Analysis has been re-triggered via the PR branch update and is now passing (gh pr checks 12 shows ✓ SonarCloud, only the automated Claude review remains outstanding).
    • Remaining follow-up is simply awaiting reviewer approval on PR Implement SignalR TaskHub client with lifecycle management #12 plus any manual log capture you’d still like; let me know if you want additional evidence gathered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    assigned:copilotIssues assigned to GitHub Copilotcopilot-taskTask for GitHub Copilot workflow

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions