3.2 KiB
3.2 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-runtime-resolution | Resolve one executor variation | done | 1 | plan.md |
|
|
|
Task 01: Resolve One Executor Variation
Summary
Extend the single lifecycle model policy with safe unique-variation inference. Expose a distinct decision without changing explicit fallback semantics.
In scope
- Add the pure backend candidate matcher.
- Apply the defined four-step precedence order.
- Extend decision, logging, and warning metadata behavior.
- Cover initial launch, context reset, and workspace rebind.
Out of scope
- Host advisory UI and translations.
- Provider-specific variation parsing or ranking.
- Profile persistence changes.
Acceptance
- One valid distinct variation is the only inferred model-selection call.
- Exact and advertised explicit fallback models remain higher priority; zero or multiple variations cause no inference.
- Automatic-fallback profiles keep the legacy no-selection behavior when the requested model is absent.
- The warning records the unique outcome and effective model without setting the explicit fallback field or compatibility fallback event.
Verification
(
cd apps/backend
go test -tags fts5 -run 'TestApplyStartModelPolicy|TestInitializeAndPrompt.*Model|TestReapplySessionModel|TestWorkspaceRebind.*Model|Test.*ModelSelectionWarning' ./internal/agent/runtime/lifecycle
go test -tags fts5 ./internal/agent/runtime/lifecycle
)
git diff --check
Files likely touched
apps/backend/internal/agent/runtime/lifecycle/start_model.goapps/backend/internal/agent/runtime/lifecycle/start_model_executor_authority_test.goapps/backend/internal/agent/runtime/lifecycle/session.goapps/backend/internal/agent/runtime/lifecycle/session_model_selection_warning_test.goapps/backend/internal/agentctl/types/streams/agent.go
Dependencies
None.
Risks
- The Cursor-specific configuration parser rejects labels such as
1m. This matcher must remain a separate model-ID helper. - A special inferred-model apply path can weaken existing error handling.
Parallelism
sequential
Inputs
- Requirement 002 and its matching examples.
- The unique-variation ADR.
- Existing
applyStartModelPolicyand warning publication tests.
Results
Implemented the executor-authoritative unique-variation policy in
start_model.go, including explicit-fallback precedence, opaque and
case-sensitive matching, the legacy automatic-fallback path, and distinct
warning metadata without a legacy fallback event. Initial launch, context
reset, and workspace rebind all use the same policy. Focused model-policy
tests passed (29), and the full lifecycle suite passed (2,364).