feat(368): add Gemini/vibe-local CLI support and fix prompt detection#369
Merged
feat(368): add Gemini/vibe-local CLI support and fix prompt detection#369
Conversation
…ration, API, vibe-local - Add selected-agents-validator.ts with parseSelectedAgents(), validateSelectedAgentsInput(), and validateAgentsPair() core functions (R1-001 shared validation) - Add getCliToolDisplayName() and CLI_TOOL_DISPLAY_NAMES to cli-tools/types.ts - Add 'vibe-local' to CLI_TOOL_IDS (4th tool) - Add VibeLocalTool stub class in cli-tools/vibe-local.ts - Register VibeLocalTool in CLIToolManager - Add DB migration v18: selected_agents column with cli_tool_id-aware defaults - Update getWorktreeById/getWorktrees to include selectedAgents field - Add updateSelectedAgents() DB function - Extend GET /api/worktrees/:id with selectedAgents in response - Extend PATCH /api/worktrees/:id with selectedAgents update + cli_tool_id auto-sync - Add isValidWorktreeId check to GET/PATCH handlers (R4-002) - Use CLI_TOOL_IDS instead of hardcoded arrays in API routes (R1-003) - Remove SQL IN clause from getLastMessagesByCliBatch (R4-001) - Update types: sessionStatusByCli/lastMessagesByCli to Partial<Record<CLIToolType,...>> - Update SidebarBranchItem.cliStatus to Partial<Record<CLIToolType, BranchStatus>> - Fix BranchListItem.tsx with optional chaining for cliStatus - Update api-client.ts to use CLIToolType instead of hardcoded union - Fix all existing tests for 4-tool count (manager, types, session-cleanup, db-migrations) - Add 30 new tests: selected-agents-validator (23) + display-name (7) - All 3982 tests pass, 0 TypeScript errors, 0 ESLint errors Refs #368 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace hardcoded claude/codex in toBranchItem() with dynamic selectedAgents lookup (sidebar.ts) - Remove non-null assertions (!) in PATCH route by extracting validatedAgents variable with type assertion (route.ts) - Update JSDoc comments to include vibe-local in CLI tool enumerations (types.ts, manager.ts, models.ts) - Add 2 new sidebar tests for selectedAgents-based cliStatus behavior Quality Metrics: - Tests: 3982 -> 3984 (2 new sidebar tests) - TypeScript errors: 0 - ESLint errors: 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive design documentation and review artifacts for the Agent settings tab feature (Issue #368). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… removal - Create AgentSettingsPane component with checkbox UI (max 2 selection) - Extend NotesAndLogsPane with 'agent' sub-tab for Agent settings - Replace hardcoded ['claude','codex'] arrays in WorktreeDetailRefactored with dynamic selectedAgents state from API - Replace capitalizeFirst() with centralized getCliToolDisplayName() - Add selectedAgents state synced from API, with useEffect for activeCliTab sync - Replace hardcoded CLI tool arrays in 7 API routes with CLI_TOOL_IDS - Replace custom display name functions in MessageList.tsx and AutoYesToggle.tsx with getCliToolDisplayName() - Add i18n keys for Agent tab (en/ja) - All 4001 unit tests pass, 0 TypeScript errors, 0 ESLint errors Issue #368 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ent settings Extract isCliToolType() type guard and getCliToolDisplayNameSafe() safe wrapper to replace unsafe `as CLIToolType` casts in MessageList and AutoYesToggle. Remove duplicated getToolName()/formatCliToolName() local functions (DRY). Refactor AgentSettingsPane to use ref pattern for stable callback identity. Extract NotesAndLogsPane tab buttons into data-driven SUB_TABS array (DRY). Quality Metrics: - TypeScript errors: 0 - ESLint errors: 0 - Tests: 4011 passed (10 new tests added) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add AgentSettingsPane, NotesAndLogsPane (with agent tab), WorktreeDetailRefactored entries to CLAUDE.md - Update cli-tools/types.ts entry with isCliToolType() and getCliToolDisplayNameSafe() - Add iteration-2 progress report, context files, and results Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace non-interactive pipe mode (echo | gemini) with interactive session - startSession() now launches `gemini` command in tmux (same as Claude/Codex) - sendMessage() uses sendKeys + Enter instead of pipe - Update GEMINI_PROMPT_PATTERN to match REPL prompt (> / ❯) - Add GEMINI_THINKING_PATTERN for braille spinner detection - Update getCliToolPatterns() with interactive mode patterns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini CLI shows "Do you trust this folder?" on first launch in a new directory. Add handleTrustDialog() that polls tmux output and auto-selects "1. Trust folder" during session initialization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… status display - Rewrite vibe-local.ts from pipe mode to interactive REPL mode (launch `vibe-local -y` in tmux, IME double-Enter for message submission) - Add VIBE_LOCAL_PROMPT_PATTERN (`ctx:N% ❯`) and VIBE_LOCAL_THINKING_PATTERN to cli-patterns.ts with full skipPatterns support - Add vibe-local to response-poller.ts prompt-based completion detection - Fix BranchListItem.tsx: replace hardcoded Claude/Codex dots with dynamic rendering from selectedAgents (supports all CLI tools including vibe-local) - Improve Gemini trust dialog timing (6s init, 1s poll, prompt early exit) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add model dropdown in Agent settings that fetches available models from the local Ollama server and persists the selection per worktree. When starting a vibe-local session, the selected model is passed via -m flag. - DB migration v19: add vibe_local_model column to worktrees table - New API: GET /api/ollama/models (queries Ollama at localhost:11434) - PATCH /api/worktrees/:id: add vibeLocalModel validation and persistence - AgentSettingsPane: Ollama model dropdown when vibe-local is checked - vibe-local.ts: read model from DB and pass -m flag on session start Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extend scheduled execution to support gemini and vibe-local CLI tools in addition to claude and codex. Gemini uses `-p` flag, vibe-local uses `-p -y` with optional `--model` from worktree DB settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…cal support Add Issue #368 entry to implementation-history (JP/EN), update architecture.md with new CLI tools and DB columns (JP/EN), and add Agent Settings section to webapp-guide (JP/EN). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract OLLAMA_MODEL_PATTERN to types.ts for defense-in-depth model name validation at point of use (vibe-local.ts) and API route - Replace direct execAsync tmux calls with sendSpecialKey() in gemini.ts and vibe-local.ts, extending SpecialKey type with C-m/Enter - Add CLI tool ID validation via isCliToolType() in cmate-parser.ts to reject invalid tool IDs before DB storage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tection Gemini CLI wraps Action Required prompts in ╭─╮│╰─╯ borders, which prevented prompt detection since │ prefix/suffix broke pattern matching. - Add stripBoxDrawing() utility in cli-patterns.ts to remove box borders - Apply stripBoxDrawing() after stripAnsi() in response-poller.ts and auto-yes-manager.ts prompt detection pipelines - Add ● (U+25CF) support to DEFAULT_OPTION_PATTERN in prompt-detector.ts - Add unit tests for stripBoxDrawing() and box-wrapped Gemini prompts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stripBoxDrawing()を全detectPrompt()呼び出し箇所に適用)response-poller.tsのsetInterval→setTimeoutチェーン変換でレースコンディション修正Changes
New Features
src/lib/cli-tools/gemini.ts,vibe-local.ts)src/components/worktree/AgentSettingsPane.tsx)Bug Fixes
stripBoxDrawing()を全detectPrompt()呼び出し箇所に適用(status-detector, current-output, prompt-response, auto-yes-manager, response-poller)response-poller.tsのレースコンディション修正(setInterval→setTimeoutチェーン)Security
Test plan
npx tsc --noEmitパスnpm run lintパスnpm run test:unitパスnpm run buildパスstatus: pendingを維持し、Web UIにポップアップ表示されること🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com