fix(engine): give merge commits a real subject in fallback paths

Three merger fallback commit paths (auto-resolve-all-conflicts,
-X theirs/ours side strategy, AI-agent-didn't-commit) hard-coded
`feat(FN-XXXX): merge fusion/fn-xxxx` as the subject and never used
the AI subject summarizer. Route them through buildDeterministicMergeMessage
so they pick up aiSubject when available.

When the AI subject summarizer returns null, derive the subject from
the branch's first step commit (with conventional-commit prefix
stripped, plus `(+N more)` for multi-commit branches) instead of the
bare `merge <branch>` template.

Bump DEFAULT_COMMIT_SUBJECT_TIMEOUT_MS 15s → 30s so slow-first-token
providers complete instead of silently falling back.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-02 13:32:47 -07:00
parent 174453465f
commit df04acd4e2
4 changed files with 92 additions and 18 deletions

View File

@@ -648,11 +648,13 @@ Your ONLY job is to summarize what landed — using the branch's step commit sub
export const MAX_COMMIT_SUBJECT_LENGTH = 60;
/**
* Default timeout for commit subject summarization, in milliseconds. Tighter
* than the body timeout because the subject is short and we don't want it
* meaningfully slowing down merges.
* Default timeout for commit subject summarization, in milliseconds. Generous
* enough that slow first-token providers still produce a real subject — the
* deterministic fallback (`merge <branch>`) is the user-visible regression we
* are trying to avoid, so favoring AI completion over latency is the right
* trade here.
*/
export const DEFAULT_COMMIT_SUBJECT_TIMEOUT_MS = 15_000;
export const DEFAULT_COMMIT_SUBJECT_TIMEOUT_MS = 30_000;
/**
* Summarize a `git diff --stat` (and optional commit log) into a short commit