Skip to content

feat(pr-review): add summary-prompt input for context-aware review summaries#119

Open
daniel-richter wants to merge 4 commits into
mainfrom
feature/add-summary-field
Open

feat(pr-review): add summary-prompt input for context-aware review summaries#119
daniel-richter wants to merge 4 commits into
mainfrom
feature/add-summary-field

Conversation

@daniel-richter

@daniel-richter daniel-richter commented May 25, 2026

Copy link
Copy Markdown
Contributor

Context: The action previously generated the review body text using disclaimer-prompt in isolation, with no access to the actual review findings. This meant the summary could not include context-aware content such as finding counts or severity breakdowns, since the findings only existed after the review was generated.

Changes:

  • Added a new summary-prompt input parameter (default: "Append a brief summary of the key review findings. No lists, no headings.") to allow customizing the summary text
  • Replaced the standalone disclaimer-prompt AI call with a combined system prompt that merges disclaimer-prompt and summary-prompt, passing the actual review findings as user content so the model can produce a context-aware summary
  • Added missing comments, review, and summary output parameters to action.yml and updated their descriptions
  • Updated README documentation to document the new summary-prompt parameter, the new outputs, and added the new "Customize the review summary" section

@github-actions

Copy link
Copy Markdown

This update adds a new summary-prompt input to generate and include a concise AI-driven summary in the PR review body, replacing the previous disclaimer-only step. It updates the action’s outputs (adding summary), refactors the workflow to compose reviews with this summary, and enhances the documentation and examples to reflect these changes.

Walkthrough

  • New Feature: Introduce summary-prompt to configure and generate a brief AI summary in PR reviews
  • Chore: Add summary to action outputs and parse it in configuration
  • Documentation: Update README with new table entries, output descriptions, and a usage example
  • Refactor: Replace standalone disclaimer call with combined summary generation and adjust review assembly
  • Style: Clarify output descriptions for comments, review, and reviewId

Model: o4-mini-2025-04-16 | Prompt Tokens: 1707 | Completion Tokens: 829

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for sharing your code. I’ve offered ideas supported by AI to improve readability, control flow and maintainability while respecting your judgment. Feel free to apply what fits your style as you guide the decisions. The feedback covers extracting summary generation into its own helper, adding a guard to skip unnecessary API calls, improving display text assembly through a utility function, updating action.yml inputs with consistent structure and examples, and clarifying summary-prompt defaults and formatting in the README.

Model: o4-mini-2025-04-16 | Prompt Tokens: 3468 | Completion Tokens: 4933

Comment thread pr-review/src/main.ts
Comment thread pr-review/src/main.ts
Comment thread pr-review/src/main.ts
Comment thread pr-review/action.yml
Comment thread pr-review/README.md
@github-actions

Copy link
Copy Markdown

This update aligns CI workflows with the latest Node setup action, brings core libraries and tooling dependencies up to date in both the PR review and summary packages, and streamlines configuration parsing by removing unnecessary type assertions.

Walkthrough

  • Chore: Upgraded actions/setup-node in GitHub Actions workflows from v6.3.0 to v6.4.0 for faster, more secure builds
  • Chore: Bumped key dependencies (@actions/core, axios, zod, tsx, @types/node, typescript-eslint, yaml) to their latest versions
  • Refactor: Simplified config.ts parsing logic by dropping redundant as z.infer<T> casts

Model: o4-mini-2025-04-16 | Prompt Tokens: 1893 | Completion Tokens: 487 | Diff Range: 699875e...68c8f91

@github-actions

Copy link
Copy Markdown

Summary prompt is now optional: if left unset, only the disclaimer is sent and review findings are excluded. Documentation has been updated to clarify this behavior. The system’s chat payload now uses additional spacing for readability, and the review comments step is conditionally omitted based on the summary prompt. These adjustments empower users to control whether detailed review insights are shared with the LLM.

Walkthrough

  • Documentation: clarified that leaving summary-prompt empty results in only a disclaimer.
  • Refactor: improved system message formatting with extra spacing.
  • New Feature: review comments are now sent to the LLM only when a summary prompt is provided.

Model: o4-mini-2025-04-16 | Prompt Tokens: 697 | Completion Tokens: 1364 | Diff Range: 68c8f91...9fe97d3

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This collaborative code review is powered by AI. These ideas come from predictive analysis and may not always hit the mark. Use what aligns with your workflow and expertise. You remain in control of every choice—AI is here solely to support your decisions.

Model: o4-mini-2025-04-16 | Prompt Tokens: 1289 | Completion Tokens: 2451 | Diff Range: 699875e...9fe97d3

Comment thread pr-review/action.yml
Comment thread pr-review/src/config.ts
Comment thread pr-review/src/main.ts
Comment thread pr-review/src/main.ts
@github-actions

Copy link
Copy Markdown

This change simplifies the code formatting by collapsing a multi-line conditional spread into a single-line expression without altering any logic or user-facing behavior.

Walkthrough

  • Style: Condensed the conditional inclusion of the review findings prompt into one line for improved readability and consistency.

Model: o4-mini-2025-04-16 | Prompt Tokens: 356 | Completion Tokens: 457 | Diff Range: 9fe97d3...e854784

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I’m pleased to provide a supportive code review enhanced by AI insights. While some suggestions are informed predictions, trust your judgment to decide what fits best. You guide the process and AI is here to support you.

Model: o4-mini-2025-04-16 | Prompt Tokens: 916 | Completion Tokens: 1881 | Diff Range: 9fe97d3...e854784

Comment thread pr-review/src/main.ts
Comment thread pr-review/src/main.ts
Comment thread pr-review/src/main.ts
Comment thread pr-review/src/main.ts
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