Skip to content

feat: engine-level guardrail for silent long-running shell commands #433

Closed

Description

@LeXwDeX

Why

#431 在块契约层植入了 shell 纪律(提示词软约束),能引导模型少写静默长命令,但无强制力。需要引擎-工具层的硬兜底:当命令进入长时间零输出状态时自动干预,使"挂死观感→人工 ESC→中断重试"的事故链不再依赖人的注意力。

探索方向(候选,未定案)

  • 静默期检测:shell 工具监测 stdout/stderr 字节流,超过阈值(如 5min)无新字节且未声明 expected-silent 时注入警告或终止
  • 默认上限:无显式 timeout 的命令给默认执行上限(语义变更需评估误伤面)
  • 声明式豁免:允许工具调用侧显式声明 expected-duration/silent 以关闭兜底
  • 取消来源标注:ctx.abort 中断在 metadata 里区分 client-interrupt / internal-cancel / sweep-cancel

约束

关联

Activity

  1. LeXwDeX commented on Sep 1, 2026

    @LeXwDeX
    OwnerAuthor

    Implementation decision: D1 warn-only shell-silence guard. Default threshold is 5 minutes; expectedSilent is an explicit per-invocation exemption; do not auto-kill or sweep-cancel on silence. The existing 2-minute default execution timeout already covers the separate default-cap candidate.

  2. LeXwDeX commented on Sep 3, 2026

    @LeXwDeX
    OwnerAuthor

    由 PR #491 交付(2026-09-01 合入 dev,正文含 Closes #433,warn-only shell-silence guard,默认阈值 5 分钟 + expectedSilent 显式豁免,与 D1 决议一致)。因合入目标是 dev 而非默认分支 main,GitHub 未自动关闭。已随 PR #518(v1.0.39)进入 main。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions