From 640d025a489dfa292e1d40abb0ed5b474b2458a8 Mon Sep 17 00:00:00 2001 From: Alexander Zaikman Date: Fri, 21 Aug 2026 10:48:48 +0300 Subject: [PATCH] fix: clamp copilot_acp emit request and repair codex smoke construction (INT-1254) PR #520 made an unsupported emit kind raise BandConfigError at construction instead of a lazy on_started warning, surfacing two latent gaps in the E2E baseline suite. CopilotACPAdapter declares SUPPORTED_EMIT = frozenset() by design -- its ACP tool narration is unconditional, never emit-gated -- but the shared memory_features()/contacts_features() matrix fixtures hardcode emit={Emit.TOOL_CALLS} for every adapter under test. Clamp the requested emit to CopilotACPAdapter.SUPPORTED_EMIT in its builder so the fixture's intent (observable tool calls) survives without tripping the new construction-time check. test_codex_thoughts_are_not_placeholders still used the retired features=AdapterFeatures(...) constructor pattern PR #520 removed; switch it to the direct emit= kwarg. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01JieRNYtYxMPfLkMqHgbXvT --- tests/e2e/baseline/smoke/adapters/test_codex.py | 4 ++-- tests/e2e/baseline/toolkit/builders.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/e2e/baseline/smoke/adapters/test_codex.py b/tests/e2e/baseline/smoke/adapters/test_codex.py index 7b833b3f6..2d2e3baf9 100644 --- a/tests/e2e/baseline/smoke/adapters/test_codex.py +++ b/tests/e2e/baseline/smoke/adapters/test_codex.py @@ -16,7 +16,7 @@ import pytest from band.adapters.codex import CodexAdapter, CodexAdapterConfig -from band.core.types import AdapterFeatures, Emit +from band.core.types import Emit from tests.e2e.baseline.agents import Lane, lane from tests.e2e.baseline.flaky import flaky_infra @@ -72,7 +72,7 @@ async def test_codex_thoughts_are_not_placeholders( config_kwargs["reasoning_summary"] = "auto" adapter = CodexAdapter( config=CodexAdapterConfig(**config_kwargs), - features=AdapterFeatures(emit={Emit.THOUGHTS}), + emit=Emit.THOUGHTS, ) identity = await resource_manager.provision_agent("codex-thoughts") diff --git a/tests/e2e/baseline/toolkit/builders.py b/tests/e2e/baseline/toolkit/builders.py index 80d923805..4b05b57f6 100644 --- a/tests/e2e/baseline/toolkit/builders.py +++ b/tests/e2e/baseline/toolkit/builders.py @@ -466,10 +466,20 @@ def _build_copilot_acp( if s.backends.copilot_command.strip(): config_kwargs["command"] = tuple(s.backends.copilot_command.split()) + built_features = feature_kwargs(features) + if "emit" in built_features: + # memory_features()/contacts_features() request Emit.TOOL_CALLS so tool + # calls surface as tool_call events for the rest of the matrix, but this + # adapter narrates every tool call unconditionally and declares no + # SUPPORTED_EMIT (see ACPClientAdapter) -- clamp to what it actually + # supports so the shared fixture's intent survives without tripping the + # construction-time unsupported-emit check. + built_features["emit"] &= CopilotACPAdapter.SUPPORTED_EMIT + return CopilotACPAdapter( config=CopilotACPAdapterConfig(**config_kwargs), additional_tools=_custom_tool_defs(tools), - **feature_kwargs(features), + **built_features, )