Repository navigation
Conversation
Once a candidate PR exists, a failed capacity check no longer closes it immediately. check-capacity --wait polls for up to 9 minutes per call and charges a per-candidate KLAUD_CAPACITY_WAIT_MINUTES budget (120), persisted before each sleep so a killed tool call still counts. Exit 1 means call again; exit 2 means the budget is spent and the agent defers. 候选 PR 创建后,容量检查失败不再立即关闭 PR。check-capacity --wait 每次最多轮询 9 分钟,并计入每个候选的 KLAUD_CAPACITY_WAIT_MINUTES 预算 (120 分钟);预算在每次休眠前写入,因此被终止的工具调用也会计入。 退出码 1 表示再次调用;退出码 2 表示预算已用完,代理随后推迟。
This branch has not been deployed
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.
Since #4075, the largest loss is late capacity deferral. #4077, #4097, #4099 and #4107 all passed their smoke run on the new image. Each then failed one capacity snapshot at the final label step, so
finishclosed the PR and deleted the branch. The next wave redoes resolve and smoke from scratch, about $4 of agent time plus a GPU smoke run each time. #4078, #4083 and #4087 were thrown away the same way at a targeted dispatch after the PR existed.Once the PR exists, a failed check now waits instead of deferring.
check-capacity --waitpolls every 60s for up to 9 minutes per call, under Claude Code's Bash limit. Each poll is charged to a per-candidate budget,KLAUD_CAPACITY_WAIT_MINUTES(120), stored in$KLAUD_EVIDENCE. The charge is written before each sleep, so a killed tool call still counts and the wait can't loop forever. Exit codes:0proceed,1call again,2budget spent, so defer. A failed dashboard read counts as unavailable for that poll rather than aborting.Before the PR exists, deferral is still immediate, since nothing is lost. The 80% gate itself is unchanged: the CI scheduler doesn't rank Klaud sweeps below human sweeps, so the gate is what keeps Klaud on idle capacity.
Risk: waiting uses up the 6h agent job. If the final sweep is dispatched late and the job times out, recovery already validates a green exact-head PR sweep afterward (
lifecycle.reconcile). A job that times out while still waiting ends asunexpected-error, which closes the PR just as a deferral does today.中文
自 #4075 以来,最大的损失来自后期的容量推迟。#4077、#4097、#4099 和 #4107 都已在新镜像上通过冒烟测试,但随后在最终标签步骤中有一次容量快照未通过,于是
finish关闭了 PR 并删除了分支。下一轮会从头重新解析并重新做冒烟测试,每次约花费 4 美元的代理时间外加一次 GPU 冒烟运行。#4078、#4083 和 #4087 也以同样方式在 PR 创建后的定向调度阶段被丢弃。PR 创建后,容量检查失败会等待而不是推迟。
check-capacity --wait每 60 秒轮询一次,每次调用最多 9 分钟,低于 Claude Code 的 Bash 时限。每次轮询计入每个候选的预算KLAUD_CAPACITY_WAIT_MINUTES(120 分钟),该预算保存在$KLAUD_EVIDENCE中。预算在每次休眠前写入,因此被终止的工具调用也会计入,等待不会无限循环。退出码:0继续,1再次调用,2预算已用完,需要推迟。仪表盘读取失败只视为该次轮询不可用,而不会中止。PR 创建之前仍然立即推迟,因为此时没有损失。80% 阈值本身不变:CI 调度器不会把 Klaud 的 sweep 排在人工 sweep 之后,因此该阈值是让 Klaud 只使用空闲容量的机制。
风险: 等待会消耗 6 小时的代理任务时间。如果最终 sweep 调度较晚且任务超时,恢复流程已经会在之后验证当前 head 上通过的 PR sweep(
lifecycle.reconcile)。若任务在等待期间超时,结果为unexpected-error,与现在的推迟一样会关闭 PR。AI model disclosure
Prepared with
anthropic/claude-opus-5-5, which analyzed the Klaud outcomes, wrote the code and tests, and drafted this description. No delegated agents were used.