Repository navigation
Commit 1d9a64a
feat(commit-message): add prompt template and generator service
Part 2 of 4 for AI commit-message generation. Adds the model-facing half:
a customizable prompt and a service that turns git context into a message.
No command or UI wires it up yet.
- Registers COMMIT_MESSAGE in `support-prompt.ts` alongside ENHANCE. Because
the Prompts settings tab iterates the support-prompt registry, this gives the
template an editor and a reset button without any new UI code. The default
asks for Conventional Commits and tells the model to account for every changed
file; without that instruction models describe the largest file and silently
drop the rest.
- Adds `commitMessageApiConfigId` so a small, fast profile can be used for this
task. Mirrors `enhancementApiConfigId`, including the `listApiConfigMeta`
guard before `getProfile()` so a deleted profile falls back to the active
configuration rather than throwing.
- Adds `generateCommitMessage()`, which resolves the repository from the git
extension API, collects context, and writes the cleaned result into the SCM
input box. Models wrap answers in fences and quotes despite instruction, so
the response is stripped before use.
Progress is reported at `ProgressLocation.Window`; `SourceControl` drops the
title, and no location renders a cancel button that would work, since nearly
every provider ignores `completePrompt`'s abort signal.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 6b955f0 commit 1d9a64a
42 files changed
Lines changed: 467 additions & 0 deletions
File tree
- packages/types/src
- src
- core/webview
- i18n/locales
- ca
- de
- en
- es
- fr
- hi
- id
- it
- ja
- ko
- nl
- pl
- pt-BR
- ru
- tr
- vi
- zh-CN
- zh-TW
- services/commit-message
- __tests__
- webview-ui/src/i18n/locales
- ca
- de
- en
- es
- fr
- hi
- id
- it
- ja
- ko
- nl
- pl
- pt-BR
- ru
- tr
- vi
- zh-CN
- zh-TW
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2461 | 2461 | | |
2462 | 2462 | | |
2463 | 2463 | | |
| 2464 | + | |
2464 | 2465 | | |
2465 | 2466 | | |
2466 | 2467 | | |
| |||
2619 | 2620 | | |
2620 | 2621 | | |
2621 | 2622 | | |
| 2623 | + | |
2622 | 2624 | | |
2623 | 2625 | | |
2624 | 2626 | | |
| |||
2852 | 2854 | | |
2853 | 2855 | | |
2854 | 2856 | | |
| 2857 | + | |
2855 | 2858 | | |
2856 | 2859 | | |
2857 | 2860 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| 165 | + | |
| 166 | + | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments