Skip to content

fix(cli): one refusal walk for every leaf apply can write #2658

fix(cli): one refusal walk for every leaf apply can write

fix(cli): one refusal walk for every leaf apply can write #2658

Workflow file for this run

name: tests
# Run the offline test suite on every push / PR, across supported Python versions.
# Exercise 3.10 too, where the MCP extra becomes available.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
# Pinned, not ubuntu-latest: the 26.04 image setup-python resolves to has
# no 3.9 build (the job fails before checkout finishes), and timing-based
# tests such as test_era_algotune's reference speedup measured 0.07x there.
# Move this deliberately, with the matrix, when 3.9 support is dropped.
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
# `[mcp]` too, or the MCP server -- the plugin surface this project
# exposes to agents -- is never exercised: `test_mcp.py` and half of
# `test_host_sampling.py` `importorskip` it and pass by doing nothing.
# The extra carries a `python_version >= '3.10'` marker, so 3.9 installs
# the CLI alone and those tests skip there, which is the supported shape.
- run: pip install -e ".[dev,mcp]"
- run: pytest -q
# Source tests above intentionally exercise the checkout. This separate
# gate installs the actual wheel into a clean venv and runs outside it.
- run: pip install build
- run: python -m build --wheel
- run: bash scripts/smoke-wheel.sh dist/*.whl
otel-wire:
# The offline suite fakes the SDK, so nothing used to run the real exporter:
# `export_span`/`export_metric` were `# pragma: no cover`, and the fake
# instruments hid a real `Histogram.add` AttributeError. Here the
# `[otel]` extra is installed and one span plus one metric go to a port
# nothing listens on: the refusal must be logged and contained, never raised
# out of `export_run`, and a real export must still return its count.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- run: pip install -e ".[otel]" pytest
- run: python scripts/otel_wire_smoke.py
- run: AGENTDESCENT_OTEL_WIRE=1 pytest -q tests/test_otel_wire.py tests/test_otel_export.py