Skip to content

feat(sdk): add a public agent status snapshot - #699

Closed
bandzalkin wants to merge 1 commit into
feat/host-disconnect-reasonfrom
feat/host-status-snapshot
Closed

bandzalkin wants to merge 1 commit into
feat/host-disconnect-reasonfrom
feat/host-status-snapshot

Conversation

@bandzalkin

Copy link
Copy Markdown
Contributor

Summary

Agent.status() and PlatformRuntime.status() return a frozen AgentStatus: whether the agent is connected, why the platform last disconnected it, when start() completed, and one RoomStatus per joined room with that room's ExecutionState. The snapshot is synchronous and lock-free, so a heartbeat, status file, or tray app can read it without touching private runtime fields.

Changes

  • New AgentStatus and RoomStatus models in src/band/runtime/status.py, exported from band.
  • PlatformRuntime.status() copies in-memory connection, last_disconnect_reason, started_at, and room executions. started_at is set when start() completes and cleared on stop(). A custom Execution without ExecutionState reports state=None.
  • Agent.status() forwards to the runtime.
  • Real-wire tests follow join, processing, idle, and leave, and a restart after supersede reports a fresh started_at with the previous reason cleared.
  • Docs: status section in docs/adapters/managed-host-adapters.md.
  • Idle-room release (release_idle_room_after_s, on_idle_release, release_room_resources) is not in this change.

Related Issues

Split out of #667 (S-8). Stacked on #698 (feat/host-disconnect-reason); review and merge that first.

Testing

  • Unit tests pass (uv run --all-packages pytest tests/ --ignore=tests/integration/ --ignore=tests/e2e/ -q -p no:cacheprovider) — 5928 passed, 156 skipped
  • uv run ruff check . and uv run ruff format --check .
  • uv run --all-packages pyrefly check — 0 errors
  • uv run pytest --markdown-docs docs -q -p no:cacheprovider — 26 passed

Checklist

  • PR title follows Conventional Commits format
  • Code follows project style guidelines
  • Tests added/updated as needed
  • Documentation updated as needed

@bandzalkin bandzalkin changed the title feat(runtime): add a public agent status snapshot feat(sdk): add a public agent status snapshot Sep 29, 2026
@AlexanderZ-Band
AlexanderZ-Band added this pull request to stack #765 October 10, 2026 06:21
Agent.status() and PlatformRuntime.status() return a frozen view of connection, disconnect reason, start time, and each room's execution state, so a host heartbeat does not read private runtime fields.
@bandzalkin

Copy link
Copy Markdown
Contributor Author

Superseded by #849, refreshed on current upstream main with a fork-owned maintenance branch. The replacement records the corrected behavior, actual dependencies, own-delta review/replay base, local verification, and the private-core coverage limitation for fork PRs. This closes the superseded proposal only: no merge, fork-main integration, or source-branch deletion. Original PR history and branch are retained.

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