Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
d1419b7
fix: Keep working-state reporting alive through provider turns
AlexanderZ-Band Oct 18, 2026
8ec26b3
fix: Preserve standalone worker binding across tool wrappers
AlexanderZ-Band Oct 18, 2026
1476457
test: Avoid the E2E peer fixture reservation in runtime tests
AlexanderZ-Band Oct 18, 2026
8bfeac0
style: Format the renamed activity platform fixture
AlexanderZ-Band Oct 18, 2026
a397d8c
test: Use real time for randomized scheduler grace controls
AlexanderZ-Band Oct 18, 2026
0342d96
feat: Deliver compatible activity detail through the working-state re…
AlexanderZ-Band Oct 18, 2026
d76f571
style: Format detail ownership fixture parameters
AlexanderZ-Band Oct 18, 2026
1842638
test: Avoid reserved peer fixtures in activity wire tests
AlexanderZ-Band Oct 18, 2026
06d8124
test: Preserve backlog ordering across valid recovery retries
AlexanderZ-Band Oct 18, 2026
2d69703
feat: Map provider and Band tool progress to room activity
AlexanderZ-Band Oct 18, 2026
64de362
test: Validate activity producers through real execution boundaries
AlexanderZ-Band Oct 18, 2026
831b851
refactor: Consolidate activity reset and streaming usage ownership
AlexanderZ-Band Oct 18, 2026
9d7fc64
test: Register live activity cells and disambiguate runtime fixtures
AlexanderZ-Band Oct 18, 2026
eb7326e
fix: Fence housekeeping activity and clean up cancelled tool starts
AlexanderZ-Band Oct 18, 2026
a674b67
refactor: Share activity observation records and assertions
AlexanderZ-Band Oct 18, 2026
1249060
Merge remote-tracking branch 'origin/main' into feat/python-sdk-repor…
AlexanderZ-Band Oct 20, 2026
1ff4c54
Merge remote-tracking branch 'origin/feat/python-sdk-report-activity-…
AlexanderZ-Band Oct 20, 2026
c139bc2
Merge remote-tracking branch 'origin/feat/python-sdk-report-activity-…
AlexanderZ-Band Oct 20, 2026
2d8c903
test: give the Strands/NOOA job coverage guard a longer timeout
AlexanderZ-Band Oct 20, 2026
f2ff776
Merge remote-tracking branch 'origin/main' into feat/python-sdk-repor…
AlexanderZ-Band Oct 20, 2026
2f4082e
Merge remote-tracking branch 'origin/feat/python-sdk-report-activity-…
AlexanderZ-Band Oct 20, 2026
36ba9a1
Merge remote-tracking branch 'origin/feat/python-sdk-report-activity-…
AlexanderZ-Band Oct 20, 2026
3d52a13
feat: gate activity tool names on the tool-call emit choice
bandzalkin Oct 20, 2026
9511b0f
feat(core): own host harness probes and share catalog metadata
bandzalkin Oct 18, 2026
926fe70
fix(core): keep cancelled probe diagnostics credential-safe
bandzalkin Oct 18, 2026
88a0c6f
fix(core): enroll probes before eager execution
bandzalkin Oct 18, 2026
5d1c9d2
feat(claude): add owned standalone harness preflight
bandzalkin Oct 18, 2026
626dae8
fix(claude): retain CLI until process exit is confirmed
bandzalkin Oct 18, 2026
8958d8f
fix(claude): retain version checks and fence rooms before probes
bandzalkin Oct 18, 2026
c56dcea
fix(claude): preserve imports without the optional SDK
bandzalkin Oct 18, 2026
1bdc0c8
test(claude): preserve probe draining and cleanup requester identity
bandzalkin Oct 19, 2026
079a422
fix(claude): compose host probes with canonical close custody
bandzalkin Oct 19, 2026
0b2ef88
fix(claude): preserve cleanup coroutine override type
bandzalkin Oct 19, 2026
650f8d7
Merge remote-tracking branch 'origin/main' into feat/python-sdk-repor…
AlexanderZ-Band Oct 20, 2026
6a62878
refactor: Flatten the activity compatibility retry
AlexanderZ-Band Oct 20, 2026
4a04046
fix: Learn activity detail support from response headers
AlexanderZ-Band Oct 20, 2026
eac1fdd
fix: Forward activity detail through the baseline ControlLink
AlexanderZ-Band Oct 20, 2026
9a1430b
refactor: Keep one detail reset and one ownership recheck in the repo…
AlexanderZ-Band Oct 20, 2026
435ae73
test: Scope the recovery-jitter patch to resync's random reference
AlexanderZ-Band Oct 20, 2026
90bc52a
fix: Log a content-free cause when activity detail is downgraded
AlexanderZ-Band Oct 20, 2026
3c665de
refactor: Drop the unreachable cycle token and pin reporter guards
AlexanderZ-Band Oct 20, 2026
2c4a9f7
test: Share one activity-support isolation helper
AlexanderZ-Band Oct 20, 2026
cd3c6aa
sim840
Oct 20, 2026
11420ba
Merge upstream main (815 settlement details, 839 squash, websocket te…
bandzalkin Oct 20, 2026
f7c6416
Merge #841 head carrying upstream main (activity stack re-merge)
Oct 20, 2026
d9e9134
Merge upstream main through #877 so stacked preflights compose
Oct 20, 2026
ce6faca
Merge #844 rebased onto current main
Oct 20, 2026
eb8fc7d
Merge #874 (activity stack) so preflight diffs stay their own
Oct 20, 2026
3836517
Merge #844 carrying #874
Oct 20, 2026
f4576ab
Merge upstream main into the activity producers branch
bandzalkin Oct 20, 2026
04c259b
Merge prerequisite head (activity stack re-merged with current main)
Oct 20, 2026
823eeca
Merge upstream main through #838 into the activity delivery branch
Oct 20, 2026
2bc0340
Merge #840 delivery head (main through #838 + X-API-Version and Contr…
bandzalkin Oct 20, 2026
fdaecf6
Merge #841 carrying #840's X-API-Version learning and ControlLink fix
Oct 20, 2026
ef5d6b9
fix(activity): clip over-long tool names before the platform rejects …
bandzalkin Oct 20, 2026
bc5a294
Merge simulation commit landed on this branch; content already supers…
bandzalkin Oct 20, 2026
8f1f1d0
Merge updated prerequisite (final activity stack lineage)
Oct 20, 2026
0aa7226
Merge updated prerequisite (final activity stack lineage)
Oct 20, 2026
a476c3a
test: Accept room event posts in the activity peer
bandzalkin Oct 20, 2026
0d8cbd0
Merge #841 fix: running-room event echo in the activity peer
bandzalkin Oct 20, 2026
60db6dc
Merge #874 (event-echo fix on the activity stack)
bandzalkin Oct 20, 2026
8779254
Merge #844 (event-echo fix through the host stack)
bandzalkin Oct 20, 2026
d697f43
style: drop merge-seam blank lines from the reporter files
bandzalkin Oct 20, 2026
89dab59
Merge #841 (format fix on the activity stack)
bandzalkin Oct 20, 2026
b470206
Merge #874 (format fix on the activity stack)
bandzalkin Oct 20, 2026
ea5ac64
Merge #844 (format fix through the host stack)
bandzalkin Oct 20, 2026
d764959
fix(activity): consult the tool-name gate at report time
bandzalkin Oct 21, 2026
eae7103
Merge #874 (live tool-name gate) into #847
bandzalkin Oct 21, 2026
5f3910a
Merge #874 (live tool-name gate) into #844
bandzalkin Oct 21, 2026
6008159
Merge #0 #847 (chain)
bandzalkin Oct 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ jobs:
BAND_ALLOW_MISSING_FRAMEWORKS: "1"
run: uv run --all-packages pytest tests/e2e/baseline/ --collect-only -q --no-cov

- name: Run CrewAI activity tests
env:
BAND_ALLOW_MISSING_FRAMEWORKS: "1"
run: uv run --all-packages pytest tests/integrations/crewai/activity/

- name: Run crewai tests
env:
# dev-crewai venv lacks langgraph/anthropic/parlant/pydantic-ai/etc.;
Expand All @@ -171,7 +176,7 @@ jobs:
# Only the tests that *need* this venv. Every other crewai test fakes the
# package through sys.modules, so the `test` job above already runs it and
# a second pass here would add no signal — just a path to forget.
# tests/framework_conformance/test_crewai_job_coverage.py keeps this honest.
# tests/framework_conformance/crewaicoverage/ keeps this honest.
run: |
uv run --all-packages pytest \
tests/adapters/test_crewai_flow_phase3.py \
Expand Down Expand Up @@ -233,6 +238,12 @@ jobs:
BAND_TEST_EXTRA: "dev-strands-nooa"
run: uv run --all-packages pytest tests/e2e/baseline/ --collect-only -q --no-cov

- name: Run Strands activity tests
env:
BAND_ALLOW_MISSING_FRAMEWORKS: "1"
BAND_TEST_EXTRA: "dev-strands-nooa"
run: uv run --all-packages pytest tests/adapters/strands/activity/

- name: Run Strands and NOOA tests
env:
# dev-strands-nooa lacks modern framework packages;
Expand Down Expand Up @@ -302,6 +313,11 @@ jobs:
BAND_ALLOW_MISSING_FRAMEWORKS: "1"
run: uv run --all-packages pytest tests/e2e/baseline/ --collect-only -q --no-cov

- name: Run Parlant activity tests
env:
BAND_ALLOW_MISSING_FRAMEWORKS: "1"
run: uv run --all-packages pytest tests/integrations/parlant/activity/

- name: Run parlant tests
env:
# dev-parlant venv lacks langgraph/anthropic-adapter/pydantic-ai/etc.;
Expand All @@ -310,7 +326,7 @@ jobs:
# Only the tests that *need* this venv. Every other parlant test fakes the
# package through sys.modules, so the `test` job above already runs it and
# a second pass here would add no signal — just a path to forget.
# tests/framework_conformance/test_parlant_job_coverage.py keeps this honest.
# tests/framework_conformance/parlantcoverage/ keeps this honest.
run: |
uv run --all-packages pytest \
tests/integrations/parlant/test_catalog.py \
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,28 @@ adapter = GeminiAdapter(GeminiAdapterConfig(model="gemini-3.8-flash"))

Use [examples/run_agent.py](examples/run_agent.py) when you want one command that can switch between LangGraph, Pydantic AI, Anthropic, Claude SDK, Parlant, CrewAI, Codex, A2A bridge, and A2A gateway. Use the per-framework directories under [examples/](examples/) when you want the adapter-specific setup.

### Host-side Harness Probes

`await adapter.preflight(timeout_s=60)` reports a harness handshake as a
`PreflightResult` (`ok`, `reason`, `remedy`). A successful handshake does not prove
that the account can run inference. Adapters without a standalone handshake
implementation explicitly report that it is unsupported.

`await adapter.probe_models(timeout_s=60)` discovers a canonical `ModelCatalog`
without creating or selecting a Band room. Unsupported adapters raise
`BandConfigError`; an empty catalog is not a substitute for unsupported discovery.
The existing room-facing `list_models` hook remains separate.

Catalog entries preserve advertised provider and default metadata. An entry's
`efforts=None` means the harness did not report effort support; `efforts=()` means
it explicitly offers none. `current_model` is populated only when the harness
reports an actual selection.

Timeouts bound how long a caller waits, not ownership of a partially started
transport. Always call `await adapter.cleanup_all()` when disposing of an adapter.
An incomplete close raises `CleanupIncompleteError` and retains its resources for
a later cleanup attempt rather than reporting successful disposal.

### Process Signals

`agent.run()` and `agent.run_forever()` stop the agent on SIGTERM/SIGINT and restore the process's previous handlers when they return. A host that owns its process signals (a launchd/systemd service, a desktop app, a test runner) passes `install_signal_handlers=False` and calls `agent.stop()` from its own handler; `run_forever` then returns. `GracefulShutdown` is a ready-made handler that does this, and `run_with_graceful_shutdown(agent)` wraps it. Put `GracefulShutdown` outside `agent` so its handlers are registered before `start()` and a mid-initialize SIGTERM can still tear down:
Expand Down
22 changes: 22 additions & 0 deletions docs/adapters/claude_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,28 @@ Only a local rejection before `query()` qualifies as `InputNotAccepted`:
transport errors and timeouts do not establish that Claude rejected the input.
The shared room scheduler owns later attempts.

## Standalone host checks

`await adapter.preflight(timeout_s=60)` handshakes a throwaway Claude Code
process using the configured CLI path, environment, directory, plugins and
settings sources. It needs no Band credentials, MCP server or room, and sends
no model query. A successful initialization is not proof of account entitlement
or inference access.

The adapter retains both the SDK client and its transport before connection.
The transport retains an unconfirmed child even if the SDK's own close call
returns; cleanup succeeds only after that child's exit is confirmed.
If an outer transport accepts custody of that child, it may perform the physical
exit confirmation instead; the native handle and version check remain retained.
The preliminary SDK version check also stays owned after cancellation; a CLI
that ignores its shutdown signal can keep cleanup incomplete until it exits.
If a timed-out or failed startup cannot finish closing within the reporting
budget, `CleanupIncompleteError` propagates instead of an ordinary failed
result. Call `await adapter.cleanup_all()` again to join or retry that cleanup;
room and MCP cleanup are still attempted when probe cleanup fails. Room shutdown
keeps its original requester and runs before probe cleanup, even when either
cleanup raises or its caller is cancelled.

## Room ownership

Each room's session is owned through that room's residency
Expand Down
12 changes: 12 additions & 0 deletions docs/turn-outcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,15 @@ once. It does not rewrite the original delivery's settled acknowledgement.
Explicit interruption invalidates its activity; leave and shutdown clear the
indicator while adapter residency retains responsibility for released workers.
The authoritative idle report finishes before a replacement reports working.

`SessionConfig.enable_working_state` controls both the indicator and activity
detail, independently of chat narration and tool capabilities. Changes and
keep-alives share one serialized reporter. The duration cap stops both kinds
of refresh without cancelling provider work; actual completion still clears.

Detail compatibility is learned from the `X-API-Version` header the platform
puts on every activity response. Reports stay boolean until a response in the
process advertises agent API 1.25.0 or later; a missing or older version keeps
boolean reporting. A detail-bearing HTTP 422 permanently disables detail across
all links in the process and retries that report once without detail, within
its original deadline.
36 changes: 18 additions & 18 deletions src/band/adapters/agno.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
is_image_passthrough_result,
redact_tool_call_args,
)
from band.runtime.working_state import end_tool_activity, report_tool_activity

try:
from agno.models.message import Message
Expand Down Expand Up @@ -451,10 +452,7 @@ async def _run_agent(
) -> RunOutput | None:
"""Run the Agno agent with the room's tools bound for this call.

When ``Emit.TOOL_CALLS`` is enabled the run is streamed so tool_call /
tool_result events are emitted *as each tool runs* (see
:meth:`_run_streamed`), matching the other adapters' live reporting.
Otherwise it runs non-streaming, exactly as before.
Consume provider progress as it happens, independently of chat narration.
"""
try:
agent = self._agent
Expand All @@ -469,17 +467,14 @@ async def _run_agent(
session_id,
)
with _bind_room_tools(tools):
if Emit.TOOL_CALLS in self.features.emit:
response = await self._run_streamed(
agent,
messages,
tools,
session_id=session_id,
room_id=room_id,
msg_id=msg_id,
)
else:
response = await agent.arun(input=messages, session_id=session_id)
response = await self._run_streamed(
agent,
messages,
tools,
session_id=session_id,
room_id=room_id,
msg_id=msg_id,
)
# Agno swallows run exceptions into a normal-looking return value
# (status=error); surface it so the shared except path below treats
# the turn as failed rather than as a silent empty reply.
Expand Down Expand Up @@ -532,9 +527,14 @@ async def _run_streamed(
# None, which would read as a successful turn with no output.
raise AgnoRunError(_error_summary(item.content))
else:
await self._emit_stream_event(
item, tools, room_id=room_id, msg_id=msg_id
)
if isinstance(item, ToolCallStartedEvent) and item.tool is not None:
await report_tool_activity(tools, item.tool.tool_name or "")
elif isinstance(item, ToolCallCompletedEvent):
await end_tool_activity(tools)
if Emit.TOOL_CALLS in self.features.emit:
await self._emit_stream_event(
item, tools, room_id=room_id, msg_id=msg_id
)
return final

def _persist_turn(self, room_id: str, response: RunOutput) -> None:
Expand Down
106 changes: 54 additions & 52 deletions src/band/adapters/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
redact_tool_call_args,
)
from band.runtime.tools.schema import is_failed_tool_output
from band.runtime.working_state import tool_activity

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -478,61 +479,62 @@ async def _process_tool_calls(

logger.debug("Executing tool: %s with input: %s", tool_name, tool_input)

# Report tool call if enabled (JSON format with tool_call_id for linking)
# Best-effort: event reporting must never crash tool execution
if Emit.TOOL_CALLS in self.features.emit:
async with tool_activity(tools, tool_name):
# Report tool call if enabled (JSON format with tool_call_id for linking)
# Best-effort: event reporting must never crash tool execution
if Emit.TOOL_CALLS in self.features.emit:
try:
await tools.send_event(
content=json.dumps(
{
ToolEventKey.NAME: tool_name,
ToolEventKey.ARGS: redact_tool_call_args(
tool_name, tool_input
),
ToolEventKey.TOOL_CALL_ID: tool_use_id,
}
),
message_type="tool_call",
)
except Exception as e: # noqa: BLE001 -- tool calls may raise any exception type; must surface to the LLM as an error string, not crash the turn
logger.warning(
"Failed to send tool_call event: %s",
e,
)

# Execute tool (check custom tools first, then platform tools)
try:
await tools.send_event(
content=json.dumps(
{
ToolEventKey.NAME: tool_name,
ToolEventKey.ARGS: redact_tool_call_args(
tool_name, tool_input
),
ToolEventKey.TOOL_CALL_ID: tool_use_id,
}
),
message_type="tool_call",
)
custom_tool = find_custom_tool(self._custom_tools, tool_name)
if custom_tool:
result = await execute_custom_tool(
custom_tool, tool_input, turn=tools.turn
)
succeeded = not is_failed_tool_output(result)
else:
outcome = await tools.execute_tool_call_structured(
tool_name, tool_input
)
result = outcome.value
succeeded = outcome.ok
if succeeded and tool_name == BandTool.NO_REPLY:
declined = True
if not succeeded:
failed = True
if is_image_passthrough_result(tool_name, result):
content = _image_tool_result_content(result)
result_str = image_block_placeholder(len(content))
else:
content = result_str = (
json.dumps(result, default=str)
if not isinstance(result, str)
else result
)
is_error = False
except Exception as e: # noqa: BLE001 -- tool calls may raise any exception type; must surface to the LLM as an error string, not crash the turn
logger.warning(
"Failed to send tool_call event: %s",
e,
)

# Execute tool (check custom tools first, then platform tools)
try:
custom_tool = find_custom_tool(self._custom_tools, tool_name)
if custom_tool:
result = await execute_custom_tool(
custom_tool, tool_input, turn=tools.turn
)
succeeded = not is_failed_tool_output(result)
else:
outcome = await tools.execute_tool_call_structured(
tool_name, tool_input
)
result = outcome.value
succeeded = outcome.ok
if succeeded and tool_name == BandTool.NO_REPLY:
declined = True
if not succeeded:
failed = True
if is_image_passthrough_result(tool_name, result):
content = _image_tool_result_content(result)
result_str = image_block_placeholder(len(content))
else:
content = result_str = (
json.dumps(result, default=str)
if not isinstance(result, str)
else result
)
is_error = False
except Exception as e: # noqa: BLE001 -- tool calls may raise any exception type; must surface to the LLM as an error string, not crash the turn
failed = True
content = result_str = f"Error: {e}"
is_error = True
logger.error("Tool %s failed: %s", tool_name, e)
content = result_str = f"Error: {e}"
is_error = True
logger.error("Tool %s failed: %s", tool_name, e)

# Report tool result if enabled (JSON format with tool_call_id for linking)
# Best-effort: event reporting must never crash tool execution
Expand Down
Loading
Loading