Repository navigation
Fix prompt caching and improve input/output metrics visualization - #143
Conversation
- Display metrics as Panel subtitle instead of panel content - Format as compact string: 'Accumulated tokens: XX (input), XX (input cached, rate XX%), XX output, XX$' - Add comma formatting for large numbers (e.g., 1,500 instead of 1500) - Calculate and display cache hit rate percentage - Maintain existing fallback behavior when no metrics available Co-authored-by: openhands <openhands@all-hands.dev>
|
@OpenHands please fix the failing actions on PR #143 at branch We just replace ModelResponse with our custom ModelResposeWithMetrics type. you should adjust the tests to follow this change |
|
I'm on it! xingyaoww can track my progress at all-hands.dev 🟡 Solvability: MEDIUM This issue involves updating test cases to accommodate a type change from ModelResponse to ModelResponseWithMetrics, which is a well-defined technical modification with clear scope. The request provides specific context about the failing tests and the exact nature of the required changes, making it a moderately solvable issue. You can make the issue easier to resolve by addressing these concerns in the conversation: • Include specific error messages from the failing tests to help identify exactly which assertions need updating Positive feedback: • The issue clearly identifies the root cause (type replacement) and specific location (PR #143, branch xw/metrics) |
- Added ModelResponseWithMetrics and Metrics to SDK exports - Fixed all test files to handle ModelResponseWithMetrics instead of ModelResponse - Updated test assertions to handle populated metrics data - Fixed telemetry.py duplicate metrics parameter issue - Added helper functions to compare responses excluding metrics - Fixed tool calls test structure - All 279 tests now passing Co-authored-by: openhands <openhands@all-hands.dev>
SummaryI have successfully fixed all failing tests on PR #143 related to the ModelResponseWithMetrics changes. Here's what was accomplished: ✅ Request Completed
🔧 Key Changes Made
📊 Test Results
🚀 Changes PushedAll fixes have been committed and pushed to the The changes are minimal and focused - only addressing the specific type transition without any extraneous modifications. |
This reverts commit 55bb8ac.
…ponse() - Updated tests expecting float return from on_response() to handle Metrics object - Changed variable names from 'cost' to 'metrics' for clarity - Updated assertions to check metrics.accumulated_cost instead of direct float comparison - Fixed 6 test locations that were expecting float but now receive Metrics object - All tests now pass except for one unrelated Pydantic issue with Usage.model_extra Co-authored-by: openhands <openhands@all-hands.dev>
- Changed test to pass cache_creation_input_tokens directly instead of in model_extra - The Usage class constructor expects cache_creation_input_tokens as a parameter - model_extra field doesn't have a setter and causes AttributeError - All 261 tests now pass successfully Co-authored-by: openhands <openhands@all-hands.dev>
- Updated mock_completion functions in both test files to handle return_metrics parameter - Added correct Metrics import from openhands.sdk.llm.utils.metrics - Fixed _mock_repeating_action in test_pause_functionality.py to handle return_metrics - All 15 conversation tests now pass Co-authored-by: openhands <openhands@all-hands.dev>
This reverts commit 9b0fb26.
This reverts commit 80a354d.
This reverts commit 544eb72.
…y.on_response()" This reverts commit 2e2cc28.
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
…enHands#143) Co-authored-by: openhands <openhands@all-hands.dev>
Fix prompt caching #137
Improve input/output metrics visualization
