feat: auto-infer workspace names from conversation context#1041
feat: auto-infer workspace names from conversation context#1041jschwxrz wants to merge 8 commits intogeneralaction:mainfrom
Conversation
|
@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 SummaryThis 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
Confidence Score: 4/5
|
| 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)
Last reviewed commit: 1df44a6
| "minimatch": "^10.1.1", | ||
| "monaco-editor": "^0.55.1", | ||
| "motion": "^12.23.12", | ||
| "nbranch": "^0.1.0", |
There was a problem hiding this comment.
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!
summary:
how it works:
UI changes:
#1033