Skip to content

feat(sdk): expose immutable host lifecycle and room status - #849

Closed
bandzalkin wants to merge 10 commits into
band-ai:mainfrom
bandzalkin:feat/host-status-snapshot-refresh
Closed

bandzalkin wants to merge 10 commits into
band-ai:mainfrom
bandzalkin:feat/host-status-snapshot-refresh

Conversation

@bandzalkin

@bandzalkin bandzalkin commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This gives managed hosts an immutable view of agent and room state without polling private runtime structures. Synchronous Agent.status() and PlatformRuntime.status() return I/O-free snapshots; they observe the existing lifecycle owners rather than becoming another lifecycle authority.

  • Add public AgentStatus and RoomStatus models covering running/connected state, terminal disconnect cause, successful-start timestamp, room membership, routing, execution state, and unsettled ownership.
  • Include starting, retiring, and failed-cleanup rooms even after membership or routing disappears. Previously returned snapshots remain unchanged.
  • Keep cleanup_pending visible while initialization, adapter cleanup, runtime resources, or single-instance guards remain owned. A disconnected agent with unfinished cleanup is not reported as cleanly stopped.
  • Observe completed transport shutdown independently of public waiters, and prevent startup completion from overwriting a shutdown observed during bootstrap. Temporary outages preserve the run; cancelling a waiter does not stop a live transport.
  • Require owned cleanup to finish before restart. A new successful run receives a fresh timestamp and clears the previous terminal cause.

Prerequisite

Depends on public terminal-disconnect handling in #843.

Validation

Loopback WebSocket tests cover immutable snapshots, membership and execution transitions, reconnects, shutdown during startup, failed/cancelled cleanup, and restart.

github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 19, 2026
@bandzalkin
bandzalkin force-pushed the feat/host-status-snapshot-refresh branch from e65924d to 0cd68b3 Compare October 20, 2026 06:36
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 20, 2026
@bandzalkin
bandzalkin force-pushed the feat/host-status-snapshot-refresh branch from 0cd68b3 to 9034295 Compare October 20, 2026 11:50
bandzalkin and others added 5 commits October 21, 2026 03:15
Main now reconnects on a peer normal close (reconnect_on_normal_close), so
transport completion is signal_cancel or a policy close: drop normal_close
from the completion matrices and let the linkclose model accept a run that
ends by raising AgentDisconnectedError with its typed reason, as the
surface feature specifies.
…main)

# Conflicts:
#	README.md
#	src/band/agent.py
#	src/band/runtime/platform_runtime.py
#	tests/agent/test_disconnect_real_wire.py
#	tests/agent/wirekit.py
A peer normal close reconnects now, so the startup-cannot-restore-health
case needs a close that truly ends the supervisor.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
@bandzalkin

Copy link
Copy Markdown
Contributor Author

Closing: band-agent does not consume this; may be re-proposed per feature.

@bandzalkin bandzalkin closed this Oct 21, 2026
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