Skip to content

feat(mcp): resolve room-scoped servers at native OMP connection startup - #854

Closed
bandzalkin wants to merge 75 commits into
band-ai:mainfrom
bandzalkin:feat/omp-owned-mcp-resolver
Closed

bandzalkin wants to merge 75 commits into
band-ai:mainfrom
bandzalkin:feat/omp-owned-mcp-resolver

Conversation

@bandzalkin

@bandzalkin bandzalkin commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This resolves external MCP servers when each native OMP room connection starts, so a new connection uses the current room-scoped servers and credentials rather than a static adapter-wide snapshot. Resolution runs under the same owner that acquires and retires the connection.

  • Add the runtime-only resolve_mcp_servers constructor callback, an async (workspace: str) -> Mapping[str, OmpMcpServer]. Call it with the claimed room workspace before creating an overlay or process, and use the same snapshot for the overlay and native readiness checks.
  • Treat the result as the complete external server set, including an empty mapping. Resolution errors fail startup without falling back to static external entries. Live connections reuse their snapshot; a new connection resolves afresh.
  • Preserve the configured band endpoint alongside the resolved external set, and reject resolver results that use that reserved name. Keep provider-environment precedence, owner-only overlays, relative workspace paths and session restoration intact.
  • Join overlapping retirement requests and wait for the active turn's finalization, not its caller's unrelated later work. A result returned after retirement or cancellation cannot launch a process; cancelling a cleanup waiter does not cancel shared retirement.
  • Retain the native handle, overlay and exclusive workspace claim when native close fails. Cleanup and the next turn retry close before releasing resources or starting a new process; retiring sessions never receive new work.

Depends on #763. This does not extend retry guarantees to arbitrary overlay-deletion callback failures.

Validation

Regression coverage includes credential rotation between connections, live-session reuse, empty/error results, matching readiness snapshots, reserved Band names, restored sessions, shutdown during resolution, deadline/cancellation races and failed-native-close retries.

…t-activity-detail-to-the-platform-INT-1744

Keep main's BackendTurns ownership of OpenCode cancellation and register the
watcher as a turn worker so activity reporting outlives the handler. Reporter
unit tests move to tests/runtime/workingreporter; main's workingstate package
keeps the execution-level tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgnNR4uiqD787Bg3yKdZpL
The restack merge resolved src/band/runtime/tools/agent.py to this
branch's older lineage and dropped the activity observation the
producer stack added: the class decorator reporting method calls and
the model-tool wrapper around execute_tool_call. Native OMP work does
not touch that surface; restore it from the prerequisite.
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 20, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
sim-artifacts and others added 2 commits October 21, 2026 05:42
Live capture on the platform showed the OMP hooks posting tool_call activity
details even when Emit.TOOL_CALLS was off: the activity channel is separate
from event narration, so the hook sites need the same gate the narration
already had. I-01/I-02: with tool reporting off, no tool kind or name may
reach the reporter. Tests now pin the gate directly (activity follows the
switch) instead of the incorrect independence premise.

Co-Authored-By: Claude <noreply@anthropic.com>
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
bandzalkin and others added 3 commits October 21, 2026 08:12
The mask wrapper was attached only when the flag was already off, so an
adapter that binds its observer before the emit sync (codex's item/started
path) kept reporting named tool_calls after the choice was turned off. The
observer now always wraps and reads the live flag on every report; the hook
site gates on the OMP branch remain as the second guard. Red-first test:
observer bound with names on, choice flipped off mid-turn, tool report must
arrive nameless.

Co-Authored-By: Claude <noreply@anthropic.com>
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
F-8 closure evidence: an observer bound at turn start now reads the gate
flag at report time (d764959, covered by the flip-after-binding test), and
a stale continuation report after the next turn takes activity ownership is
fenced before it can name anything. The two guards seal R-02 for OMP
background-yield continuations; no production change is required.
@bandzalkin

Copy link
Copy Markdown
Contributor Author

Closing: superseded by in-repo PR(s) #899 with the same content, one concern each and a clean single-author history.

@bandzalkin bandzalkin closed this Oct 21, 2026
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
bandzalkin added a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
github-actions Bot pushed a commit to bandzalkin/band-sdk-python that referenced this pull request Oct 21, 2026
Select upstream band-ai#841 (activity producers, carrying band-ai#839/band-ai#840 via
forward merges), band-ai#874 after 841 (tool-name emit gate with the I-08
name clamp), the host stack ahead of band-ai#763, band-ai#763 after 874 (native OMP
with the tool/permission activity hooks and omp_acp retirement), and
band-ai#854/band-ai#795/band-ai#848 after 763. Replayed from the branches' live heads.
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