mcpField
L
line-manager-recovery

line-manager-recovery

github.com/islo-labs其他07 次安装今天更新
代码仓库

关于 line-manager-recovery

line-manager-recovery 是供 Line Manager 使用的失败阶段恢复策略技能,依据重试次数决定重试、诊断修复或停止。它提供检查运行记录、定位错误、调整阶段参数及替换损坏沙箱的操作指引。

主要功能

  1. 01按恢复次数选择处理策略
  2. 02检查阶段尝试与运行事件
  3. 03查看命令错误和输出
  4. 04通过 steer 修正阶段输入
  5. 05更换损坏沙箱并保留未推送工作

适用场景

  1. 01处理 Line 阶段运行失败
  2. 02判断是否进行普通重试
  3. 03修正错误参数或 Agent 路径
  4. 04恢复损坏的阶段沙箱

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/islo-labs/skills --skill line-manager-recovery

安装后在 Claude Code 中输入/line-manager-recovery确认已加载。

README 原文English

来自项目 README

README 暂无中文译文,以下为英文原文;中文介绍见上方。

Recovering a failed Line stage

This skill is for the Line Manager. A failed stage parks the run and gives you a routing turn whose context says "reason": "stage_failed". The context fields that drive this policy are:

FieldMeaning
attempt_countConsecutive failures of this stage, including recovery attempts
max_attemptsPlain attempts the stage gets before recovery starts. The stage's max_attempts, or 3 when the Line does not set it
stage_exhaustedattempt_count >= max_attempts: plain retries are used up
recovery_attempt0 while plain retries remain, then 1, 2, ... for each failure after that
error_code, error_messageThe failed JobRun's error

Decide by recovery_attempt

  • 0: plain retry. Run islo factory line-run retry RUN_ID with no changes. Each outcome is evidence: the same error again suggests a deterministic failure, a different error suggests a flaky one. This is the only case where repeating an identical attempt is allowed.
  • 1 or 2: diagnose and recover. Find the cause before acting, then change something you can name. Never repeat an identical retry here.
  • 3 or more: stop. Always end the turn with islo factory line-run stop RUN_ID --reason "...", giving the diagnosis and the action a human needs to take. If a person must decide, put the question in the reason; never end this turn without the stop.

If the error can never succeed on a retry (missing credentials, a rejected parameter, a policy refusal), skip the remaining plain retries and go straight to recovery or stop.

Diagnose

islo factory line-run stages RUN_ID        # per-stage attempts and outcomes
islo factory line-run events RUN_ID        # step timeline and compute command ids
islo job event COMMAND_ID                  # exit code, error detail, output tails
islo factory line get LINE_NAME            # the stage's params, types, and defaults

When the tails are not enough, confirm the stage sandbox still exists with islo ls, then inspect it with islo logs or islo use <sandbox> -- <command>. islo use creates a sandbox that does not exist, so never run it on a name islo ls did not list.

Recover

Pick the smallest change that addresses the cause:

CauseAction
Wrong or missing inputsteer the stage with corrected --param / --param-json values
Agent went down a wrong pathsteer with a focused resume_prompt (or the stage's prompt-like param) written as if the agent has no other context
Agent conversation is broken or cannot resumesteer RUN_ID STAGE --fresh-session --reason "..."
Sandbox is broken (disk full, corrupt checkout, dead services)Replace the sandbox, below

--fresh-session starts the stage agent in a new conversation. It receives a Previous attempts handoff built from the stage's earlier attempts, which includes your --reason, so write the reason as an instruction to the new agent. On a normal steer the reason only goes on the timeline; use params to reach the agent.

Replace a broken sandbox
  1. If islo ls lists the old sandbox, run git status in it with islo use <sandbox> -- ... and push any unpushed work to its PR branch.
  2. Delete it with islo rm <stage sandbox>. Stage sandboxes are named <agent>-<line_run_id> unless the stage sets sandbox_name.
  3. steer RUN_ID STAGE --fresh-session --reason "...". The stage recreates the sandbox from its Machine, which clones the repository default branch; tell the agent in the reason which PR branch to check out.

Never discard pushed commits, PR branches, or stage outputs.

Limits

This policy is advisory. The Line's max_iterations limit is the backstop, and [limits] timeout or budget_usd caps still apply; see the Line Manager prompt for --reset-iterations and --reset-usage.

评论

支持 Markdown