返回 DeepSeek-Reasonix
budget.go
根目录 / internal / recovery / budget.go
1 package recovery
2
3 // Fixed product defaults for Auto recovery budgets. These are not configurable
4 // via UI, CLI, or config files — they define the host-owned Auto safety envelope.
5 const (
6 // MaxOperationFailures is how many times one exact operation may fail inside
7 // one Episode before that operation alone is stopped.
8 MaxOperationFailures = 3
9 // MaxEpisodeFailures is how many qualifying execution failures one Task may
10 // accumulate inside one Episode since the last real progress before the
11 // Episode stops further mutation/verification. Parameter, command, or target
12 // changes do not reset it; host-proven read-only diagnosis remains available.
13 MaxEpisodeFailures = 6
14 // MaxReviewRejects is how many cumulative reviewer rejections one Task may
15 // accumulate inside one Episode before the turn stops. Different candidates
16 // share this budget.
17 MaxReviewRejects = 3
18 // MaxStoppedOperationRetries is how many times an already-stopped operation
19 // may be re-proposed before the turn escalates to a hard Episode stop.
20 MaxStoppedOperationRetries = 3
21 )
22
23 // StopReason identifies why an Episode-level stop was raised. Values are
24 // internal; user-facing copy never exposes them.
25 type StopReason string
26
27 const (
28 StopReasonNone StopReason = ""
29 StopReasonEpisodeFailures StopReason = "episode_failures"
30 StopReasonReviewRejects StopReason = "review_rejects"
31 StopReasonStoppedOpRetries StopReason = "stopped_op_retries"
32 StopReasonOperationFailures StopReason = "operation_failures"
33 )
34
35 // Recovery pause product copy. Wire/CLI surfaces use the English string so old
36 // clients that only read err still get a non-technical message.
37 const (
38 // PauseMessageEN is the turn_done.err / CLI text for recovery_paused.
39 PauseMessageEN = "Automatic retries paused. Reasonix stopped repeated attempts and kept completed work. Send \"continue\" to start a fresh attempt, or add instructions to change direction."
40 // PauseMessageZH is the preferred desktop product copy (localized separately).
41 PauseMessageZH = "已暂停自动重试。Reasonix 已停止重复尝试,并保留已完成的工作。发送“继续”即可开始新一轮,也可以补充要求来调整方向。"
42 // FinalizationNudge tells the model it has exactly one summarize-only round.
43 FinalizationNudge = "Auto recovery has reached its limit for this turn. Do not call any more tools. Summarize what was completed, what failed, and what the user should do next. The user can continue in the next message."
44 )
45
45 lines GO