Skip to content

Autoresume timeout persisted on resume#1969

Merged
matthewlouisbrockman merged 20 commits intomainfrom
autoresume-timeout-persisted-on-resume
Mar 24, 2026
Merged

Autoresume timeout persisted on resume#1969
matthewlouisbrockman merged 20 commits intomainfrom
autoresume-timeout-persisted-on-resume

Conversation

@matthewlouisbrockman
Copy link
Contributor

@matthewlouisbrockman matthewlouisbrockman commented Feb 23, 2026

Persists the timeout between resumes for autoresume requests. Tries to respect the user's preference, but does a minimum of 1 minute and maximum of user's team's maximum for the timeout.

@matthewlouisbrockman
Copy link
Contributor Author

@codex review

@matthewlouisbrockman
Copy link
Contributor Author

@claude review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@matthewlouisbrockman matthewlouisbrockman changed the title Autoresume timeout persisted on resume (draft) Autoresume timeout persisted on resume Feb 24, 2026
@matthewlouisbrockman matthewlouisbrockman marked this pull request as ready for review February 24, 2026 02:01
@matthewlouisbrockman matthewlouisbrockman force-pushed the autoresume-timeout-persisted-on-resume branch from 7a84b9f to fc25db9 Compare February 24, 2026 04:00
Copy link
Contributor Author

@matthewlouisbrockman matthewlouisbrockman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

things i want to fix

@matthewlouisbrockman matthewlouisbrockman assigned djeebus and unassigned levb Feb 24, 2026
@ValentaTomas ValentaTomas removed their request for review March 12, 2026 21:13
@cursor
Copy link

cursor bot commented Mar 24, 2026

PR Summary

Medium Risk
Changes sandbox auto-resume timeout semantics and propagates a new timeout field through DB types and orchestrator gRPC, which could affect sandbox lifetime and resume behavior across components. Risk is mitigated by added unit/integration test coverage and plan-limit/minimum clamping.

Overview
Auto-resume now persists and reuses the sandbox’s initial timeout across pauses/resumes by adding a timeout field to the auto-resume config and carrying it through the API→orchestrator boundary. Resume-time and create-time timeouts are clamped to a new feature-flagged minimum (default 300s) and the team plan maximum, replacing the previous fixed 5-minute proxy fallback, with new helper logic plus unit/integration tests to validate the minimum-floor and “use initial timeout, not later updates” behavior.

Written by Cursor Bugbot for commit ff90629. This will update automatically on new commits. Configure here.

}

return timeout
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Min floor overrides team cap in clamp logic

Low Severity

clampAutoResumeTimeout applies the minimum floor after the team-plan cap. If minAutoResumeTimeout exceeds teamPlanLimit, the returned timeout will exceed the team's plan limit, contradicting the PR's stated guarantee of "maximum of user's team's maximum." The min feature flag (default 60s) and team limits (in hours) make this unlikely today, but a future flag adjustment could silently violate the team cap.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it won't violate it

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@matthewlouisbrockman matthewlouisbrockman merged commit 0b0e1db into main Mar 24, 2026
36 checks passed
@matthewlouisbrockman matthewlouisbrockman deleted the autoresume-timeout-persisted-on-resume branch March 24, 2026 21:26
}

return clampAutoResumeTimeout(timeout, getTeamPlanLimit(team), minAutoResumeTimeout)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole file is effectively one function from the outside world, especially if you account for autoResume being nil (as it does on line 40). Can we merge this to a single function? It'd be much more readable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if you pass in the feature flag client, it's even simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good comment, adding to the improvements

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.

3 participants