@@ -41,8 +41,8 @@ func (b *Bot) handleCommand(msg *tgbotapi.Message) {
4141 b .cmdRetry ()
4242 case "project" :
4343 b .cmdProject (msg .CommandArguments ())
44- case "bg " :
45- b .cmdBg (msg )
44+ case "research " :
45+ b .cmdResearch (msg )
4646 case "ralph" :
4747 b .cmdRalph (msg )
4848 case "plan" :
@@ -68,12 +68,12 @@ func (b *Bot) cmdHelp() {
6868 "/project search `<keyword>` — Find git repos to add\n " +
6969 "/project rename `<old>` `<new>` — Rename project\n " +
7070 "/project remove `<name>` — Remove project\n \n " +
71- "*Background :*\n " +
72- "/bg `<message>` — Run task in background \n " +
73- "/bg inject `<id>` — Inject result into session\n " +
74- "/bg status / cancel `<id>`\n \n " +
75- "*Ralph (Iterative Loop ):*\n " +
76- "/ralph `<message>` — Auto-loop until done \n " +
71+ "*Research (read-only) :*\n " +
72+ "/research `<message>` — Background analysis \n " +
73+ "/research inject `<id>` — Inject result into session\n " +
74+ "/research status / cancel `<id>`\n \n " +
75+ "*Ralph (iterative loop + worktree ):*\n " +
76+ "/ralph `<message>` — Auto-loop in isolated branch \n " +
7777 "/ralph `<msg>` --max `<N>` — Set max iterations\n " +
7878 "/ralph status / cancel `<id>`\n \n " +
7979 "*Plan Mode:*\n " +
@@ -506,7 +506,7 @@ func (b *Bot) cmdProjectSearch(keyword string) {
506506 }
507507}
508508
509- func (b * Bot ) cmdBg (msg * tgbotapi.Message ) {
509+ func (b * Bot ) cmdResearch (msg * tgbotapi.Message ) {
510510 if b .worker == nil {
511511 return
512512 }
@@ -516,13 +516,13 @@ func (b *Bot) cmdBg(msg *tgbotapi.Message) {
516516 // /bg → help
517517 if args == "" {
518518 b .sendMarkdown (
519- "🔄 *Background Tasks *\n \n " +
520- "`/bg <message>` — Run in current project \n " +
521- "`/bg <project> <message>` — Run in specific project\n " +
522- "`/bg status` — Show running tasks\n " +
523- "`/bg inject <id>` — Inject result into session\n " +
524- "`/bg cancel <id>` — Cancel a task\n \n " +
525- "Background tasks run independently .\n " +
519+ "🔍 *Research (read-only) *\n \n " +
520+ "`/research <message>` — Analyze in background \n " +
521+ "`/research <project> <message>` — In specific project\n " +
522+ "`/research status` — Show running tasks\n " +
523+ "`/research inject <id>` — Inject result into session\n " +
524+ "`/research cancel <id>` — Cancel a task\n \n " +
525+ "Read-only analysis. No file modifications .\n " +
526526 "Use inject to bring results into your conversation." )
527527 return
528528 }
@@ -537,7 +537,7 @@ func (b *Bot) cmdBg(msg *tgbotapi.Message) {
537537 if strings .HasPrefix (args , "inject " ) {
538538 taskID := strings .TrimSpace (strings .TrimPrefix (args , "inject" ))
539539 if taskID == "" {
540- b .sendMessage ("Usage: /bg inject <task_id>" )
540+ b .sendMessage ("Usage: /research inject <task_id>" )
541541 return
542542 }
543543 resultText , projectName , err := b .worker .GetBackgroundResult (taskID )
@@ -570,19 +570,19 @@ func (b *Bot) cmdBg(msg *tgbotapi.Message) {
570570 if strings .HasPrefix (args , "cancel " ) {
571571 taskID := strings .TrimSpace (strings .TrimPrefix (args , "cancel" ))
572572 if taskID == "" {
573- b .sendMessage ("Usage: /bg cancel <task_id>" )
573+ b .sendMessage ("Usage: /research cancel <task_id>" )
574574 return
575575 }
576576 if err := b .worker .CancelBackground (taskID ); err != nil {
577577 b .sendMessage ("Failed: " + err .Error ())
578578 } else {
579- b .sendMessage (fmt .Sprintf ("🛑 Cancelled background task: %s" , taskID ))
579+ b .sendMessage (fmt .Sprintf ("🛑 Cancelled research task: %s" , taskID ))
580580 }
581581 return
582582 }
583583
584584 // /bg <project> <message> or /bg <message>
585- projectName , message := b .parseBgArgs (args )
585+ projectName , message := b .parseResearchArgs (args )
586586
587587 taskID , err := b .worker .EnqueueBackground (context .Background (), projectName , message )
588588 if err != nil {
@@ -591,16 +591,16 @@ func (b *Bot) cmdBg(msg *tgbotapi.Message) {
591591 }
592592
593593 b .sendMessage (fmt .Sprintf (
594- "🔄 Background task started\n 🆔 %s\n 📂 Project: %s\n 💬 %s\n \n Use /bg status to check progress." ,
594+ "🔍 Research started\n 🆔 %s\n 📂 Project: %s\n 💬 %s\n \n Use /research status to check progress." ,
595595 taskID , projectName , worker .Truncate (message , 60 )))
596596}
597597
598- // parseBgArgs splits args into project name and message.
598+ // parseResearchArgs splits args into project name and message.
599599// If the first word matches a registered project (and it's different from
600600// the active project), it's used as the target project. Otherwise the
601601// entire string is the message for the active project.
602602// This avoids misrouting when the active project name happens to be the first word.
603- func (b * Bot ) parseBgArgs (args string ) (projectName , message string ) {
603+ func (b * Bot ) parseResearchArgs (args string ) (projectName , message string ) {
604604 active := b .worker .ActiveProject ()
605605 parts := strings .SplitN (args , " " , 2 )
606606 if len (parts ) == 2 {
0 commit comments