fix: use last resumed event timestamp for 'running for' calculation#328
Merged
ben-fornefeld merged 2 commits intoMay 14, 2026
Merged
Conversation
When a sandbox has been paused and resumed, the 'running for' field now uses the last 'resumed' event timestamp instead of the creation timestamp, so the displayed duration reflects time since the most recent resume rather than total time since creation. Co-Authored-By: ben@e2b.dev <ben@e2b.dev>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: ben@e2b.dev <ben@e2b.dev>
ben-fornefeld
approved these changes
May 14, 2026
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.
Summary
When a sandbox has been paused and then resumed, the "running for" field in the sandbox details header was incorrectly calculating duration from the creation timestamp. This meant it included the paused time in the displayed duration.
This fix looks up the last
sandbox.lifecycle.resumedevent from the lifecycle events array and uses its timestamp as the start for the "running for" calculation. If no resumed event exists (sandbox was never paused), it falls back to the originalcreatedAttimestamp.Review & Testing Checklist for Human
Notes
The change is isolated to
src/features/dashboard/sandbox/header/ran-for.tsx. The events array used is the same one already available in the sandbox lifecycle context and used by the monitoring charts.Link to Devin session: https://app.devin.ai/sessions/ff633b5c68c846719d63d51498cedc2d