Skip to content

CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.

docs(changelog): note FallbackBoundModel chain coverage in Tracer/Meter (Unreleased)

xf gong5638c6e029be
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f34b3fa..2d083cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,20 @@ All notable changes to CubePi are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [Unreleased]
+
+### Fixed
+
+- **`Recorder.attach()` and `Meter.attach()` now subscribe to every provider in
+ a `FallbackBoundModel` chain** (closes #167). Previously they only listened
+ to `chain[0].provider`, so post-failover calls executed against `chain[1..]`
+ were invisible to provider-level observability — chat spans, token usage,
+ cache metrics, and cost telemetry were missing for fallback legs. Adds a
+ new `cubepi.providers.fallback.chain_providers()` helper used by both
+ attach paths to walk and dedupe the chain. Agent-event-driven observability
+ (e.g. cost middleware reading `MessageEvent`) was already correct and is
+ unchanged.
+
## [0.9.0] - 2026-06-08
### Added
diff --git a/tests/tracing/test_recorder.py b/tests/tracing/test_recorder.py
index d08a504..eda6198 100644
--- a/tests/tracing/test_recorder.py
+++ b/tests/tracing/test_recorder.py
@@ -1539,9 +1539,7 @@ class TestFallbackChainCoverage:
)
agent = Agent(model=chain_model, system_prompt="t")
exporter = InMemoryExporter()
- tracer = Tracer(
- service_name="t", agent_name="a", exporters=[exporter]
- )
+ tracer = Tracer(service_name="t", agent_name="a", exporters=[exporter])
tracer.attach(agent)
recorder = _find_attached_recorder(primary)
@@ -1564,9 +1562,7 @@ class TestFallbackChainCoverage:
)
agent = Agent(model=chain_model, system_prompt="t")
exporter = InMemoryExporter()
- tracer = Tracer(
- service_name="t", agent_name="a", exporters=[exporter]
- )
+ tracer = Tracer(service_name="t", agent_name="a", exporters=[exporter])
tracer.attach(agent)
# Each event type registered exactly once on the shared provider.