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:
Auto
2026-01-12 11:55:50 +02:00
parent c1985eb285
commit a7f8c3aa8d
16 changed files with 1032 additions and 194 deletions

View File

@@ -20,17 +20,6 @@ from auth import is_auth_error, print_auth_error_help
# Load environment variables from .env file if present
load_dotenv()
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", "claude")
from prompts import (
get_project_prompts_dir,
has_project_prompts,
@@ -237,9 +226,8 @@ def run_spec_creation(project_dir: Path) -> bool:
# Launch CLI with /create-spec command
# Project path included in command string so it populates $ARGUMENTS
# Capture stderr to detect auth errors while letting stdout flow to terminal
cli_command = get_cli_command()
result = subprocess.run(
[cli_command, f"/create-spec {project_dir}"],
["claude", f"/create-spec {project_dir}"],
check=False, # Don't raise on non-zero exit
cwd=str(Path(__file__).parent), # Run from project root
stderr=subprocess.PIPE,
@@ -267,17 +255,13 @@ def run_spec_creation(project_dir: Path) -> bool:
print(f"Please ensure app_spec.txt exists in: {get_project_prompts_dir(project_dir)}")
# If failed with non-zero exit and no spec, might be auth issue
if result.returncode != 0:
print(f"\nIf you're having authentication issues, try running: {cli_command} login")
print("\nIf you're having authentication issues, try running: claude login")
return False
except FileNotFoundError:
cli_command = get_cli_command()
print(f"\nError: '{cli_command}' command not found.")
if cli_command == "claude":
print("Make sure Claude Code CLI is installed:")
print(" npm install -g @anthropic-ai/claude-code")
else:
print(f"Make sure the '{cli_command}' CLI is installed and in your PATH.")
print("\nError: 'claude' command not found.")
print("Make sure Claude Code CLI is installed:")
print(" npm install -g @anthropic-ai/claude-code")
return False
except KeyboardInterrupt:
print("\n\nSpec creation cancelled.")
@@ -429,8 +413,7 @@ def run_agent(project_name: str, project_dir: Path) -> None:
print(f"\nAgent error:\n{stderr_output.strip()}")
# Still hint about auth if exit was unexpected
if "error" in stderr_output.lower() or "exception" in stderr_output.lower():
cli_command = get_cli_command()
print(f"\nIf this is an authentication issue, try running: {cli_command} login")
print("\nIf this is an authentication issue, try running: claude login")
except KeyboardInterrupt:
print("\n\nAgent interrupted. Run again to resume.")