Files
headquarter/openspec/changes/opencode-web-terminal/specs/tool-port-configuration/spec.md
T
Fusion ac6bd3304d feat(opencode-web-terminal): complete OpenCode web terminal implementation
- Update OpenCode compose template with web server on port 3000
- Add default_port=3000 and interfaces=[terminal, web] to OpenCode seed data
- Remove hardcoded 8080 fallback in tunnel creation
- Fail gracefully when tool type has no default_port configured
- Update frontend ToolType API to include default_port, category, interfaces
- Add port, category, and interfaces fields to tool type creation form
- Display port and interfaces in tool type cards
- Create migration 0012 to make default_port non-nullable
- Set default_port values for existing built-in tool types
- Quality gates: typecheck ✓, build ✓, Python syntax ✓
2026-05-20 17:17:50 +02:00

39 lines
1.4 KiB
Markdown

## ADDED Requirements
### Requirement: Tool types must define a default port
The system SHALL require all tool types to specify a `default_port`.
#### Scenario: Creating tool type without port
- **GIVEN** a user creating a new tool type
- **WHEN** they omit the `default_port` field
- **THEN** the system rejects the request with a 422 error
#### Scenario: Creating tool type with port
- **GIVEN** a user creating a new tool type with `default_port: 3000`
- **WHEN** the request is submitted
- **THEN** the tool type is created successfully
### Requirement: Tool type port must be exposed in compose template
The system SHALL validate that the compose template exposes the port defined in `default_port`.
#### Scenario: Port mismatch
- **GIVEN** a tool type with `default_port: 8443`
- **WHEN** the compose template only exposes port `3000`
- **THEN** the system rejects with an error indicating the port mismatch
#### Scenario: Port exposed correctly
- **GIVEN** a tool type with `default_port: 8443`
- **WHEN** the compose template exposes port `8443` via `ports: ["8443:8443"]`
- **THEN** the tool type is accepted
### Requirement: Tool types support multiple interfaces
The system SHALL allow tool types to specify multiple interfaces.
#### Scenario: Tool with web and terminal interfaces
- **GIVEN** a tool type with `interfaces: ["terminal", "web"]`
- **WHEN** an instance is created
- **THEN** the instance shows both "Open" (web) and "Terminal" buttons in the UI