Skip to content

Fail sessions that run far past their time budget - #55

Open
josephschorr wants to merge 2 commits into
mainfrom
enforce-max-duration
Open

josephschorr wants to merge 2 commits into
mainfrom
enforce-max-duration

Conversation

@josephschorr

Copy link
Copy Markdown
Member

A session could stay in Running indefinitely if its runner got stuck — for example, waiting on a model provider that stopped responding — because nothing outside the runner enforced the class's maxDuration budget.

The operator now acts as a backstop: a running session whose recorded run-time goes more than 10 minutes past its maxDuration is marked Failed (BudgetExceeded) with a message explaining why, and its runner is cleaned up like any other failed session. Healthy sessions are unaffected; the runner still enforces the budget itself.

The operator never read status.runDuration, so a runner wedged in a call
that never returned could hold its session in Running indefinitely, with
reported run-time climbing far past the budget and the runner's own
between-turn budget check never reached.

reconcileRunDuration is a backstop for that case. A Running session whose
runner-reported run-time exceeds the effective maxDuration by more than a
10 minute grace is failed with BudgetExceeded via a new signed lifecycle
event (RunDurationExceeded), and the ordinary Failed reap then tears down
its runner. The grace keeps the operator from racing a healthy runner,
which enforces the cap itself. This also makes the admission webhook's
description of runDuration accurate.
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
openagentprimitives Ignored Ignored Preview Nov 5, 2026 10:36pm UTC

Request Review

The backstop reads runner-written status.runDuration, so a runner that
under-reports or freezes it is never caught. Say so where the backstop
and the field are documented, and drop an unrelated reindent.

This branch has not been deployed

No deployments
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.

1 participant