Skip to content

feat: configure stopped-room polling and separate runtime types - #804

Merged
AlexanderZ-Band merged 5 commits into
mainfrom
feat/stopped-resync-interval
Oct 14, 2026
Merged

AlexanderZ-Band merged 5 commits into
mainfrom
feat/stopped-resync-interval

Conversation

@bandzalkin

@bandzalkin bandzalkin commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Why

Stopped rooms probe /next at the base reconciliation interval indefinitely to discover missed PLAY controls. Hosts need to reduce that polling volume without slowing active-room recovery. Session tunables need consistent typed validation and environment configuration, and runtime types need clear ownership.

What

  • Add SessionConfig.stopped_resync_seconds for fixed stopped-room polling, falling back to the base interval when unset.
  • Migrate all of SessionConfig to Pydantic settings. Explicit keyword arguments override case-insensitive environment values; empty values use defaults. Reconciliation intervals share positive, finite constraints and existing working-state timing rules remain enforced.
  • Split runtime configuration, messages, conversation context, contacts, callbacks, and handle formatting into their owning modules. Remove runtime/types.py and update SDK callers, the bridge, examples, tests, and README imports directly. Record the import-ownership rule in AGENTS.md.
  • Preserve earlier armed deadlines on STOP and restore base cadence on PLAY. Cadence tests observe HTTP requests under virtual loop time.

Scope

Quiet-room backoff, startup/reconnect reconciliation, and control fencing are unchanged. The configuration migration intentionally makes SessionConfig construction keyword-only and serialization use model_dump(). The old band.runtime.types import path is removed without compatibility aliases. Other runtime configuration behavior is unchanged.

bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 14, 2026
Source-Base: bcf337b
Source-Head: a83b03f
Applied-Over: 580577e
Conflict-Notes: None; exact feature delta, auto-merged in docs/websocket-events.md and src/band/runtime/execution.py
Upstream-PR: band-ai#804
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 14, 2026

@AlexanderZ-Band AlexanderZ-Band left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three verified issues: required-interval validation regression, constructor coverage bypass, and missing Pydantic settings for the new knob. Applying focused fixes.

Comment thread src/band/runtime/types.py Outdated
Comment thread tests/runtime/resync/test_reconciliation_cadence.py Outdated
Comment thread src/band/runtime/types.py Outdated
@AlexanderZ-Band AlexanderZ-Band changed the title feat: configure the stopped-room reconciliation interval feat: configure stopped-room polling with Pydantic session settings Oct 14, 2026
@AlexanderZ-Band
AlexanderZ-Band dismissed their stale review October 14, 2026 12:12

All three findings were fixed in 2ef3238 and their threads resolved. Final review found no remaining verified defects; lint, formatting, type checks, full unit suite, and focused post-change regressions passed.

@AlexanderZ-Band AlexanderZ-Band changed the title feat: configure stopped-room polling with Pydantic session settings feat: configure stopped-room polling and separate runtime types Oct 14, 2026
bandzalkin and others added 3 commits October 14, 2026 16:11
A room paused by STOP probes /next at the base interval forever, because those probes are the only way to discover a missed PLAY. SessionConfig.stopped_resync_seconds lets operators trade PLAY-discovery latency for request volume on paused rooms. Unset keeps the base interval.

@AlexanderZ-Band AlexanderZ-Band left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Current-main callers in tests/adapters/lifecycle/test_runtime_closing.py:10 and tests/integrations/acp/test_cursor_message_delivery.py:12 still import deleted band.runtime.types. The synthetic merge fails collection on Ubuntu and Windows. Migrate both imports to band.runtime.sessionconfig after updating the branch to current main.

@AlexanderZ-Band AlexanderZ-Band left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh full review found no additional verified defects. One direct-owner import nit remains in callbacks.py.

Comment thread src/band/runtime/callbacks.py Outdated
@AlexanderZ-Band
AlexanderZ-Band force-pushed the feat/stopped-resync-interval branch from 7a75aac to e0b7f5a Compare October 14, 2026 13:24
@AlexanderZ-Band

Copy link
Copy Markdown
Collaborator

Fixed the collection finding in e0b7f5a. The branch now includes current main, and both tests added there import SessionConfig from band.runtime.sessionconfig. The original two collection errors reproduce before the fix; all 11 affected test cases pass afterward. The full suite on the rebased tree passed 8,723 tests, and Ruff, formatting, Pyrefly and markdown checks pass. The direct-owner import nit is also fixed and its thread resolved. The review converged after two passes with no remaining verified defect.

@AlexanderZ-Band
AlexanderZ-Band dismissed their stale review October 14, 2026 13:25

The synthetic-merge collection defect is fixed in e0b7f5a after updating the branch to current main and migrating both callers. The original failure no longer reproduces; affected tests and full local gate passed. Final review found no remaining verified issue.

@AlexanderZ-Band AlexanderZ-Band left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh my-code-review --fix completed against aeb2844. One review cycle converged with no verified findings across all six angle groups; no unresolved existing feedback. Reviewed stopped-room polling, Pydantic SessionConfig settings, and direct imports after deleting runtime/types.py, including the intentional API changes. Simplify only shortened two timing comments. Validation: 8,723 unit tests passed, Ruff check and format check passed, and Pyrefly passed. Live platform timing was not exercised. No linked Linear ticket was found.

@AlexanderZ-Band AlexanderZ-Band left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All verified findings are fixed. The fresh six-angle review found no remaining defects or unresolved feedback. Local validation passed 8,723 tests plus Ruff, formatting, and Pyrefly. CI is complete: 27 passed, 1 skipped.

@AlexanderZ-Band
AlexanderZ-Band added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit f807d62 Oct 14, 2026
28 checks passed
@AlexanderZ-Band
AlexanderZ-Band deleted the feat/stopped-resync-interval branch October 14, 2026 16:58
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 97f8330
Source-Head: 41e9389
Applied-Over: f807d62
Conflict-Notes: Over band-ai#789/band-ai#775: resync entry keeps upstream _drain_synthetic() and drops previous_id as the source does; _recover_actionable_backlog matches TurnOutcome.NOT_ACCEPTED/RETRY_LATER (renamed from BacklogProcessResult), and PAUSED settles behind the existing _stopped check like upstream's /next loop. Over band-ai#804: SessionConfig imported from band.runtime.sessionconfig; resync kit/conftest keep ReconciliationPeer beside BacklogApi. Excludes CHANGELOG.md and FORK-CHANGES.md Fork fix beyond the PR head: the in-snapshot synthetic handoff uses the entry check's rule (not during bootstrap, not while an older message is deferred), so neither bootstrap nor idle recovery stalls on a queued synthetic turn; see FORK-CHANGES.md. A deferral is released whenever its row is locally completed or permanently failed (stop/control fences, processed-ack retry), at every pass start and after every processed row.
Upstream-PR: band-ai#730
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 97f8330
Source-Head: 4184abb
Applied-Over: 3643b7c
Conflict-Notes: Resolved band-ai#709 modify/delete conflicts by replacing OMP ACP with native RPC; retained the workspace flag and current form-policy test class, removed obsolete ACP profile fixtures, migrated the new room-rejoin test and matrix row, and preserved band-ai#804 owner-module imports. No behavioral source hunks dropped; CHANGELOG.md and FORK-CHANGES.md excluded.
Upstream-PR: band-ai#763
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 4184abb
Source-Head: a625466
Applied-Over: fda806c
Conflict-Notes: None; exact feature delta over the ported native OMP lifecycle; retained upstream band-ai#709 and band-ai#804 adaptations from the prerequisite. CHANGELOG.md and FORK-CHANGES.md excluded.
Upstream-PR: band-ai#798
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 97f8330
Source-Head: 41e9389
Applied-Over: d7ab342
Conflict-Notes: Over band-ai#789/band-ai#775: resync entry keeps upstream _drain_synthetic() and drops previous_id as the source does; _recover_actionable_backlog matches TurnOutcome.NOT_ACCEPTED/RETRY_LATER (renamed from BacklogProcessResult), and PAUSED settles behind the existing _stopped check like upstream's /next loop. Over band-ai#804: SessionConfig imported from band.runtime.sessionconfig; resync kit/conftest keep ReconciliationPeer beside BacklogApi. Excludes CHANGELOG.md and FORK-CHANGES.md Fork fix beyond the PR head: the in-snapshot synthetic handoff uses the entry check's rule (not during bootstrap, not while an older message is deferred), so neither bootstrap nor idle recovery stalls on a queued synthetic turn; see FORK-CHANGES.md. A deferral is released whenever its row is locally completed or permanently failed (stop/control fences, processed-ack retry), at every pass start and after every processed row.
Upstream-PR: band-ai#730
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 97f8330
Source-Head: 4184abb
Applied-Over: 1cd5845
Conflict-Notes: Resolved band-ai#709 modify/delete conflicts by replacing OMP ACP with native RPC; retained the workspace flag and current form-policy test class, removed obsolete ACP profile fixtures, migrated the new room-rejoin test and matrix row, and preserved band-ai#804 owner-module imports. No behavioral source hunks dropped; CHANGELOG.md and FORK-CHANGES.md excluded. Over band-ai#802: OMP image and turn-outcome probes move into its imageprobes.py/outcomeprobes.py registries; uv.lock regenerated over band-ai#796.
Upstream-PR: band-ai#763
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 4184abb
Source-Head: a625466
Applied-Over: 00f3dfb
Conflict-Notes: None; exact feature delta over the ported native OMP lifecycle; retained upstream band-ai#709 and band-ai#804 adaptations from the prerequisite. CHANGELOG.md and FORK-CHANGES.md excluded.
Upstream-PR: band-ai#798
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 97f8330
Source-Head: 41e9389
Applied-Over: d7ab342
Conflict-Notes: Over band-ai#789/band-ai#775: resync entry keeps upstream _drain_synthetic() and drops previous_id as the source does; _recover_actionable_backlog matches TurnOutcome.NOT_ACCEPTED/RETRY_LATER (renamed from BacklogProcessResult), and PAUSED settles behind the existing _stopped check like upstream's /next loop. Over band-ai#804: SessionConfig imported from band.runtime.sessionconfig; resync kit/conftest keep ReconciliationPeer beside BacklogApi. Excludes CHANGELOG.md and FORK-CHANGES.md Fork fix beyond the PR head: the in-snapshot synthetic handoff uses the entry check's rule (not during bootstrap, not while an older message is deferred), so neither bootstrap nor idle recovery stalls on a queued synthetic turn; see FORK-CHANGES.md. A deferral is released whenever its row is locally completed or permanently failed (stop/control fences, processed-ack retry), at every pass start and after every processed row.
Upstream-PR: band-ai#730
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 97f8330
Source-Head: 4184abb
Applied-Over: 1cd5845
Conflict-Notes: Resolved band-ai#709 modify/delete conflicts by replacing OMP ACP with native RPC; retained the workspace flag and current form-policy test class, removed obsolete ACP profile fixtures, migrated the new room-rejoin test and matrix row, and preserved band-ai#804 owner-module imports. No behavioral source hunks dropped; CHANGELOG.md and FORK-CHANGES.md excluded. Over band-ai#802: OMP image and turn-outcome probes move into its imageprobes.py/outcomeprobes.py registries; uv.lock regenerated over band-ai#796.
Upstream-PR: band-ai#763
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 15, 2026
Source-Base: 4184abb
Source-Head: a625466
Applied-Over: 00f3dfb
Conflict-Notes: None; exact feature delta over the ported native OMP lifecycle; retained upstream band-ai#709 and band-ai#804 adaptations from the prerequisite. CHANGELOG.md and FORK-CHANGES.md excluded.
Upstream-PR: band-ai#798
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.

2 participants