Skip to content

feat(truss): supporting updating an interactive session to have an infinite timeout#2237

Open
aghilann wants to merge 12 commits intomainfrom
infinite-timeout
Open

feat(truss): supporting updating an interactive session to have an infinite timeout#2237
aghilann wants to merge 12 commits intomainfrom
infinite-timeout

Conversation

@aghilann
Copy link
Contributor

@aghilann aghilann commented Feb 19, 2026

🚀 What

Adds support for infinite timeout (-1) on interactive sessions, both at job creation and via the CLI update command.

  • --update-timeout now accepts inf / infinity (case-insensitive) in addition to integer minutes
  • InteractiveSession(timeout_minutes="inf") or timeout_minutes=INTERACTIVE_SESSION_TIMEOUT_INFINITE when defining a job
  • "Expires In" column displays "No timeout" for infinite sessions

💻 How

  • Custom Click param type (_TimeoutType) parses string aliases (inf, infinity, infinite, etc.) to -1
  • Pydantic before validator on InteractiveSession.timeout_minutes coerces the same aliases, with range validation (-1 or 15266080)
  • _format_time_until_expiry treats expiry >1 year away as "No timeout"
  • Exported INTERACTIVE_SESSION_TIMEOUT_INFINITE and InteractiveSession from truss_train public API

🔬 Testing

  • Manual testing against (truss train isession --job-id <id> --update-timeout inf)
  • Pushed a job with an infinite timeout
  • Unit tests for _format_time_until_expiry covering infinite timeout (10-year expiry), boundary cases

Aghilan Nathan and others added 12 commits February 13, 2026 15:06
…n expiry

Adds interactive session timeout extension via `truss train isession --bump`,
with a new API method for PATCH-ing session expiry and an "Expires In" column
in the isession table display.
…pdate

Align CLI with the updated PATCH interactive session endpoint: send
timeout_minutes instead of computing expires_at client-side, surface
the backend's response message per replica, and rename the flag from
--bump to --update for clarity.
Separate timeout and trigger updates into distinct CLI flags. --update-timeout
(or --timeout-minutes) handles timeout extension with wizard fallback.
--update-trigger sets the session trigger with client-side validation
rejecting changes on on_startup sessions.
Remove InquirerPy interactive picker and _update_session_timeout in favor
of direct --timeout-minutes and --update-trigger flags. Both flags can be
combined in a single call with a shared _patch_sessions helper.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Contributor

@rcano-baseten rcano-baseten left a comment

Choose a reason for hiding this comment

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

pls address the ONE_YEAR_SECONDS comment

Comment on lines +301 to +303
if total_seconds > _ONE_YEAR_SECONDS:
return "No timeout"

Copy link
Contributor

Choose a reason for hiding this comment

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

would it be more robust for us to look at the timeout_minutes on the session and then pass in a bool flag that says "has_no_timeout"?

and timeout_minutes < 0
):
error_console.print(
'--update-timeout must be "infinite" or a non-negative integer.'
Copy link
Contributor

Choose a reason for hiding this comment

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

it can also be -1 - we might want to say that as well

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.

2 participants