Skip to content

Comments

feat: auto-infer workspace names from conversation context#1041

Open
jschwxrz wants to merge 8 commits intogeneralaction:mainfrom
jschwxrz:feat/task-name-generation
Open

feat: auto-infer workspace names from conversation context#1041
jschwxrz wants to merge 8 commits intogeneralaction:mainfrom
jschwxrz:feat/task-name-generation

Conversation

@jschwxrz
Copy link
Contributor

@jschwxrz jschwxrz commented Feb 22, 2026

summary:

  • task name is now optional
  • auto populates when issue is linked or when initial prompt exists
  • if task is created without issue or initial prompt and user does not add task-name, falls back to random name on submit
  • fallback random name is updated with first task name generated based on "real" message user sends in the chat

how it works:

  • uses keyword extraction to generate a conventional task name
  • pre-task-creation: generate and use as task and worktree name
  • post-task-creation: buffer accumulates user keystrokes. when message is sent to agent and the agents PTY output shows "busy", a task name is generated based on the user message and task is renamed
  • manual task rename still possible through right clicking the task in the left sidebar

UI changes:

  • task name shows optional
  • create button enabled even when task name empty
Screenshot 2026-02-22 at 21 03 34

#1033

@vercel
Copy link

vercel bot commented Feb 22, 2026

@jschwxrz is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link

greptile-apps bot commented Feb 22, 2026

Greptile Summary

This PR makes task names optional by auto-generating them from linked issue context or initial prompts during creation, and from terminal input after the agent starts processing. It adds a TerminalInputBuffer that captures the user's first real message and triggers a rename when the agent signals "busy".

  • Adds nbranch dependency (with compromise NLP library) for keyword-based slug generation from natural language input
  • Task name field is now optional in the creation modal — if left empty, a random friendly name is generated at submit time
  • Auto-generated names can be overridden by the first "real" terminal message, detected via the existing activityClassifier busy signal
  • nameGenerated metadata flag tracks whether a name is eligible for auto-rename, cleared on manual rename
  • Debounced name regeneration in TaskModal when prompt text changes (400ms), immediate for issue link/unlink
  • New TerminalInputBuffer class handles ANSI escape stripping, backspace, and multi-line paste accumulation
  • Three new test files with good coverage of name generation, context-based naming, and input buffer behavior

Confidence Score: 4/5

  • This PR is safe to merge — it adds a well-tested optional feature with proper fallbacks and no breaking changes to the existing task creation flow.
  • The feature is well-architected with a clean separation of concerns (name generation, input capture, confirmation via activity signal). The one-shot pattern prevents repeated renames, and the nameGenerated flag correctly gates auto-rename eligibility. Three new test files provide solid coverage. The main concerns are the bundle size impact of the nbranch/compromise dependency and minor ANSI parsing edge cases, neither of which are blocking.
  • Pay attention to src/renderer/components/TaskModal.tsx (debounce logic) and package.json (new dependency bundle size impact).

Important Files Changed

Filename Overview
src/renderer/lib/branchNameGenerator.ts New file: Core keyword extraction and task name generation using nbranch library. Clean API with context-priority logic (issue > prompt). Well structured.
src/renderer/terminal/TerminalInputBuffer.ts New file: One-shot terminal input capture buffer with ANSI escape stripping, backspace handling, and multi-line paste support. Confirmed via confirmSubmit pattern.
src/renderer/terminal/TerminalSessionManager.ts Integrates TerminalInputBuffer for input capture and activity classifier for confirming message submission. Proper disposal and null cleanup.
src/renderer/components/TaskModal.tsx Significant changes: task name is now optional, auto-generates from context with debounce. Fallback random name on submit. Debounce logic has a subtle condition that may cause unnecessary immediate calls when prompt is empty.
src/renderer/components/ChatInterface.tsx Adds handleFirstMessage callback pattern using ref for stable reference, wired to TerminalPane's onFirstMessage prop. Correctly guards against multiAgent and non-generated names.
src/renderer/lib/taskCreationService.ts Adds nameGenerated to CreateTaskParams and includes it in task metadata. Condition for metadata creation expanded correctly.
src/renderer/types/chat.ts Adds nameGenerated optional field to TaskMetadata interface. Well documented with JSDoc.
package.json Adds nbranch ^0.1.0 dependency. Brings in compromise NLP library (non-trivial bundle size impact).

Sequence Diagram

sequenceDiagram
    participant User
    participant TaskModal
    participant branchNameGenerator
    participant TaskCreationService
    participant TerminalPane
    participant TerminalInputBuffer
    participant TerminalSessionManager
    participant activityClassifier
    participant useTaskManagement

    User->>TaskModal: Types prompt / links issue
    TaskModal->>branchNameGenerator: generateTaskNameFromContext()
    branchNameGenerator-->>TaskModal: slug name (or null)
    TaskModal->>TaskModal: ensureUniqueTaskName()
    User->>TaskModal: Clicks Create (name optional)
    TaskModal->>TaskCreationService: createTask({nameGenerated: true})
    TaskCreationService-->>TaskModal: Task created with metadata

    Note over User, TerminalPane: Post-creation: terminal auto-rename flow

    User->>TerminalPane: Types first message
    TerminalPane->>TerminalInputBuffer: feed(keystroke data)
    TerminalInputBuffer->>TerminalInputBuffer: Strip ANSI, accumulate buffer
    User->>TerminalPane: Presses Enter
    TerminalInputBuffer->>TerminalInputBuffer: Snapshot pendingMessage

    Note over TerminalSessionManager: Agent PTY output arrives
    TerminalSessionManager->>activityClassifier: classifyActivity(chunk)
    activityClassifier-->>TerminalSessionManager: "busy"
    TerminalSessionManager->>TerminalInputBuffer: confirmSubmit()
    TerminalInputBuffer->>ChatInterface: onCapture(message)
    ChatInterface->>branchNameGenerator: generateTaskName(message)
    branchNameGenerator-->>ChatInterface: new slug name
    ChatInterface->>useTaskManagement: handleRenameTask(project, task, newName)
    useTaskManagement->>useTaskManagement: Rename branch + save task (nameGenerated=false)
Loading

Last reviewed commit: 1df44a6

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

"minimatch": "^10.1.1",
"monaco-editor": "^0.55.1",
"motion": "^12.23.12",
"nbranch": "^0.1.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New dependency adds ~300KB+ to renderer bundle

nbranch@0.1.0 pulls in compromise (a full NLP library), stopword, and several sub-dependencies (efrt, grad-school, suffix-thumb). This is a non-trivial addition to the renderer bundle for keyword extraction. Have you considered whether a lighter approach (e.g. simple regex-based stop-word removal + slugification) would suffice for generating task names? The current use only extracts 3 keywords from short text.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant