Skip to content

feat(review): let nanocoder review run in CI and pipes without a terminal - #2300

Merged
akramcodez merged 16 commits into
Nano-Collective:feat/1287-grounded-reviewfrom
puri-adityakumar:review-1287/4-headless
Nov 25, 2026
Merged

akramcodez merged 16 commits into
Nano-Collective:feat/1287-grounded-reviewfrom
puri-adityakumar:review-1287/4-headless

Conversation

@puri-adityakumar

Copy link
Copy Markdown
Contributor

Description

Part 4 of 4 for #1287. Targets feat/1287-grounded-review and builds on part 3 (#2299), so please merge that first. Until #2297, #2298 and #2299 are merged, this diff also shows their 5 commits; the new work here is the last commit.

Problem. nanocoder review needs a terminal. In CI, a pipe or a redirect it cannot run, so there is no way to use the grounded review from a script.

What this PR does. nanocoder review now runs without a terminal when stdout is piped or redirected, or when it runs in CI:

  • The report goes to stdout as markdown, and progress goes to stderr.
  • --output-format json (or --json) prints the result as JSON instead.
  • It accepts every scope /review accepts (branch feature/users, last 2 commits, PR numbers) and the quick and deep tiers.
  • Exit codes: 0 for a completed review (or one with nothing to review), 2 for an incomplete one so CI cannot read it as a clean pass, 1 when no review was produced. Ctrl+C cancels and still prints what was covered.
  • Like nanocoder run, it refuses a directory you have not trusted unless you pass --trust-directory or set NANOCODER_TRUST_DIRECTORY=1. The message is the same as run's.
  • --help and shell completions list review for --json and --trust-directory.
  • The integration test that expected nanocoder review 42 without a terminal to be refused now expects the trust check instead.
  • Docs: docs/features/review.md, docs/configuration/index.md, docs/getting-started/index.md. Changeset: .changeset/headless-review.md.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changeset

  • Added a changeset (pnpm changeset) describing this change for the changelog

Testing

Automated Tests

  • New features include passing tests in .spec.ts/tsx files
  • All existing tests pass (pnpm test:all completes successfully)
  • Tests cover both success and error scenarios

Run on macOS, Node 22, with all four parts applied:

  • test:format, test:lint, test:types, test:knip, build: pass.
  • test:ava: 11,444 pass, 38 fail. The same 38 fail on plain feat/1287-grounded-review in the same setup, so none come from this PR (34 in cli-value-flags.cli-integration with a React duplicate-key error, 2 --acp trust checks that need a trusted checkout, 2 auto-commit tests).
  • pnpm audit and semgrep scan --config auto --error: pass.

Manual Testing

  • Tested with Ollama
  • Tested with OpenRouter
  • Tested with OpenAI-compatible API
  • Tested MCP integration (if applicable)

GMI Cloud (zai-org/GLM-5.3-Flash) on the fixture repo, piping into cat and jq so there is no terminal.

An untrusted directory is refused with exit code 1:

Untrusted directory refused

nanocoder review branch feature/users: progress on stderr, report on stdout, 3 verified issues, exit code 0:

Headless grounded review

nanocoder review --json piped into jq, exit code 0:

Headless JSON review

Checklist

  • If this was for an open issue, I was assigned to it
  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)
  • Appropriate logging added using structured logging (see CONTRIBUTING.md)

Logging: progress lines go to stderr, so stdout stays clean for the report or JSON.

Part of #1287. With all four parts in, this covers everything the issue asks for.

@akramcodez
akramcodez merged commit 948283f into Nano-Collective:feat/1287-grounded-review Nov 25, 2026
akramcodez added a commit that referenced this pull request Nov 26, 2026
…CLI (#2417)

* feat(review): restore the review foundation that grounded /review builds on (#2297)

* feat(review): restore the review foundation

* fix(review): catch same-second worktree edits in review snapshots

* feat(review): ground /review findings in the code and verify each one (#2298)

* feat(review): restore the review foundation

* fix(review): catch same-second worktree edits in review snapshots

* feat(review): make grounded review the default /review

* fix(review): show incomplete reviews as incomplete in the activity line

* refactor(review): run review agents on the shared turn engine

* fix(review): keep offered text tool calls beside quoted markup and bound unknown context sizes

---------

Co-authored-by: akramcodez <[email protected]>

* feat(review): add /review deep so one finder's blind spots don't go unreviewed (#2299)

* feat(review): restore the review foundation

* fix(review): catch same-second worktree edits in review snapshots

* feat(review): make grounded review the default /review

* fix(review): show incomplete reviews as incomplete in the activity line

* feat(review): add /review deep with specialist finders

* refactor(review): run review agents on the shared turn engine

* fix(review): keep offered text tool calls beside quoted markup and bound unknown context sizes

* fix(review): share the diff size limit so deep review and the verifier bound unknown context sizes

---------

Co-authored-by: akramcodez <[email protected]>

* feat(review): let nanocoder review run in CI and pipes without a terminal (#2300)

* feat(review): restore the review foundation

* fix(review): catch same-second worktree edits in review snapshots

* feat(review): make grounded review the default /review

* fix(review): show incomplete reviews as incomplete in the activity line

* feat(review): add /review deep with specialist finders

* feat(review): run nanocoder review without a terminal

* refactor(review): run review agents on the shared turn engine

* fix(review): keep offered text tool calls beside quoted markup and bound unknown context sizes

* fix(review): share the diff size limit so deep review and the verifier bound unknown context sizes

* fix(review): keep the cancelled report and exit code when a headless review is interrupted

---------

Co-authored-by: akramcodez <[email protected]>

* fix(review): align review specs and docs with main after merge

* fix(review): strip ANSI in review specs so they pass with color forced on

* fix(review): stop headless quick review passing on empty or partial output

---------

Co-authored-by: Aditya Kumar Puri <[email protected]>
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.

2 participants