mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 06:12:06 +00:00
feat: add multiple terminal tabs with rename capability
Add support for multiple terminal instances per project with tabbed
navigation in the debug panel. Each terminal maintains its own PTY
session and WebSocket connection.
Backend changes:
- Add terminal metadata storage (id, name, created_at) per project
- Update terminal_manager.py with create, list, rename, delete functions
- Extend WebSocket endpoint to /api/terminal/ws/{project}/{terminal_id}
- Add REST endpoints for terminal CRUD operations
- Implement deferred PTY start with initial resize message
Frontend changes:
- Create TerminalTabs component with neobrutalism styling
- Support double-click rename and right-click context menu
- Fix terminal switching issues with transform-based hiding
- Use isActiveRef to prevent stale closure bugs in connect()
- Add double requestAnimationFrame for reliable activation timing
- Implement proper dimension validation in fitTerminal()
Other updates:
- Add GLM model configuration documentation to README
- Simplify client.py by removing CLI_COMMAND support
- Update chat session services with consistent patterns
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
22
client.py
22
client.py
@@ -20,26 +20,12 @@ from security import bash_security_hook
|
||||
# Load environment variables from .env file if present
|
||||
load_dotenv()
|
||||
|
||||
# Default CLI command - can be overridden via CLI_COMMAND environment variable
|
||||
# Common values: "claude" (default), "glm"
|
||||
DEFAULT_CLI_COMMAND = "claude"
|
||||
|
||||
# Default Playwright headless mode - can be overridden via PLAYWRIGHT_HEADLESS env var
|
||||
# When True, browser runs invisibly in background
|
||||
# When False, browser window is visible (default - useful for monitoring agent progress)
|
||||
DEFAULT_PLAYWRIGHT_HEADLESS = False
|
||||
|
||||
|
||||
def get_cli_command() -> str:
|
||||
"""
|
||||
Get the CLI command to use for the agent.
|
||||
|
||||
Reads from CLI_COMMAND environment variable, defaults to 'claude'.
|
||||
This allows users to use alternative CLIs like 'glm'.
|
||||
"""
|
||||
return os.getenv("CLI_COMMAND", DEFAULT_CLI_COMMAND)
|
||||
|
||||
|
||||
def get_playwright_headless() -> bool:
|
||||
"""
|
||||
Get the Playwright headless mode setting.
|
||||
@@ -187,14 +173,12 @@ def create_client(project_dir: Path, model: str, yolo_mode: bool = False):
|
||||
print(" - Project settings enabled (skills, commands, CLAUDE.md)")
|
||||
print()
|
||||
|
||||
# Use system CLI instead of bundled one (avoids Bun runtime crash on Windows)
|
||||
# CLI command is configurable via CLI_COMMAND environment variable
|
||||
cli_command = get_cli_command()
|
||||
system_cli = shutil.which(cli_command)
|
||||
# Use system Claude CLI instead of bundled one (avoids Bun runtime crash on Windows)
|
||||
system_cli = shutil.which("claude")
|
||||
if system_cli:
|
||||
print(f" - Using system CLI: {system_cli}")
|
||||
else:
|
||||
print(f" - Warning: System CLI '{cli_command}' not found, using bundled CLI")
|
||||
print(" - Warning: System 'claude' CLI not found, using bundled CLI")
|
||||
|
||||
# Build MCP servers config - features is always included, playwright only in standard mode
|
||||
mcp_servers = {
|
||||
|
||||
Reference in New Issue
Block a user