Repository navigation
Conversation
The model.usage diagnostic event carrying token + cost data was only emitted for channel turns (runReplyAgent) and cron runs (finalizeCronRun), leaving HTTP ingress paths (/v1/responses, /v1/chat/completions) invisible to diagnostics consumers like Langfuse, OTEL, and Prometheus. Fix: after the agent completes in the OpenResponses HTTP handler, extract usage from agentMeta and emit model.usage when diagnostics are enabled. Uses the same normalizeUsage/cost helpers as the channel path. Fixes openclaw#96093 Co-Authored-By: Claude (via Anthropic API) <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Fixed type compatibility issue (GatewayHttpResponsesConfig → OpenClawConfig cast). @clawsweeper re-review |
|
Codex review: needs real behavior proof before merge. Reviewed June 23, 2026, 11:11 PM ET / 03:11 UTC. Summary PR surface: Source +57. Total +57 across 1 file. Reproducibility: yes. at source level: current main routes both OpenAI-compatible HTTP handlers through Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Emit Do we have a high-confidence way to reproduce the issue? Yes at source level: current main routes both OpenAI-compatible HTTP handlers through Is this the best way to solve the issue? No. The endpoint-local patch is not the best fix because it misses chat completions and streaming Responses and cannot reliably honor top-level diagnostics config; the maintainable fix belongs at shared ingress finalization or a shared helper. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d15e89a83e61. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +57. Total +57 across 1 file. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Closing as superseded by #96152, which has now merged. #96152 fixed the same #96093 issue at the shared Thanks for chasing the same diagnostics gap. |
|
补充了编译和测试验证输出。@clawsweeper re-review |
|
Updated PR body with required What Problem This Solves and Evidence sections (English headers). @clawsweeper re-review |
Fixes #96093
What Problem This Solves
model.usagediagnostic (the only event carrying token+cost data) was only emitted for channel turns (runReplyAgent) and cron runs (finalizeCronRun). HTTP ingress paths (/v1/responses,/v1/chat/completions) were invisible to all diagnostics consumers — Langfuse, OTEL, Prometheus.Evidence
Fix
After the agent completes in the OpenResponses HTTP handler, extract usage from
result.meta.agentMeta.usageand emitmodel.usageusing the samenormalizeUsage/estimateUsageCosthelpers as the channel path.Verification
What was not tested
End-to-end with a live Langfuse/OTEL subscriber. The emit follows the same pattern as
runReplyAgent.Checks
1 file, +57 lines. Lockfile unchanged.