File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ export function buildSystemPrompt(slack?: SlackContext): string {
2222 "- If GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL are set, use them explicitly in commit commands." ,
2323 "- Prefer: git commit --author=\"$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>\" -m \"...\"" ,
2424 "- Use GH_TOKEN for gh commands when available; fall back to git commands when GH_TOKEN is not set." ,
25+ "- Before creating any pull request, make sure the current branch name is meaningful." ,
26+ "- If the branch looks like a thread/worktree ID (for example `ode_<threadId>`), rename it first." ,
27+ "- Preferred branch format before PR: `feat/<short-slug>-<threadShortId>` (slug from the PR topic, short thread suffix for uniqueness)." ,
2528 "" ,
2629 ] ;
2730
Original file line number Diff line number Diff line change @@ -47,6 +47,17 @@ describe("agent cli command formatting", () => {
4747 expect ( systemPrompt ) . not . toContain ( "CHANNEL SYSTEM MESSAGE:" ) ;
4848 } ) ;
4949
50+ it ( "includes branch rename guidance before creating pull requests" , ( ) => {
51+ const systemPrompt = buildSystemPrompt ( {
52+ channelId : "C123" ,
53+ threadId : "1770543888.045599" ,
54+ userId : "U789" ,
55+ } ) ;
56+
57+ expect ( systemPrompt ) . toContain ( "Before creating any pull request, make sure the current branch name is meaningful." ) ;
58+ expect ( systemPrompt ) . toContain ( "Preferred branch format before PR: `feat/<short-slug>-<threadShortId>`" ) ;
59+ } ) ;
60+
5061 it ( "builds the OpenCode curl command" , ( ) => {
5162 const command = buildOpenCodeCommand ( "http://127.0.0.1:8080" , "session-2" , {
5263 directory : "/tmp/project" ,
You can’t perform that action at this time.
0 commit comments