Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/server/src/textGeneration/TextGenerationPrompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export function buildCommitMessagePrompt(input: CommitMessagePromptInput) {
? "Return a JSON object with keys: subject, body, branch."
: "Return a JSON object with keys: subject, body.",
"Rules:",
"- subject must be imperative, <= 72 chars, and no trailing period",
"- subject must follow Conventional Commits format: type(scope): description",
"- type must be one of: feat, fix, docs, style, refactor, test, chore",
"- scope is optional; description is imperative, no trailing period",

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.

Ambiguous optional scope format

Low Severity

The subject rule presents type(scope): description as the required shape while also saying scope is optional, without stating the no-scope form type: description. That can push models toward always inventing a scope or emitting empty parentheses, which is invalid Conventional Commits and weakens the consistency this change aims for.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b8faa63. Configure here.

"- full subject line must be <= 72 chars",

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.

Sanitizer breaks new commit format

Low Severity

The prompt now requires Conventional Commits subjects, but sanitizeCommitSubject and sanitizeCommitMessage can still rewrite the model output into a non-conforming subject via hard slice(0, 72) truncation or the Update project files fallback, so the AI commit path does not actually guarantee the new format.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b8faa63. Configure here.

"- body can be empty string or short bullet points",
...(wantsBranch
? ["- branch must be a short semantic git branch fragment for this change"]
Expand Down
Loading