[Bug]: inferRepositoryConventions doesn't do anything#11917

openedSep 15, 2026byNniklasravnsborg

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Go to Settings / Source Control
  2. Set "Source control writing style" to repository conventions

Expected behavior

I would expect my custom commit message conventions to be respected, when T3 Code generates new messages.

Actual behavior

In my test it didn't follow my commit conventions even though they are available in my AGENTS.md and README.md.

Impact

Major degradation or frequent failure

Version or commit

Desktop App 0.0.40 (09e8de9c655a)

Environment

macOS 15.7

Workaround

To not use the commit feature and let the coding agent commit.

Thanks for the report — triage agrees this is a real quality bug in the dedicated commit-message path, not a settings-UI no-op.

What the setting actually does

Repository conventions is the default (repo_conventions). The named flag inferRepositoryConventions is set on that policy and never read by the prompt builders, so the title is accurate for the flag. The mode itself is not empty: resolveStylePolicy in apps/server/src/git/GitManager.ts still:

  • samples up to 20 recent non-merge commit subjects
  • reads root AGENTS.md (already shipped in #8804; present on Desktop 0.0.40)
  • reads root CLAUDE.md only when the writer is Claude
  • appends that blob as “Additional instructions”

It does not read README.md, nested AGENTS.md, or CONTRIBUTING.md. A root AGENTS.md over 20KB is dropped with no warning.

Why documented conventions can still lose

The commit prompt in TextGenerationPrompts.ts always requires an imperative, ≤72-character, no-trailing-period subject and an empty-or-bullet body. sanitizeCommitMessage then truncates the subject to 72 characters. Recent subjects are listed before AGENTS.md, so history can override the docs. That matches the workaround (agent commit works, because the agent gets AGENTS.md as first-class instructions).

Settings copy still says the mode “matches recent change descriptions and change request titles.” Docs say it uses “the project's instructions and recent commit subjects.” Both undersell / misstate the current behavior.

Not a duplicate / not closed by #7650

  • #7650 only enriches git-history examples (subjects + bodies). It does not make AGENTS.md/README.md win and should not Closes this issue.
  • #1181 / #656 are older Conventional Commits feature asks, not this bug.

Suggested fix

In GitManager + TextGenerationPrompts: use or drop the dead flag; when repo conventions are on, don’t let the hard 72-char/bullet rules override repo style; prefer commit-convention text from AGENTS.md over raw history; and decide explicitly whether README.md should be sampled (if not, say so in the UI).

Workaround: set the style to Custom instructions, or let the coding agent create the commit.

A single expected-vs-actual commit message (and whether the conventions live in root AGENTS.md vs README.md) would help, but is not required to start the fix.

Synced from GitHub

Moving the conventions into the AGENTS.md now allows me to use the commit feature. An instruction like the following is not enough:

1- Follow the [commit conventions](README.md#commit-conventions) in the repository README.

The code is still unclear because of the unused variable.

Existing work: #21561 explicitly addresses this report and replaces the earlier contribution. It includes regression tests and a server runtime transcript. Its stated remaining gate is maintainer approval for changing the default Repository conventions formatting. Leaving this issue open; no duplicate implementation or PR started.

Rechecked the existing fix #21561: it remains open at 1afd963, with 32 successful checks and no failing or pending checks reported by GitCafe. Added the required bugfix label. Macroscope still records a human-approval requirement for the default formatting change. No duplicate issue found across 18 pages of open issues. No new implementation or app reproduction was run; the existing PR contains regression tests and a server runtime transcript. Leaving this issue open for that fix.