Skip to content

fix(sdk): restore ACP cost tracking fallback#2449

Open
LarytheLord wants to merge 1 commit intoOpenHands:mainfrom
LarytheLord:fix/acp-cost-tracking-2375
Open

fix(sdk): restore ACP cost tracking fallback#2449
LarytheLord wants to merge 1 commit intoOpenHands:mainfrom
LarytheLord:fix/acp-cost-tracking-2375

Conversation

@LarytheLord
Copy link

Summary

  • restore ACP cost estimation from PromptResponse.usage when UsageUpdate.cost is missing
  • reconcile late real UsageUpdate.cost values against the estimated baseline instead of double-counting
  • notify stats listeners when cost arrives through UsageUpdate and cover the new paths with ACP telemetry tests

Testing

  • uv run pytest tests/sdk/agent/test_acp_agent.py
  • uv run pre-commit run --files openhands-sdk/openhands/sdk/agent/acp_agent.py tests/sdk/agent/test_acp_agent.py

Fixes #2375.

Co-authored-by: openhands <openhands@all-hands.dev>
@enyst enyst requested a review from simonrosenberg March 14, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ACP Cost Tracking Bug

1 participant