Skip to content

feat: add agent code review workflow#328

Merged
kamilio merged 5 commits into
mainfrom
feat/agent-code-review
May 26, 2026
Merged

feat: add agent code review workflow#328
kamilio merged 5 commits into
mainfrom
feat/agent-code-review

Conversation

@kamilio
Copy link
Copy Markdown
Collaborator

@kamilio kamilio commented May 23, 2026

Summary

  • add reusable github-review primitives for PR references, diffs, history, and GitHub review mechanics
  • add agent-code-review with profiles/prompts installation, ingest, orchestration, draft storage, commit flow, schemas, and MCP/CLI entry points
  • expose code-review from the root CLI/SDK and register its config scope
  • archive the completed implementation plan in docs/plans/archive/agent-code-review.md

Validation

  • npm run test:unit -- --run packages/agent-code-review/src packages/github-review/src src/cli/program.test.ts src/index.test.ts src/services/services.test.ts — passed (25 files, 287 tests)
  • npm run lint:types — passed after refreshing workspace build outputs
  • npm run lint:eslint — passed
  • npm run screenshot-poe-code -- code-review --help — passed; generated CLI screenshot during validation

Copy link
Copy Markdown
Contributor

@poe-code-agent poe-code-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes: spawned MCP command is not shipped by the published CLI.

Comment thread packages/agent-code-review/src/mcp.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b0bf916f2

ℹ️ 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".

Comment thread packages/agent-code-review/src/bin.ts Outdated
Comment thread packages/agent-code-review/src/mcp.ts Outdated
Comment thread packages/agent-code-review/src/bin.ts Outdated
Comment thread packages/github-review/src/command.ts
Copy link
Copy Markdown
Collaborator Author

kamilio commented May 23, 2026

Addressed review feedback in the latest update:

  • invoke the agent MCP server through the shipped poe-code code-review agent-mcp command
  • use a Node-compatible code-review shebang and preserve ingest --help routing through Toolcraft
  • allow 50 MiB synchronous gh output buffers for large diffs
  • add regression tests for each fix

Validation:

  • npm run test:unit -- --run packages/agent-code-review/src packages/github-review/src src/cli/program.test.ts src/index.test.ts src/services/services.test.ts (27 files, 291 tests passed)
  • npm run lint:types
  • npm run lint:eslint
  • npm run screenshot-poe-code -- code-review ingest --help

The prior PR Checks failures were in unrelated existing test areas (scripts/postinstall-sync-skills.test.ts and packages/toolcraft/src/error-ux.contract.test.ts).

Copy link
Copy Markdown
Contributor

@poe-code-agent poe-code-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes: remove broken package export.

Comment thread packages/github-review/package.json
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ad6bb4a0f

ℹ️ 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".

Comment thread packages/agent-code-review/src/mcp.ts Outdated
Comment thread packages/agent-code-review/src/bin.ts Outdated
Copy link
Copy Markdown
Collaborator Author

kamilio commented May 24, 2026

Follow-up review pass complete in 0de4366:

  • Removed the unused private agent-code-review executable and route all runtime use through the shipped poe-code code-review ... CLI.
  • Removed the declared-but-unimplemented github-review/test-support/harness export.
  • Ensured post-pending subagent setup failures transition to failed, with regression tests.
  • Added the missing root workspace dev dependency required by the workspace dependency contract.

Validation:

  • npm run build — passed.
  • npm run test:unit -- --run packages/agent-code-review/src packages/github-review/src tests/integration/workspace-deps.test.ts scripts/postinstall-sync-skills.test.ts packages/toolcraft/src/error-ux.contract.test.ts src/cli/program.test.ts src/index.test.ts src/services/services.test.ts — passed (30 files, 310 tests).
  • npm run lint:types — passed.
  • npm run lint:eslint — passed.
  • npm run screenshot-poe-code -- code-review --help — passed.
  • npm run screenshot-poe-code -- code-review ingest --help — passed.
  • npm pack --workspace agent-code-review --dry-run --ignore-scripts --json — verified dist/mcp.js is packaged and removed dist/bin.js is not.
  • npm run test:unit -- --run — 590 files / 8,866 tests passed before 6 existing terminal-package suites failed to load because this environment lacks the native node-pty pty.node binary.

Copy link
Copy Markdown
Contributor

@poe-code-agent poe-code-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes: missing required README for new package.

@@ -0,0 +1,22 @@
{
"name": "github-review",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a new workspace package, but packages/github-review/README.md is missing. Repo package rules require each package to own a README; please add one covering the SDK purpose, gh CLI authentication, exported surface, and env/config expectations (none if none are read).

Comment thread packages/agent-code-review/README.md Outdated

## CLI Surface

`codeReviewGroup` exposes `code-review agent-mcp`, a stdio MCP entry point intended for spawned review agents. Review commands and MCP tools are added to this package as the review orchestration workflow is implemented.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is stale for the package being added: the CLI now exposes install, profiles, ingest, run, drafts, commit, and agent-mcp, plus repo-local profiles/prompts/reviews/ingest paths. Please update the package README so it matches the implemented command surface and documents the config/env expectations before landing.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0de4366858

ℹ️ 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".

Comment on lines +164 to +165
if (options.profilePath) {
return loadCodeReviewProfile(options.profilePath);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve review asset paths against the configured cwd

When runCodeReview is invoked with cwd pointing to a repo but profilePath (or promptPath in resolvePrompt) is relative, the code reads files relative to process.cwd() instead of the configured repo root. This makes --cwd + relative path combinations fail with ENOENT or load the wrong file when the command is launched from another directory, even though all other review inputs are scoped to cwd.

Useful? React with 👍 / 👎.

Comment on lines +155 to +159
...existing,
selectedAgent: freshState.selectedAgent,
selectedProfiles: freshState.selectedProfiles,
state: "in_progress" as const,
mergedReview: undefined,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clear stale raw reviews when starting a new run

startRun resumes any existing non-published draft by spreading existing and only clearing mergedReview, which preserves prior rawReviews. On a rerun after new commits are pushed to the same PR URL, code_review_agent_spawn short-circuits on those preserved raw reviews and marks profiles as reused instead of rerunning analysis, so the final merged review can be based on stale findings for an outdated diff.

Useful? React with 👍 / 👎.

@kamilio kamilio force-pushed the feat/agent-code-review branch from 0de4366 to c99f373 Compare May 26, 2026 18:08
Copy link
Copy Markdown
Contributor

@poe-code-agent poe-code-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested changes: orchestrator MCP omits documented draft-management tools.

Comment thread packages/agent-code-review/src/mcp.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c99f3739bf

ℹ️ 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".

Comment thread packages/agent-code-review/src/review-store.ts
Comment thread packages/agent-code-review/src/review-store.ts
Copy link
Copy Markdown
Contributor

@poe-code-agent poe-code-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kamilio kamilio merged commit 095cb34 into main May 26, 2026
5 checks passed
@kamilio kamilio deleted the feat/agent-code-review branch May 26, 2026 19:19
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.

1 participant