Skip to content

fix(host): allow manual resume through active pauses - #55

Merged
HsiangNianian merged 4 commits into
HsiangNianian:mainfrom
quifox:fix/manual-resume-during-pause
Oct 3, 2026
Merged

HsiangNianian merged 4 commits into
HsiangNianian:mainfrom
quifox:fix/manual-resume-during-pause

Conversation

@quifox

@quifox quifox commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Resume now is an explicit user action, but the engine's send-time pause checks also blocked it. The manual notification reason can now bypass global and session pauses for that send; automatic recovery and autonomous-loop sends continue to honor both pause states.

Validation: npm run build, npm run typecheck, npm test, npm run test:runtime, and git diff --check pass. Runtime coverage uses pinned DSH 0.1.7-rc.2 and 0.2.0-rc.1 fixtures.

The pinned plugin checker passes 18 checks with no failures or warnings; the Hub catalog check is skipped because the catalog could not be read.

Sourcery 摘要

允许手动恢复操作绕过自动继续暂停,同时不会削弱对自动发送的暂停强制执行。

新功能:

  • 即使全局或会话自动继续暂停处于激活状态,也允许明确的“立即恢复”操作发送一次。

错误修复:

  • 防止自动恢复和自主循环发送在内部被强制执行时绕过全局或会话暂停。

测试:

  • 增加测试覆盖,验证手动恢复可以绕过这两种暂停,而自动恢复和循环发送仍会被阻止。
Original summary in English

Sourcery 摘要

允许在全局暂停或会话暂停生效期间通过显式手动恢复发送一次,同时继续对自动发送和进行中的设置编辑实施暂停限制。

新功能:

  • 在全局暂停或会话暂停生效期间,允许通过显式的“立即恢复”操作发送一次。

错误修复:

  • 自动恢复和自主循环发送仍受全局暂停和会话暂停的限制。
  • 防止较早的进行中保存操作清除更新的暂存设置编辑。

测试:

  • 增加全局暂停和会话暂停期间手动恢复行为的运行时覆盖测试。
  • 增加待处理保存期间暂存设置编辑的竞态条件覆盖测试。
Original summary in English

Summary by Sourcery

Allow explicit manual resumes through active pauses while preserving pause enforcement for automated sends and in-flight settings edits.

New Features:

  • Allow an explicit “Resume now” action to send once while global or session pauses are active.

Bug Fixes:

  • Keep automatic recovery and autonomous-loop sends subject to global and session pause enforcement.
  • Prevent newer staged settings edits from being cleared by an earlier in-flight save.

Tests:

  • Add runtime coverage for manual resume behavior under global and session pauses.
  • Add race-condition coverage for staged settings edits during pending saves.

@sourcery-ai

sourcery-ai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

审查者指南

允许显式的“立即恢复”操作绕过全局暂停和会话暂停,仅对这一次手动发送生效,同时保留自动恢复和自主循环活动的暂停强制机制;新增了针对性的回归测试,并将其接入测试套件。

绕过暂停执行手动恢复的时序图

sequenceDiagram
    actor User
    participant Runner as AutoContinueRunner
    participant Session as Session

    User->>Runner: resumeNow(sessionId)
    Runner->>Runner: fire(sessionId, MANUAL_NOTIFICATION_REASON, true)
    Runner->>Runner: evaluate manualResume
    alt manual resume
        Runner->>Session: send manual notification
    else automatic recovery or loop
        Runner->>Runner: check global and session pauses
        alt paused
            Runner-->>Session: skip send
        else not paused
            Runner->>Session: send notification
        end
    end
Loading

文件级变更

变更 详情 文件
引入范围严格受限的例外机制,允许显式的“立即恢复”操作在全局暂停或会话暂停生效时仍然发送通知。
  • 定义并复用共享的手动通知原因。
  • 仅将强制手动通知识别为可绕过暂停的发送。
  • 自动恢复和自主循环发送仍需同时遵守两项暂停检查。
src/host/engine.ts
lib/index.js
增加手动恢复行为的回归测试,并确保自主发送仍受暂停机制约束。
  • 为 host fixture 增加调用自动继续操作路由的支持。
  • 测试全局暂停和会话暂停下的“立即恢复”。
  • 验证手动恢复后,自动恢复和循环后续操作仍会被阻止。
  • 将新测试注册到标准测试命令中。
tests/host-fixture.mjs
tests/manual-resume-pauses.mjs
package.json

提示和命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以在审查评论中回复 @sourcery-ai issue,以从该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,以随时生成或重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,以随时生成或重新生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时生成或重新生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论且不想再看到它们,此功能非常有用。
  • 驳回所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可驳回所有现有的 Sourcery 审查。如果你希望使用新的审查重新开始,此功能尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义你的使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

Allows the explicit Resume now action to bypass global and session pauses for its single manual send, while retaining pause enforcement for automatic recovery and autonomous-loop activity; adds focused regression coverage and wires it into the test suite.

Sequence diagram for manual resume bypassing pauses

sequenceDiagram
    actor User
    participant Runner as AutoContinueRunner
    participant Session as Session

    User->>Runner: resumeNow(sessionId)
    Runner->>Runner: fire(sessionId, MANUAL_NOTIFICATION_REASON, true)
    Runner->>Runner: evaluate manualResume
    alt manual resume
        Runner->>Session: send manual notification
    else automatic recovery or loop
        Runner->>Runner: check global and session pauses
        alt paused
            Runner-->>Session: skip send
        else not paused
            Runner->>Session: send notification
        end
    end
Loading

File-Level Changes

Change Details Files
Introduces a narrowly scoped exception allowing the explicit “Resume now” action to send despite active global or session pauses.
  • Defines and reuses a shared manual-notification reason.
  • Recognizes only forced manual notifications as pause-bypassing sends.
  • Keeps automatic recovery and autonomous-loop sends subject to both pause checks.
src/host/engine.ts
lib/index.js
Adds regression coverage for manual resume behavior and preserves pause enforcement for autonomous sends.
  • Adds host-fixture support for invoking the auto-continue action route.
  • Tests Resume now under global and session pauses.
  • Verifies automatic recovery and loop follow-ups remain blocked after manual resume.
  • Registers the new test in the standard test command.
tests/host-fixture.mjs
tests/manual-resume-pauses.mjs
package.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嘿——我已经审阅了你的更改,看起来很棒!

Sourcery 评估

需要人工审阅。 如果绕过暂停的条件不正确,按下“恢复”可能会在全局或会话处于暂停状态时发送助手后续消息,而该后续消息可能触发外部可见的工作或工具操作,并且这些操作无法通过回滚此更改来撤销。影响范围仅限于明确执行的“恢复”操作;通过回滚或再次暂停,可以阻止未来的行为。


Sourcery 对开源项目免费——如果你喜欢我们的审阅,请考虑分享它们 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the pause-bypass condition is wrong, pressing Resume can send an assistant follow-up despite a global or session pause, and that follow-up may trigger externally visible work or tool actions that cannot be undone by reverting the change. The impact is bounded to explicit Resume actions and future behavior can be stopped by reverting or re-pausing.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@HsiangNianian

Copy link
Copy Markdown
Owner

@SourceryAI title

@sourcery-ai sourcery-ai Bot changed the title Allow Resume now while auto-continue is paused fix(host): allow manual resume through active pauses Oct 3, 2026
@HsiangNianian HsiangNianian self-assigned this Oct 3, 2026
@HsiangNianian HsiangNianian added enhancement New feature or request bug Something isn't working labels Oct 3, 2026
@HsiangNianian
HsiangNianian merged commit ec7a6c4 into HsiangNianian:main Oct 3, 2026
3 checks passed
@HsiangNianian

Copy link
Copy Markdown
Owner

Thanks for fixing this! The button now does what the README promises, and I verified that a manual send leaves both pauses in place. I resolved the overlap with #53 and #54, kept both new test suites, and reran the full checks. Merged!

mortang2410 pushed a commit to scratchspace-mortang/dsh-auto-continue that referenced this pull request Nov 13, 2026
…ing-pause

fix(host): allow manual resume through active pauses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants