Repository navigation
fix: a working turn is not cut by a clock, only an idle one ends (4.102.0) - #175
Merged
Merged
Conversation
…02.0) Long agent turns (a long build, a run of tool calls) were stopped while working: every time limit counted from the start. - RunBudget(max_idle_seconds=...): idle mode. The run ends only after that long with nothing happening; a tool in flight (reserve to release) and a provider call in flight (begin_model_call to end_model_call) are activity. max_wall_seconds becomes the hard ceiling. The default (no idle mode) is unchanged. expired(), idle_seconds(), touch(). - max_total_result_bytes bounds all of a run's results apart from one result's cap. - Stage 6 tells the host while a provider call is in flight (_host_model_activity from bind_run_guard). The router's ad hoc scope asks the budget each tick instead of reading its deadline once. - CLI clients: timeout_s is an idle limit (no output and no tool activity). The CLI prints nothing while a bridged tool runs, so the turn's tool surface reports when its tools were last busy (TurnToolSurface.idle_seconds, set_activity_probe). Before, the CLI was killed at the hour. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
무엇이 문제였나
DEV 에서 긴 Agent-Geny 턴(긴 빌드, 연이은 도구 호출)이 일하는 중에 끊겼습니다. 시간 한도가 모두 시작부터 센 고정값이었습니다.
RunBudget(max_wall_seconds≤300)·CancellationScope(deadline≤300s): 턴 시작 5분 뒤 모든 도구·모델 호출이 거절됩니다.timeout_s(기본 3600초)를 시작부터 세서, 일하는 중이어도 1시간에 CLI 를 죽였습니다.바꾼 것
RunBudget(max_idle_seconds=…)유휴 모드: 아무 일도 없이(모델·도구 호출이 없고 도는 것도 없이) 그만큼 지나야 끝납니다. 도는 도구(reserverelease)와 도는 모델 호출(begin_model_callend_model_call)은 활동입니다.max_wall_seconds는 상한이 됩니다. 기본(유휴 모드 아님)은 예전과 같습니다.max_total_result_bytes: 턴 전체 결과 바이트 상한을 결과 하나의 상한과 따로 둡니다.bind_run_guard→_host_model_activity). 라우터의 임시 취소 범위는 마감을 한 번 읽지 않고 예산에 매번 묻습니다.timeout_s가 유휴 한도입니다(출력도 도구 활동도 없이 그만큼). 브릿지 도구가 도는 동안 CLI 는 출력이 없으므로 도구 표면이 활동을 알립니다(TurnToolSurface.idle_seconds→set_activity_probe).시험
tests/unit/test_long_turn_alive.py8개: 도는 도구·모델 호출이 유휴 예산을 열어 두는지, 꾸준한 활동이 예전 고정 한도를 넘기고 상한은 지키는지, 기본 예산은 그대로인지, 출력이 이어지는 CLI 는 한도를 넘어 돌고 조용한 CLI 는 도구가 돌면 기다리고 아무 일도 없으면 멈추는지, 표면의 활동, Stage 6 훅.🤖 Generated with Claude Code