[Bug]: Follow change request templates ignores GitLab and Azure DevOps templates
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Use a project hosted on GitLab or Azure DevOps.
- Commit a template to the repository’s default branch:
- GitLab: .gitlab/merge_request_templates/Default.md
- Azure DevOps: .azuredevops/pull_request_template.md
- Give the template distinctive headings, such as ## Context and ## Verification.
- Enable Settings → Source Control → Follow change request templates.
- Create a pull request or merge request through T3 Code’s Git actions.
Expected behavior
When enabled, the setting discovers the hosting provider’s repository template and uses it to generate the description.
Actual behavior
Template discovery is explicitly restricted to GitHub. GitLab and Azure DevOps templates are not passed to the description generator, regardless of the setting.
GitManager.ts:2023 checks provider.kind === "github" before calling detectPrTemplate. The detector in PrTemplateDetection.ts only includes GitHub-compatible paths.
Impact
Minor bug or occasional failure
Version or commit
main @ e26af33b22
Environment
No response
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Manually apply the template when editing the generated request description.
Triage
Decision: Accept
Classification: Bug
Severity: Minor (P3)
Confidence: High
Repro: Source-confirmed. Reporter steps are sufficient; no extra environment details are required.
Area: apps/server (Git stacked actions + PR/MR description generation)
Summary
Confirmed. Settings → Source Control → Follow change request templates is on by default and advertised as host-agnostic (“Use the repository's template for change request descriptions when available”), but PR/MR body generation only loads a template when the remote is GitHub. GitLab and Azure DevOps repos skip discovery entirely, so generated descriptions fall back to the generic ## Summary / ## Testing prompt instead of the repo template.
This is not a duplicate of a still-open issue. It is leftover GitHub-only scope from #4204 / #264.
Diagnosis
Two independent gates, both still present on current main:
- Provider gate in
runPrStep. Template detection runs only whensettings.style.followChangeRequestTemplates && provider.kind === "github". Any other host (gitlab,azure-devops, also Forgejo/Gitea/Bitbucket) passeschangeRequestTemplate: undefinedintogeneratePrContent.
const changeRequestTemplate =
settings.style.followChangeRequestTemplates && provider.kind === "github"
? Option.getOrUndefined(yield* detectPrTemplate(cwd, baseRangeRef, gitCore.execute))
: undefined;
-
GitHub-only path list in the detector. Even if the kind check were removed,
detectPrTemplateonly looks at GitHub-compatible files/directories. It does not include the paths the reporter named:- GitLab:
.gitlab/merge_request_templates/Default.md(and the rest of.gitlab/merge_request_templates/*.md) - Azure DevOps:
.azuredevops/pull_request_template.md
- GitLab:
const TEMPLATE_PATHS = [
".github/pull_request_template.md",
".github/PULL_REQUEST_TEMPLATE.md",
"pull_request_template.md",
"PULL_REQUEST_TEMPLATE.md",
"docs/pull_request_template.md",
"docs/PULL_REQUEST_TEMPLATE.md",
] as const;
const TEMPLATE_DIRECTORIES = [
".github/PULL_REQUEST_TEMPLATE",
"PULL_REQUEST_TEMPLATE",
"docs/PULL_REQUEST_TEMPLATE",
] as const;
User-facing copy does not mention a GitHub limit:
description="Use the repository's template for change request descriptions when available."
When no template is passed, generation uses the generic body rules in TextGenerationPrompts.ts. followChangeRequestTemplates defaults to true, so GitLab/Azure users hit this without changing settings.
PR #4204 implemented this as “Detect GitHub pull request templates” and closed #264. The setting and source-control docs later grew to cover GitLab and Azure DevOps, but discovery did not.
Reproduction assessment
Reporter steps match the code path. No log/screenshot is needed.
- Repo on GitLab or Azure DevOps with a distinctive template at the host’s documented path.
- Follow change request templates enabled (default).
- Create a PR/MR from T3 Git actions.
Expected: template headings appear in the generated description.
Actual: detector never runs (non-GitHub), and GitLab/ADO paths are not in TEMPLATE_PATHS / TEMPLATE_DIRECTORIES.
Tests only cover GitHub paths (PrTemplateDetection.test.ts) and a GitHub pr create flow. There is no GitLab/Azure case that asserts a template is passed through.
Related issues
- #264 — original “use a pull request template” request. Closed by #4204. Suggested fix was GitHub’s
.github/pull_request_template.mdonly. - #4204 — shipped the setting + GitHub-only detector. Not a duplicate; this issue is the remaining host gap.
- No open issue about GitLab/Azure DevOps change-request templates.
Same provider gate also blocks Forgejo, Gitea, and Bitbucket. Out of scope for this report, but a fix should not special-case only GitLab + Azure if those hosts already have documented template paths.
Recommended next step
Accept and implement in apps/server:
- Stop gating
detectPrTemplateonprovider.kind === "github". Keep thefollowChangeRequestTemplatessetting as the only user switch. - Extend
TEMPLATE_PATHS/TEMPLATE_DIRECTORIESwith host paths, at least:.gitlab/merge_request_templates(preferDefault.mdwhen several files exist; today’s “ambiguous directory → none” rule would otherwise ignore a valid GitLab default).azuredevops/pull_request_template.md
- Add detector tests for those paths and a GitManager test that a non-GitHub provider still receives
changeRequestTemplate. - Optional docs tweak in
docs/user/source-control.mdunder “Create a pull request” so the supported template locations are explicit.
Workaround
Unchanged from the report: after T3 generates the description, paste or edit in the host template by hand.
I've prepared a fix in #12392 that adds GitLab (.gitlab/merge_request_templates/Default.md) and Azure DevOps (.azuredevops/pull_request_template.md) change request template detection — let me know if you'd like any changes.
Proposal ready in my fork for #12330:
- Fork PR: https://github.com/SachinD6/t3code/pull/1
- Branch: SachinD6/t3code@poteto-12330-pr-templates
Adds .gitlab/merge_request_templates/Default.md (+ directory) and .azuredevops template paths to PrTemplateDetection, and enables followChangeRequestTemplates for gitlab and azure-devops in GitManager. Small fix, 3 files, 12 insertions. Happy to adjust scope.
I'd like to take this. I'll follow the direction in the maintainer triage above and open a focused PR with before/after evidence, noting the model and harness used.
PR is up: https://github.com/pingdotgg/t3code/pull/18209. It adds the GitLab and Azure DevOps template readers following the triage. Forgejo, Gitea, Bitbucket and Azure branch-specific templates are out of scope there.
[!NOTE] 🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. One part of this is fixed on main in #19813. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: Azure DevOps pull request template discovery. If that part still matters to you, please open a new issue for that part only.