Repository navigation
feat: stopPatterns option — explicit stop lines count as awaiting the user - #43
Merged
Merged
Conversation
… user Agent setups that end a turn with a protocol line such as "STOP: NEEDS_DECISION <question>" or "STOP: BLOCKED <reason>" usually keep the todo for that decision open. The open-todos nudge then fires and the agent may answer its own question instead of waiting for the user. New opt-in option `stopPatterns` (regex strings, default none): when the newest assistant message's visible text matches one, hasPendingUserInput() returns true, so every idle nudge stands down exactly as for an open question tool. A newer user message clears it. Default behaviour unchanged. Tests: src/index.stop-patterns.test.ts (stop line not nudged, same turn nudged without the option, silent turn end still nudged, reasoning text ignored, invalid pattern skipped). Full suite: 599 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
We have already Done patterns but not stop and it makes sense |
famewolf
added a commit
to famewolf/opencode-auto-resume
that referenced
this pull request
Oct 15, 2026
…package 1.1.21) into PR37
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.
Problem
Some agent setups end every turn with an explicit protocol line, e.g.
STOP: NEEDS_DECISION <question>orSTOP: BLOCKED <reason>, and keep the todo for that decision open until the user answers. The open-todos nudge then fires a few seconds later, and the agent tends to answer its own question instead of waiting.In one such setup, 63 of 73 deliberate stop lines had open todos, so the plugin would have nudged after almost every one of them.
Change
A new opt-in option,
stopPatterns(array of regex strings, default[]):hasPendingUserInput()returnstrue.questiontool call. That covers idle and periodic open-todos nudges, the tool-text scan, action-intent callbacks and thetask_completevisible nudge.Example:
The two helpers are module-internal (not exported), so the bundled dist still exports only plugin-shaped values (the existing regression test stays green).
Tests
src/index.stop-patterns.test.ts:Full suite: 599 pass, 0 fail (
bun test, bun 1.2.23). README: new row in the options table, and a third gate under "User-input awareness".🤖 Generated with Claude Code