Skip to content

symbiont: add Agent::with_wall_deadline, a wall-clock deadline handle… - #82

Merged
MathisWellmann merged 1 commit into
mainfrom
wall_deadline
Oct 3, 2026
Merged

MathisWellmann merged 1 commit into
mainfrom
wall_deadline

Conversation

@MathisWellmann

Copy link
Copy Markdown
Owner

…d like the code deadline

A host with a time budget per round (agent-symbiont's 15-min sliding slides) waited for its slowest lane: in agent-symbiont 0.38, 35% of lanes ran past 15 min and slides took p50 38 min. Stopping lanes needs to happen inside the run, between turns, so the lane still ends with code.

The Recorder hook stops the request that would go out after the deadline with WALL_DEADLINE_REASON; exhausted_tool_turns() treats it like the code deadline, so the runtime withdraws the tools for the rest of the lane and nudges for the code or a revision: N line. run_without_tools ignores the deadline, so the lane can still answer and repair. A request or tool call already running finishes.

…d like the code deadline

A host with a time budget per round (agent-symbiont's 15-min sliding slides)
waited for its slowest lane: in agent-symbiont 0.38, 35% of lanes ran past
15 min and slides took p50 38 min. Stopping lanes needs to happen inside the
run, between turns, so the lane still ends with code.

The Recorder hook stops the request that would go out after the deadline with
WALL_DEADLINE_REASON; exhausted_tool_turns() treats it like the code deadline,
so the runtime withdraws the tools for the rest of the lane and nudges for the
code or a `revision: N` line. run_without_tools ignores the deadline, so the
lane can still answer and repair. A request or tool call already running
finishes.
@MathisWellmann MathisWellmann self-assigned this Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Summary

The PR adds Agent::with_wall_deadline, which stops a run's tool-call turns at a shared wall-clock instant via the recorder hook, reads the stop reason back through exhausted_tool_turns/nudge for the existing tool-withdrawal path, and exempts run_without_tools so a lane past its deadline can still answer. The plumbing is consistent with the existing code-deadline pattern (reason constants, transcript recovery, observability labels, runtime withdrawal at runtime.rs:1954), and the new unit tests cover the stop-between-turns, post-deadline tool-less answer, and unrepresentable-duration cases.

Issues

None

@MathisWellmann
MathisWellmann merged commit a376022 into main Oct 3, 2026
5 of 6 checks passed
@MathisWellmann
MathisWellmann deleted the wall_deadline branch October 3, 2026 16:39
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