Skip to content

Keep the issue visible and say what to do next after an Interactive Issue run (#406) - #414

Merged
rochecompaan merged 8 commits into
mainfrom
agent/issue-406-keep-the-issue-visible-and-say-what-to-do-next-w
Nov 22, 2026
Merged

rochecompaan merged 8 commits into
mainfrom
agent/issue-406-keep-the-issue-visible-and-say-what-to-do-next-w

Conversation

@rochecompaan

@rochecompaan rochecompaan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #406

Keeps the issue visible in the console status bar for the whole Interactive Issue run and after it, and tells the maintainer what to do next.

Changes

  • Review wait (src/kernel/review-wait.ts): the first message names the PR. It says that the maintainer merges it and then tells the agent to continue, what Patchmill does after the merge, how to ask for changes, and how to stop. A recheck says that the PR is not merged yet.
  • Cleanup result (src/kernel/run-once.ts, run-snapshot.ts): the ended snapshot records cleanup: cleaned | kept | skipped.
  • Run end (new src/console/run-end.ts): maps a settled run to an end label, an end-of-run message (outcome, cleanup, next step) and status().ended.
  • Controller (src/console/controller.ts):
    • The status bar shows preparing at the start and keeps the end label until shutdown or an issue switch.
    • After a stopped run, a failed run, or a kept cleanup, the end message triggers a Console agent turn, so the agent explains the problem.
    • A settle step during shutdown shows and posts nothing. A pending continue always resolves.
  • Web session: keeps its own closing line (announceRunEnd: false).
  • Console agent guidance (src/console/tools.ts): covers who merges, PR changes during the wait (made by the agent, with safety limits), what to do after the run ends, and guarded fixes. patchmill_run_status reports an ended run.
  • README: the tool list and the review-wait behaviour.
  • Spec and plan are in docs/specs and docs/plans. GLOSSARY: the Console agent entry is wider.

Rulings (cost if wrong)

  • Merged origin/main into the branch before implementing. Cost: an extra merge commit.
  • Commands in end messages are literal markdown code spans. Cost: a cosmetic difference in the copy.
  • EndedRun.cleanup is set only for merged runs, and an absent value maps to skipped. Cost: none visible, because the message shows cleanup only for merged runs.
  • When no issue number is known and the run threw, the error is posted with notify (triggerTurn: false). Cost: none in production, because this path occurs only in tests.
  • preparing is shown at the start and again on the first deriving snapshot. Cost: one redundant setStatus.
  • Independent review, Important docs: clarify Patchmill software factory framing #1: accepted. The controller reuses summaryOf from run-end.ts instead of a copy of the summary rule. Cost: none, because the behaviour is unchanged and the suite is green.

Deferred Minor findings

  • run-end.ts derives the merged cleanup status twice (in endCase and in describeRunEnd). The Case type could carry it.
  • No kernel test pins facts.pullRequest.state === "merged" on the ended snapshot, which the console relies on to detect "merged". The current code sets it before ended.

Validation

  • npm test: passed, 1731 tests (the baseline was 1703).
  • npm run lint (Prettier, ESLint, markdownlint): passed.
  • npm run check:types: passed.
  • No npm dependency changes, so no Nix build.

Frontend review

Not applicable. There is no browser-visible change: the changes are the terminal status-bar text and the chat messages. The Web session behaviour is unchanged.

Human Reviewer Callouts (Non-Blocking)

  • New public contract: ConsoleStatus.ended appears in the patchmill_run_status JSON, and there is a new optional announceRunEnd option on createPatchmillExtension and ConsoleController. Both are additive, and the default is unchanged (true).
  • The Console agent gets new powers through prompt guidance. During a review wait it may now edit code, commit and push to the issue branch, and after a run it may act on problems once the maintainer agrees. This is guidance only; no permission enforcement changes.
  • No migrations, no dependency changes, no authentication changes, and no irreversible operations.

Patchmill run cost

Phase Model Prompt tokens Output tokens Estimated cost (USD)
Planning claude-opus-5-5 378,536 953 $0.0000
Implementation claude-opus-5-5 22,183,109 118,829 $0.0000
Implementation Unknown model 9,889,991 123,028 $0.0000
Total 32,451,636 242,810 $0.0000

Includes all retained local runs for this issue, including specification and planning PRs. Prompt tokens include uncached input, cache reads, and cache writes. Estimated cost uses Pi's recorded model pricing and includes parent and subagent sessions.

@rochecompaan
rochecompaan marked this pull request as ready for review November 22, 2026 19:21
@rochecompaan
rochecompaan merged commit 360c592 into main Nov 22, 2026
3 checks passed
@rochecompaan
rochecompaan deleted the agent/issue-406-keep-the-issue-visible-and-say-what-to-do-next-w branch November 22, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep the issue visible and say what to do next while an Interactive Issue run waits for review

1 participant