Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class ClaudeCodeAdapter extends BaseAgentAdapter {
const planLine = approvedPlan ? `\n\nApproved Plan:\n${approvedPlan}` : ''
const outputInstruction =
outputMode === 'commit'
? 'At the end include a single-line commit message in PARALLAX_COMMIT_MESSAGE format.'
? 'At the end include a single-line commit message in PARALLAX_COMMIT_MESSAGE format. Use conventional commits (feat:, fix:, chore:, etc.) and end with [parallax]. Example: PARALLAX_COMMIT_MESSAGE: feat: add user authentication [parallax]'
: [
'At the end include PR title and summary in PARALLAX_PR_TITLE and PARALLAX_PR_SUMMARY format.',
'PARALLAX_PR_SUMMARY must be a concise human summary with maximum 10 lines.',
Expand Down
2 changes: 1 addition & 1 deletion packages/orchestrator/src/ai-adapters/codex-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export class CodexAdapter extends BaseAgentAdapter {
const planLine = approvedPlan ? `\n\nApproved Plan:\n${approvedPlan}` : ''
const outputInstruction =
outputMode === 'commit'
? 'At the end include a single-line commit message in PARALLAX_COMMIT_MESSAGE format.'
? 'At the end include a single-line commit message in PARALLAX_COMMIT_MESSAGE format. Use conventional commits (feat:, fix:, chore:, etc.) and end with [parallax]. Example: PARALLAX_COMMIT_MESSAGE: feat: add user authentication [parallax]'
: [
'At the end include PR title and summary in PARALLAX_PR_TITLE and PARALLAX_PR_SUMMARY format.',
'PARALLAX_PR_SUMMARY must be a concise human summary with maximum 10 lines.',
Expand Down
8 changes: 6 additions & 2 deletions packages/orchestrator/src/ai-adapters/execution-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ export function extractExecutionMetadata(
}

export function sanitizeCommitMessage(commitMessage: string | undefined) {
return sanitizeSingleLine(commitMessage)
const msg = sanitizeSingleLine(commitMessage)
if (!msg) {
return undefined
}
return msg.endsWith('[parallax]') ? msg : `${msg} [parallax]`
}

export function normalizePrSummary(summary: string | undefined) {
return extractPrSummary(`PARALLAX_PR_SUMMARY:\n${summary ?? ''}`)
}

export function buildDefaultCommitMessage(taskExternalId: string, taskTitle: string) {
return sanitizeSingleLine(`Parallax: ${taskExternalId} - ${taskTitle}`)!
return sanitizeSingleLine(`feat: ${taskTitle} [parallax]`)!
}
2 changes: 1 addition & 1 deletion packages/orchestrator/src/ai-adapters/gemini-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class GeminiAdapter extends BaseAgentAdapter {
...(outputMode === 'commit'
? [
'At the end of your response, include:',
'PARALLAX_COMMIT_MESSAGE: <single-line git commit message>',
'PARALLAX_COMMIT_MESSAGE: <conventional commit message ending with [parallax], e.g. feat: add user authentication [parallax]>',
]
: [
'At the end of your response, include:',
Expand Down
14 changes: 10 additions & 4 deletions packages/orchestrator/test/execution-metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ describe('execution metadata', () => {
expect(metadata.commitMessage).toBe('Tighten dashboard loading')
})

it('normalizes commit messages to a single line', () => {
expect(sanitizeCommitMessage(' Fix dashboard \n loading ')).toBe('Fix dashboard loading')
it('normalizes commit messages to a single line and appends [parallax]', () => {
expect(sanitizeCommitMessage(' Fix dashboard \n loading ')).toBe(
'Fix dashboard loading [parallax]'
)
})

it('does not double-append [parallax] if already present', () => {
expect(sanitizeCommitMessage('feat: add thing [parallax]')).toBe('feat: add thing [parallax]')
})

it('builds a stable default commit message when AI output omits one', () => {
it('builds a default conventional commit message when AI output omits one', () => {
expect(buildDefaultCommitMessage('e340140c8be1', 'Improve loading state')).toBe(
'Parallax: e340140c8be1 - Improve loading state'
'feat: Improve loading state [parallax]'
)
})

Expand Down
2 changes: 1 addition & 1 deletion packages/orchestrator/test/git-service-branch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ describe('GitService branch reuse', () => {
{ commitMessage: ' Address review \n comments ' }
)

expect(gitMock.commit).toHaveBeenCalledWith('Address review comments')
expect(gitMock.commit).toHaveBeenCalledWith('Address review comments [parallax]')
})
})
Loading