## 1. Tool Type Port Configuration

- [x] 1.1 Update ToolType model to make `default_port` required (non-nullable)
- [x] 1.2 Add validation in tool type API to reject missing `default_port`
- [x] 1.3 Add compose template validation to verify port is exposed in `ports` section
- [x] 1.4 Update tool type creation/update endpoints to validate port configuration

## 2. OpenCode Web Server

- [x] 2.1 Update OpenCode compose template to run a web server on port 3000
- [x] 2.2 Add `default_port: 3000` to OpenCode seed data
- [x] 2.3 Update OpenCode `interfaces` to `["terminal", "web"]`
- [x] 2.4 Create a simple web terminal HTML page served by OpenCode container

## 3. Tunnel Port Fix

- [x] 3.1 Update tunnel creation to use `tool_type.default_port` instead of hardcoded 8080
- [x] 3.2 Ensure tunnel creation fails gracefully if port is not defined
- [x] 3.3 Remove fallback to port 8080 in tunnel creation

## 4. Frontend Updates

- [x] 4.1 Update instance list to show both "Open" and "Terminal" buttons for dual-interface tools
- [x] 4.2 Update ToolType interface in frontend to include `default_port`
- [x] 4.3 Update tool type creation form to require port input

## 5. Database Migration

- [x] 5.1 Create Alembic migration to make `default_port` non-nullable
- [x] 5.2 Set `default_port` for existing tool types (code-server=8443, jupyter=8888, opencode=3000)

## 6. Testing & Quality Gates

- [x] 6.1 Test creating tool type without port fails validation
- [x] 6.2 Test creating tool type with port mismatch fails validation
- [x] 6.3 Test OpenCode instance creates tunnel on port 3000
- [x] 6.4 Run backend quality gates (ruff, mypy) - skipped (not installed)
- [x] 6.5 Run frontend quality gates (typecheck, lint, build) - PASSED
- [x] 6.6 Commit and push changes
