Repository navigation
feature request: control into the message formatting of the 1-click commit tool #989
Description
Activity
like isn't sending the same prompt following the agents.md in t3code @SeanCassiere ?
like isn't sending the same prompt following the agents.md in t3code @SeanCassiere ?
@shivamhwp that would be the idea, but the there's two problems right now.
- Right now, it does not follow what's in the
AGENTS.mdfile. Rather, its got its own isolated prompt for generating the commit message. - I'm not sure if injecting the entire
AGENTS.mdis a good idea here where it'll inject a whole set of other instructions into context window which isn't needed, since the output is just meant to be a commit message. Whilst, its good practice to have shortAGENTS.mdfiles, you can guarantee that existing projects have HUGE ones and would just muddy things up.
Also, not to mention, having in an AGENTS.md is just one way of doing it. Other projects, might have committing be a Skill instead or outright have them instead live in their
CONTRIBUTING.mdpolicy.Edit: Right now, this is the prompt explicitly controlling the commit messages.
t3code/apps/server/src/git/Prompts.ts
Lines 25 to 48 in 8888f6a
export function buildCommitMessagePrompt(input: CommitMessagePromptInput) { const wantsBranch = input.includeBranch; const prompt = [ "You write concise git commit messages.", wantsBranch ? "Return a JSON object with keys: subject, body, branch." : "Return a JSON object with keys: subject, body.", "Rules:", "- subject must be imperative, <= 72 chars, and no trailing period", "- body can be empty string or short bullet points", ...(wantsBranch ? ["- branch must be a short semantic git branch fragment for this change"] : []), "- capture the primary user-visible or developer-visible change", "", `Branch: ${input.branch ?? "(detached)"}`, "", "Staged files:", limitSection(input.stagedSummary, 6_000), "", "Staged patch:", limitSection(input.stagedPatch, 40_000), ].join("\n");
Thinking on this further, now with a few weeks of usage, I'm wondering does it make more sense to have the commit button be hidden on a per-project level 🤔.
In its current form, this 1-click commit tool, really has no use for me, while the tooling to Push the branch and View the PR certainly have good value to them.
We'll see what happens 👀
Reacted by shivam- Right now, it does not follow what's in the
no not injecting, i think it should automatically respect agents.md. i'll look into it.
The 1-click to commit is nice, but limited.
It generates simple commit messages, but this becomes a bit of a blocker when you are committing into a codebase that has rules as to how your commit messages should be structured.
Currently, I've got the commit messages rules described in my
AGENTS.md, and this is the workflow I use directly in the chat interface of the other tools (Codex, OpenCode, etc.). Pretty much typing in a message like "OK, commit these changes" and it picks up the rules.Of course, this approach of loading up the entire
AGENTS.mdwouldn't work for T3Code, but perhaps we could have a global (or project) level setting, where commit formatting rules can be described, and in-turn this'd be sent over (in-addition to whatever T3Code instructions are there) to the model doing the actual commit message generation.