Return the backend instance matching ``config.provider``.
(config)
| 58 | if isinstance(value, (int, float)) and not isinstance(value, bool): |
| 59 | out[key] = value |
| 60 | if not out and hasattr(usage, "model_dump"): |
| 61 | try: |
| 62 | return {k: v for k, v in usage.model_dump().items() if isinstance(v, (int, float))} |
| 63 | except Exception: # noqa: BLE001 — usage is optional telemetry |
| 64 | return None |
| 65 | return out or None |
| 66 | |
| 67 | |
| 68 | CAW_PROVIDERS = frozenset({"claude-code", "codex"}) |
| 69 | |
| 70 |
no test coverage detected