Skip to content

feat(server): infer commit and PR title style from repo history#1112

Open
binbandit wants to merge 2 commits intopingdotgg:mainfrom
binbandit:t3code/add-commit-pr-style-guidance
Open

feat(server): infer commit and PR title style from repo history#1112
binbandit wants to merge 2 commits intopingdotgg:mainfrom
binbandit:t3code/add-commit-pr-style-guidance

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 15, 2026

Summary

  • infer commit message style from recent repository commit subjects instead of hard-coding conventions
  • infer pull request title style from recent repository pull request titles when available, with recent commits as fallback context
  • default generated commit and pull request titles to Conventional Commits when the repository has no usable history

Testing

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run --cwd apps/server test src/git/Layers/CodexTextGeneration.test.ts src/git/Layers/GitCore.test.ts src/git/Layers/GitHubCli.test.ts src/git/Layers/GitManager.test.ts

Note

Infer commit and PR title style from repo history in text generation prompts

  • Adds readRecentCommitSubjects to GitCoreShape and listRecentPullRequestTitles to GitHubCliShape, backed by git log and gh pr list respectively.
  • generateCommitMessage and generatePrContent in CodexTextGenerationLive now fetch recent commit subjects and PR titles concurrently and inject style guidance into Codex prompts.
  • When no repo examples exist, prompts default to Conventional Commits guidance; when examples are found, they are deduped, trimmed, and limited before inclusion.
  • Errors during example retrieval are swallowed and return empty lists, so generation continues without style guidance rather than failing.
  • Behavioral Change: generated commit subjects and PR titles may change in format now that repo-specific style examples influence prompts.

Macroscope summarized cfd99f8.

- add recent commit subject and PR title discovery for repo style guidance
- default generated commit and PR titles to conventional commits when history is unavailable
- cover the new prompt guidance and git/github lookups with tests
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f62fd185-e30c-460e-ad98-897c4e904a95

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 15, 2026
Copy link
Contributor

@UtkarshUsername UtkarshUsername left a comment

Choose a reason for hiding this comment

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

I think it should be fork-aware, and check the titles of PRs made to the original repo

),
Effect.map((pullRequests) => pullRequests.map(normalizePullRequestSummary)),
),
listRecentPullRequestTitles: (input) =>
Copy link
Contributor

@UtkarshUsername UtkarshUsername Mar 15, 2026

Choose a reason for hiding this comment

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

listRecentPullRequestTitles() uses gh pr list against the current checkout repo, right? So in a fork clone it gets PR titles from the fork, not the upstream repo

@binbandit
Copy link
Contributor Author

I think it should be fork-aware, and check the titles of PRs made to the original repo

I agree, but there is a different PR for that. Ill do it as part of that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants