Fix reasoning section elapsed timers#4629
Open
KyleAMathews wants to merge 2 commits into
Open
Conversation
Contributor
Contributor
Electric Agents Mobile BuildLocal mobile checks ran for commit The EAS Android preview build was skipped because the |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4629 +/- ##
===========================================
- Coverage 59.24% 35.27% -23.97%
===========================================
Files 385 233 -152
Lines 42734 19900 -22834
Branches 12273 7112 -5161
===========================================
- Hits 25316 7020 -18296
+ Misses 17343 12844 -4499
+ Partials 75 36 -39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix reasoning-section elapsed timers so each thinking block measures from when that block starts, not from the beginning of the run. This prevents later “Thought for …” sections in long tool-using runs from showing inflated durations that grow across the whole run.
Root Cause
ReasoningBlockreceived the parent run timestamp and used it for both the live elapsed timer and the final collapsedThought for …label. In multi-step runs, later reasoning rows can start well after the run begins — for example after a tool call returns — so anchoring every row to the run start made each new reasoning section inherit all prior run time.Approach
ReasoningBlockown its timing anchor locally.ElapsedTimedisplay.streamingtocompleted.timestampprop from the reasoning block API.Rows that mount already completed still render as bare
Thought, because the UI does not know their true start/end duration.Key Invariants
Non-goals
✓ done in …timing.Trade-offs
This uses the client-observed first-live-render time rather than a persisted provider/server timestamp. That is intentionally scoped: it fixes the live UI inflation bug without adding schema or event-model changes. Historical rows still avoid showing made-up durations.
Verification
Also validated changeset coverage:
Files changed
.changeset/fix-reasoning-timers.md@electric-ax/agents-server-ui.packages/agents-server-ui/src/components/AgentResponse.tsxReasoningBlock.packages/agents-server-ui/src/components/ReasoningSection.tsxtimestampprop fromReasoningBlock.packages/agents-server-ui/src/components/ReasoningSection.test.tsxThought for Ns.