01a0ef46c9
- Add startup_command field to ToolType model and API - Execute startup command before interactive shell in terminal sessions - Add tmux and ranger to OpenCode container spec - Update Tool Workshop UI with startup_command input for terminal types - Add backend tests for startup_command CRUD operations - Sync specs: tool-terminal, tool-types-definition, opencode-web-server - New spec: tool-terminal-startup-command Quality gates: Frontend typecheck/lint passed. Backend tests blocked by environment (Python/Docker not available). OpenSpec: terminal-startup-and-container-tools
2.3 KiB
2.3 KiB
1. Database and Model
- 1.1 Create Alembic migration to add
startup_commandtext column totool_typestable - 1.2 Add
startup_commandfield to ToolType SQLAlchemy model
2. Backend API
- 2.1 Add
startup_commandto ToolTypeCreate Pydantic schema - 2.2 Add
startup_commandto ToolTypeUpdate Pydantic schema - 2.3 Add
startup_commandto ToolTypeResponse Pydantic schema - 2.4 Update
POST /tool-typesendpoint to handlestartup_command - 2.5 Update
PUT /tool-types/{id}endpoint to handlestartup_command
3. Terminal Session Execution
- 3.1 Update
TerminalSession.start()to accept optionalstartup_commandparameter - 3.2 Implement startup command execution using
bash -c "<cmd>" || true; exec bash -ilpattern - 3.3 Update
TerminalManager.get_or_create_session()to accept and passstartup_command - 3.4 Update
TerminalManager.reset_session()to accept and passstartup_command - 3.5 Update terminal WebSocket endpoint to fetch tool type via instance and pass
startup_command - 3.6 Update terminal reset HTTP endpoint to pass
startup_command
4. Frontend
- 4.1 Add
startup_commandfield to ToolType form state in Tool Workshop - 4.2 Add
startup_commandinput to Tool Workshop UI (shown for terminal interface types) - 4.3 Update tool type submission to include
startup_command - 4.4 Update ToolType type definition to include
startup_command
5. OpenCode Container Tools
- 5.1 Update OpenCode built-in tool type compose template to install tmux and ranger
- 5.2 Ensure tmux and ranger are available in the container PATH
6. Tests and Verification
- 6.1 Add backend tests for tool type create/update with
startup_command - 6.2 Add backend tests for terminal session startup command execution (covered by implementation tests)
- 6.3 Run
pytestand ensure all tests pass — BLOCKED: Python/Docker not available in environment - 6.4 Run
mypy .and fix any type errors — BLOCKED: Python/Docker not available in environment - 6.5 Run
ruff check .and fix any lint errors — BLOCKED: Python/Docker not available in environment - 6.6 Run frontend
npm run typecheckand fix any errors — PASSED - 6.7 Run frontend
npm run lintand fix any errors — PASSED (no new errors introduced)