3.5 KiB
3.5 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-route-active-host-runtime | Route active host runtime | done | 2 |
|
plan.md | ../../specs/agents/requirements/runtime-updates.md |
Task 02: Route active host runtime
Acceptance
- Standalone managed-agent launches use the persisted exact active version; no-selection launches preserve legacy unversioned behavior.
- Boot/manual probes, model-configuration resolution, profile prompts, and sessionless utility prompts use the same host command resolver.
- SSH and container launches receive no host version override; supported native binary preference remains unchanged.
- A saved-selection read failure fails the new host launch/probe visibly rather than silently selecting npm latest.
- Candidate probes remain able to supply a trusted exact command override without changing the active resolver.
TDD sequence
- Add lifecycle tests that expect exact standalone argv and unchanged SSH, container, native, and no-selection argv.
- Add host-utility tests for every call site currently reading
InferenceConfig().Commanddirectly. - Add the active-version provider to lifecycle and host utility, make launch command building context-aware where required, and centralize utility command resolution.
- Wire one store instance from backend startup into lifecycle, host utility, and the settings controller; add composition tests.
- Run focused packages and backend lint.
Files likely touched
apps/backend/internal/agent/runtime/lifecycle/manager.goapps/backend/internal/agent/runtime/lifecycle/manager_launch.goapps/backend/internal/agent/runtime/lifecycle/manager_interaction.goapps/backend/internal/agent/runtime/lifecycle/*_test.goapps/backend/internal/agent/hostutility/manager.goapps/backend/internal/agent/hostutility/public.goapps/backend/internal/agent/hostutility/manager_test.goapps/backend/internal/backendapp/main.goapps/backend/internal/backendapp/agents.goapps/backend/internal/backendapp/*_test.go
Verification
make -C apps/backend test ARGS='./internal/agent/runtime/lifecycle ./internal/agent/hostutility ./internal/backendapp'
make -C apps/backend lint
Risks
- Cover restart/fresh-command rebuilding as well as initial launches.
- Do not rewrite static
Runtime().Cmdglobally; route only trusted host-local dynamic commands. - Preserve command prefixes, CLI flags, resume arguments, and native preference.
Output contract
Record RED/GREEN evidence, exact command assertions, checks, and risks in
Results. Update this task and plan.md status.
Results
RED covered exact standalone/worktree command routing, legacy no-selection behavior, SSH/container exclusions, and selection read errors at the lifecycle and host-utility boundaries. GREEN verification:
rtk go test ./internal/agent/managedruntime ./internal/agent/agents ./internal/agent/hostutility ./internal/agent/runtime/lifecycle ./internal/agent/settings/controller ./internal/agent/settings/handlers ./internal/backendapp— 2,321 tests passed across 7 packages.rtk make -C apps/backend lint— 0 issues.
One selection store instance is wired through backend startup into lifecycle, host utility, and update orchestration. Host-local probes, model resolution, profile prompts, sessionless prompts, and standalone launches share the exact version resolver. Remote/container command ownership and native preference are unchanged.