Skip to content

Fix stale subagent indicators with completion flag and startup sync#231

Merged
rockfordlhotka merged 1 commit intomainfrom
fix/active-status-sync
Apr 2, 2026
Merged

Fix stale subagent indicators with completion flag and startup sync#231
rockfordlhotka merged 1 commit intomainfrom
fix/active-status-sync

Conversation

@rockfordlhotka
Copy link
Copy Markdown
Member

Summary

  • Fix ongoing cleanup bug: Added IsCompletion flag to AgentReply so subagent completion bubbles immediately close their activity log entries (spinner + header badge). Previously, the Phase 2 synthesis reply was PrimaryFinal which only cleared the primary progress key, leaving subagent indicators stuck until the next user message.
  • Add startup reconciliation: New ActiveStatusRequest/ActiveStatusResponse message pair lets the Blazor UI query the agent for actually-running subagents on startup, clearing stale _activeActivityLogs entries that survive in the singleton ChatStateService across page reloads, and seeding indicators for subagents that started before the UI connected.

Test plan

  • Spawn multiple subagents → verify header 🤖 indicators disappear when each completes (not on next user message)
  • Refresh the page while subagents are running → verify running subagents show indicators, completed ones do not
  • Refresh the page with no subagents running → verify no stale indicators appear
  • Verify activity log bubbles stop showing spinners once their subagent completes
  • Run dotnet test RockBot.slnx — all 833 tests pass (0 failures)

🤖 Generated with Claude Code

Subagent activity-log entries in _activeActivityLogs were never closed
when subagents completed because the Phase 2 synthesis reply was
PrimaryFinal (clearing only the primary progress key). Indicators
persisted until the next user message triggered SetProcessing(true).

Additionally, the singleton ChatStateService retained stale entries
across page reloads with no way to reconcile against actual agent state.

Two-pronged fix:
- Add IsCompletion flag to AgentReply so SubagentResultHandler's Phase 1
  completion bubble immediately closes its activity log entry
- Add ActiveStatusRequest/Response message pair so the Blazor UI can
  query the agent for running subagents on startup and reconcile stale
  indicators (removing dead ones, seeding live ones)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rockfordlhotka rockfordlhotka merged commit 0118cbf into main Apr 2, 2026
2 checks passed
@rockfordlhotka rockfordlhotka deleted the fix/active-status-sync branch April 2, 2026 04:40
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.

1 participant