Skip to content

Broker keeps stale agent registration after an app crash; agent status and diagnose disagree #342

Description

@davidortinau

Summary

After an app crash, agent status continued to list the dead instance's agent (same ID and port) while diagnose simultaneously reported broker_running: false and agent_count: 0 — contradictory state that implied a healthy agent that was actually gone.

Environment

  • Host OS/platform: macOS 26.5.1 (arm64)
  • AI tool/host: GitHub Copilot CLI
  • Model: Claude Opus 4.8
  • MAUI CLI: maui devflow 0.1.0-preview.11.26317.2 (CLI commands, not MCP)
  • App framework(s): .NET MAUI 11.0.0, Blazor Hybrid (WebView)
  • Target platform(s): macOS AppKit (net11.0-macos) via community Platform.Maui.MacOS 0.3.0 + Platform.Maui.MacOS.BlazorWebView 0.3.0
  • .NET SDK: 11.0.100-preview.5
  • MAUI DevFlow package versions: Microsoft.Maui.DevFlow.Agent 0.25.0-dev, Microsoft.Maui.DevFlow.Blazor 0.25.0-dev; agent runtime 0.25.0-dev

What happened

The app crashed (an unrelated app-side exception). Afterward the broker and agent views disagreed about whether an agent was connected.

Attempts and workarounds

  1. agent status listed the crashed instance's agent on its port, with the same agent ID it had before the crash.
  2. diagnose reported broker_running: false and agent_count: 0.
  3. wait returned a different, unrelated agent.
  4. broker start plus a direct --agent-host 127.0.0.1 --agent-port <port> connection to the relaunched agent restored a working connection.

Expected behavior

Crashed/disconnected agents should be evicted from broker registration promptly, and agent status and diagnose should report consistent broker/agent state.

Actual behavior

A stale registration persisted and the two commands disagreed, making it unclear whether the agent was alive.

Outcome

Worked around (broker restart + direct port connection).

Scope

Single current session verifying a macOS AppKit feature in a .NET MAUI Blazor Hybrid app.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions