3.7 KiB
3.7 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-add-session-capability | Add and enforce the session capability | done | 1 | plan.md | ../../specs/ui/requirements/embedded-vscode-executor-availability.md |
Task 01: Add and Enforce the Session Capability
Acceptance
- A shared backend resolver returns the specified embedded-VS-Code capability for every known runtime/host-OS combination and fails closed for unknown values.
- Every authorized task-session status response includes
capabilities.embedded_vscodefor that session's executor. - Opening
internal_vscodedirectly or through the saved default returnsErrEditorUnavailablefor an unsupported session while supported sessions and other editor kinds retain their existing behavior.
Verification
Use TDD: add the executor matrix, status contract, and editor-service rejection tests; observe the
focused failures; implement the shared resolver and both consumers; then rerun from
apps/backend/:
go test ./internal/editors/capabilities ./internal/orchestrator ./internal/editors/service ./internal/editors/handlers
Files likely touched
apps/backend/internal/editors/capabilities/capabilities.go(new)apps/backend/internal/editors/capabilities/capabilities_test.go(new)apps/backend/internal/orchestrator/dto/dto.goapps/backend/internal/orchestrator/task_operations.goapps/backend/internal/orchestrator/task_operations_test.goapps/backend/internal/editors/service/service.goapps/backend/internal/editors/service/service_test.go
Dependencies
None.
Parallelism
Sequential. This task owns the backend contract and shared enforcement consumed by Task 02.
Inputs
- Spec sections: What, API surface, Failure modes, and scenarios 1–7.
- ADR:
docs/decisions/2026-07-30-embedded-editor-executor-capabilities.md. - Existing patterns:
- executor constants in
apps/backend/internal/task/models/models.go TaskSessionStatusResponseinapps/backend/internal/orchestrator/dto/dto.gopopulateExecutorStatusInfoinapps/backend/internal/orchestrator/task_operations.goErrEditorUnavailableinapps/backend/internal/editors/service/service.go
- executor constants in
Risks
- Do not let unknown or test-only executor values inherit the default standalone runtime.
- Use actual session executor data for enforcement; do not trust a client-supplied executor type.
- Keep the editor service's repository interface minimal and update its test doubles without broadening unrelated dependencies.
Output contract
Report the API shape and capability matrix implemented, files changed, red and green command
results, and any remaining risk. Update this task to done, its plan checkbox/status, and the spec
to building.
Completion record
- Added
editors/capabilities.SupportsEmbeddedVscode, which accepts only Linux/Darwin for Local and Worktree, accepts the supported container/remote executor types, and fails closed otherwise. task.session.statusnow always includescapabilities.embedded_vscode; missing executors returnfalse. Direct internal-editor requests resolve the session executor and returnErrEditorUnavailablewhen unsupported, for saved-default, explicit, folder, and file paths.- Red: the resolver/status/service tests initially failed to compile or returned a successful internal-editor URL before the capability contract and guard were added.
- Green:
go test ./internal/editors/capabilities ./internal/orchestrator ./internal/editors/service ./internal/editors/handlerspassed. - Remaining risk: a true capability identifies a supported runtime only; code-server download and startup retain their existing runtime error handling.