test(copilot/sdk-compat): skip bare-CLI reproduction when proxy enabled

When `claude_agent_use_compat_proxy=True` the operator has explicitly
opted into the workaround. The bare-CLI reproduction stops being a
useful signal in that mode — what matters is the *upstream* (post-
proxy) staying clean, which is covered by
`test_cli_via_compat_proxy_emits_clean_requests_to_upstream`.

Skip the bare test in that case so the dev-preview branch (0.1.58 +
proxy on) goes fully green instead of having an intentional-but-loud
failure on every CI run.

When the proxy is disabled (the default on the standalone proxy and
plumbing PRs), the bare test continues to run unchanged and serves
as the regression detector for the bundled CLI version.
This commit is contained in:
majdyz
2026-04-11 08:34:38 +00:00
parent 2af87616de
commit d702bcfae2

View File

@@ -484,7 +484,23 @@ async def test_cli_does_not_send_openrouter_incompatible_features():
this passes naturally. On a broken pin (0.1.55+, bundled CLI 2.1.91+)
it fails — that failure IS the bisect signal we use to verify which
SDK versions need the workaround.
Skipped when ``claude_agent_use_compat_proxy=True`` because in that
configuration the operator has explicitly opted into the workaround
and the bare-CLI behaviour is moot — what matters is that the
*upstream* (post-proxy) sees clean requests, which is covered by
``test_cli_via_compat_proxy_emits_clean_requests_to_upstream``.
"""
from backend.copilot.config import ChatConfig
if ChatConfig().claude_agent_use_compat_proxy:
pytest.skip(
"Compat proxy is enabled in the active config — the bare-CLI "
"reproduction is not a meaningful signal here. The proxy-routed "
"variant `test_cli_via_compat_proxy_emits_clean_requests_to_upstream` "
"is the regression guard for this configuration."
)
returncode, _stdout, stderr, captured = await _run_reproduction(
route_through_proxy=False
)