Skip to content

Commit 6f3fc23

Browse files
fix(types): definite failover reason + OTel docs correction
- model-fallback.ts:1814: fallback reason now defaults to 'unknown' when failure.reason is undefined, satisfying the string type requirement - opentelemetry.md:219: remove from_hash/to_hash from counter attrs; clarify profile hashes are exported on corresponding span attributes
1 parent 4880f2b commit 6f3fc23

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/gateway/opentelemetry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ on the public diagnostic event bus.
216216
- `openclaw.model_call.response_bytes` (histogram, UTF-8 byte size of streamed response chunk payloads; high-frequency text, thinking, and tool-call deltas count only incremental `delta` bytes; no raw response content)
217217
- `openclaw.model_call.time_to_first_byte_ms` (histogram, elapsed time before the first streamed response event)
218218
- `openclaw.model.failover` (counter, attrs: `openclaw.provider`, `openclaw.model`, `openclaw.failover.to_provider`, `openclaw.failover.to_model`, `openclaw.failover.reason`, `openclaw.failover.suspended`, `openclaw.lane`)
219-
- `openclaw.auth_profile.fallback` (counter, attrs: `openclaw.provider`, `openclaw.model`, `openclaw.auth_profile.from_hash`, `openclaw.auth_profile.to_hash`, `openclaw.auth_profile.reason`)
219+
- `openclaw.auth_profile.fallback` (counter, attrs: `openclaw.provider`, `openclaw.model`, `openclaw.auth_profile.reason`; profile hashes are exported on the corresponding span attributes)
220220
- `openclaw.skill.used` (counter, attrs: `openclaw.skill.name`, `openclaw.skill.source`, `openclaw.skill.activation`, optional `openclaw.agent`, optional `openclaw.toolName`)
221221

222222
### Message flow

src/agents/model-fallback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ async function runWithModelFallbackInternal<T>(
18111811
fromModel: candidate.model,
18121812
toProvider: nextCandidate.provider,
18131813
toModel: nextCandidate.model,
1814-
reason: failure.reason,
1814+
reason: failure.reason ?? "unknown",
18151815
suspended: normalized instanceof FailoverError ? Boolean(normalized.suspend) : false,
18161816
});
18171817
}

0 commit comments

Comments
 (0)