Repository navigation
feat(v2): host-verified TASK.md checklist stop for Loop (#174) - #182
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 742e34cafc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| // A quoted example must not be mistaken for an actionable checkbox. | ||
| if (/^\s*>/.test(line)) continue | ||
| const match = line.match(/^\s{0,24}[-+*]\s+\[([ xX])\](?:\s|$)/) |
There was a problem hiding this comment.
Count ordered task-list items before declaring completion
Markdown task-list items can use ordered list markers, but this regex recognizes only -, +, and *. For a checklist such as - [x] setup followed by 1. [ ] implement, the function reports complete, causing the host to stop the loop while an actionable task remains. Include ordered-list markers when determining the total and pending counts.
Useful? React with 👍 / 👎.
| const start = original.indexOf("<!--", offset) | ||
| if (start < 0) { | ||
| line += original.slice(offset) | ||
| break | ||
| } | ||
| line += original.slice(offset, start) | ||
| comment = true | ||
| offset = start + 4 |
There was a problem hiding this comment.
Ignore HTML comment markers inside Markdown code
The comment scanner runs before recognizing code spans or fenced-code contents, so a literal <!-- inside inline code—or an unmatched example inside a fence—sets comment for the rest of the file. If a checked task appeared earlier, later pending tasks are discarded and the checklist is incorrectly reported complete, stopping the loop prematurely. Comment delimiters should only affect parsing outside Markdown code.
Useful? React with 👍 / 👎.
| if (indentation <= 3 && markerSize >= 3) { | ||
| fence = { marker, length: markerSize } | ||
| continue |
There was a problem hiding this comment.
Recognize fenced examples nested under list items
Fence detection only accepts up to three leading spaces, but fenced code nested beneath a list item is commonly indented four or more spaces. In that case the opener is not recorded, and a line such as - [ ] example inside the fence is counted as a pending task; with the default unlimited loop, a completed checklist containing such an example keeps dispatching turns indefinitely. Detect fences relative to their Markdown container rather than only at document-level indentation.
Useful? React with 👍 / 👎.
| ;[found, rest] = takeFlag(rest, "--git-checkpoint"); if (found) job.gitCheckpoint = true | ||
| ;[found, rest] = takeFlag(rest, "--checkpoint-only"); if (found) job.checkpointOnly = true | ||
| ;[found, rest] = takeFlag(rest, "--pause-on-verify-fail"); if (found) job.pauseOnVerifyFail = true | ||
| ;[found, rest] = takeFlag(rest, "--until-checklist-complete"); if (found) job.untilChecklistComplete = true |
There was a problem hiding this comment.
Reject the checklist flag on the fallback V2 runtime
On OpenCode 2 hosts without session.hook, experimental.js selects createOpenCode2PromptRuntime, but the shared parser now accepts this flag while that runtime neither blocks it in unsupportedRuntimeJob nor inspects the checklist in runDueAction. Such a host accepts the command and decorates the prompt as though the host will stop it, yet the default unlimited loop continues after every checkbox is complete. Either implement the check in the fallback runtime or reject the flag there as unsupported.
Useful? React with 👍 / 👎.
Problem
A Reddit user expected
--progress-file TASK.mdto stop idle Loop after all Markdown tasks became checked; existing--progress-fileis context only and a model printing/loop-clearis not a host slash-command invocation.Implementation
--until-checklist-completerequires--progress-file; unbounded/loopbehavior is unchanged.--verifywhen configured; native V2 pauses with persisted reason rather than sending a further prompt when all actionable checkboxes are checked./loop-stopand/loop-clearauthority. Model-emitted slash text is not executed as a privileged command.Validation and release gate
Built native/server/legacy bundles with Bun 1.4.2 on GitHub Actions and removed the temporary build workflow. PR CI, Windows/Linux native canaries and packed consumer tests must all pass before merging/releasing. This is not yet published in npm 0.6.8.
Closes #174 when merged and consumer-tested. Partially addresses stop UX #175 (does not add autonomous agent-issued control authority). Related #176 and #178.