0
Fork 0
mirror of https://github.com/obra/superpowers.git synced 2026-09-28 09:42:11 +00:00

executing-plans: task-done aborts silently after a passing test command that prints nothing (grep exit 1 under pipefail) #2385

Closed
opened 2026-09-25 20:45:02 +00:00 by KenM-BT · 0 comments
KenM-BT commented 2026-09-25 20:45:02 +00:00 (Migrated from github.com)
  • I searched existing issues and this is not a duplicate

Searched open and closed issues for task-done, pipefail, and "task-done no output". The closest is #2342, which concerns what task-done records in the tests: … → <result> field. This report is about the same line aborting the script entirely when the test output is empty. The two are related but distinct: fixing one does not fix the other.

Environment (required)

Field Value
Superpowers version 6.4.1 (line unchanged on main and dev as of 2026-09-25)
Harness (Claude Code, Cursor, etc.) Claude Code
Harness version 2.1.282
Your model + version Claude Opus 5.5 (claude-opus-5-5)
All plugins installed A private fork of the superpowers skills (upstream superpowers disabled)
OS + shell Windows 11, Git Bash (GNU bash 5.2.37). The bug is shell-agnostic: it follows from set -euo pipefail + grep exit status.

This issue was written and filed by the agent above at its human partner's request. It was found while smoke-testing the vendored v6.4.1 executing-plans scripts in a throwaway repo.

Is this a Superpowers issue or a platform issue?

  • I confirmed this issue does not occur without Superpowers installed

The behavior is in skills/executing-plans/scripts/task-done, which Superpowers ships.

What happened?

task-done runs under set -euo pipefail. After the test command succeeds, it extracts the result line with:

last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1)

When the test command passes but prints nothing (or only blank lines), grep -v selects no lines and exits 1. With pipefail the pipeline's status is 1, and with set -e the assignment aborts the script. This happens after the tests passed and before the ledger line is written.

So a passing task is silently not recorded: exit status 1, no stderr, no ledger line. The task-done contract says a failing run records nothing, so a controller reading the ledger (or the exit code) concludes the task did not complete.

Steps to reproduce

  1. In a git repo with a plan file containing ### Task 1: …, run bash skills/executing-plans/scripts/task-start docs/plan.md 1 and note the printed base.
  2. Run bash skills/executing-plans/scripts/task-done docs/plan.md 1 <base> -- true
  3. Observe: exit status 1, no output, and no Task 1: complete … line in .superpowers/sdd/plan/progress.md.

For comparison, … -- echo "1 passed" records the task normally, and … -- false correctly reports test command exited 1; Task 1 NOT recorded.

Expected behavior

A passing test command records the completion line regardless of how much it printed, e.g. tests: true → (no output).

Actual behavior

The script exits 1 with no message after the tests pass, and records nothing.

Suggested fix

Make the no-match case non-fatal:

last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1) || last="(no output)"

Verified in a throwaway repo: -- true then records Task 1: complete (…, tests: true → (no output)) and exits 0. -- echo "1 passed" and -- false behave as before.

Debug log or conversation transcript

Minimal reproduction output (throwaway repo, no private data):

$ bash task-done docs/plan.md 2 <base> -- true ; echo "rc=$?"
rc=1
$ tail -n 1 .superpowers/sdd/plan/progress.md
Task 1: complete (commits 68ad130..68ad130, tests: echo '3 passed' → 3 passed)

(Task 2's passing run left no ledger line.)

- [x] I searched existing issues and this is not a duplicate Searched open and closed issues for `task-done`, `pipefail`, and "task-done no output". The closest is #2342, which concerns *what* `task-done` records in the `tests: … → <result>` field. This report is about the same line aborting the script entirely when the test output is empty. The two are related but distinct: fixing one does not fix the other. ## Environment (required) | Field | Value | |-------|-------| | Superpowers version | 6.4.1 (line unchanged on `main` and `dev` as of 2026-09-25) | | Harness (Claude Code, Cursor, etc.) | Claude Code | | Harness version | 2.1.282 | | Your model + version | Claude Opus 5.5 (`claude-opus-5-5`) | | All plugins installed | A private fork of the superpowers skills (upstream superpowers disabled) | | OS + shell | Windows 11, Git Bash (GNU bash 5.2.37). The bug is shell-agnostic: it follows from `set -euo pipefail` + `grep` exit status. | This issue was written and filed by the agent above at its human partner's request. It was found while smoke-testing the vendored v6.4.1 `executing-plans` scripts in a throwaway repo. ## Is this a Superpowers issue or a platform issue? - [x] I confirmed this issue does not occur without Superpowers installed The behavior is in `skills/executing-plans/scripts/task-done`, which Superpowers ships. ## What happened? `task-done` runs under `set -euo pipefail`. After the test command succeeds, it extracts the result line with: ```bash last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1) ``` When the test command passes but prints nothing (or only blank lines), `grep -v` selects no lines and exits 1. With `pipefail` the pipeline's status is 1, and with `set -e` the assignment aborts the script. This happens *after* the tests passed and *before* the ledger line is written. So a passing task is silently not recorded: exit status 1, no stderr, no ledger line. The task-done contract says a failing run records nothing, so a controller reading the ledger (or the exit code) concludes the task did not complete. ## Steps to reproduce 1. In a git repo with a plan file containing `### Task 1: …`, run `bash skills/executing-plans/scripts/task-start docs/plan.md 1` and note the printed `base`. 2. Run `bash skills/executing-plans/scripts/task-done docs/plan.md 1 <base> -- true` 3. Observe: exit status 1, no output, and no `Task 1: complete …` line in `.superpowers/sdd/plan/progress.md`. For comparison, `… -- echo "1 passed"` records the task normally, and `… -- false` correctly reports `test command exited 1; Task 1 NOT recorded`. ## Expected behavior A passing test command records the completion line regardless of how much it printed, e.g. `tests: true → (no output)`. ## Actual behavior The script exits 1 with no message after the tests pass, and records nothing. ## Suggested fix Make the no-match case non-fatal: ```bash last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1) || last="(no output)" ``` Verified in a throwaway repo: `-- true` then records `Task 1: complete (…, tests: true → (no output))` and exits 0. `-- echo "1 passed"` and `-- false` behave as before. ## Debug log or conversation transcript Minimal reproduction output (throwaway repo, no private data): ``` $ bash task-done docs/plan.md 2 <base> -- true ; echo "rc=$?" rc=1 $ tail -n 1 .superpowers/sdd/plan/progress.md Task 1: complete (commits 68ad130..68ad130, tests: echo '3 passed' → 3 passed) ``` (Task 2's passing run left no ledger line.)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
skills/obra-superpowers#2385
No description provided.