You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add test coverage verifying that backend_type is correctly set when agents are
spawned, restarted, and reconciled. The existing test harness in crates/orchestrator/tests/ already constructs ApiState with backend_type: BackendType::Tmux but no tests assert the value flows through
to the agent record.
Context
Existing tests in conversation_persistence.rs and system_agent_http.rs
create ApiState with a hardcoded BackendType::Tmux. After #1235 and #1236
land, the AgentManager itself will be responsible for setting the backend
type on agents. Tests should verify:
A spawned agent's backend_type matches the backend in use
A restarted agent's backend_type is updated if the backend changed
The API response (AgentResponse) carries the correct backend_type
Acceptance Criteria
Add a unit test in crates/orchestrator/ (or integration test in crates/orchestrator/tests/) that spawns an agent via the API and asserts response.backend_type == Some("tmux") (or whichever test backend is used)
Add a test that verifies backend_type is persisted to storage correctly
(read back from DB after spawn)
Add a test that verifies AgentResponse::from(agent) preserves the backend_type field
If feasible, add a test with a mock backend that returns a non-tmux backend_name() to verify the value is not hardcoded
cargo test passes
Key Files
crates/orchestrator/tests/system_agent_http.rs -- existing test harness
with ApiState construction (line 114)
crates/orchestrator/tests/conversation_persistence.rs -- another test
harness example (line 118)
Summary
Add test coverage verifying that
backend_typeis correctly set when agents arespawned, restarted, and reconciled. The existing test harness in
crates/orchestrator/tests/already constructsApiStatewithbackend_type: BackendType::Tmuxbut no tests assert the value flows throughto the agent record.
Context
Existing tests in
conversation_persistence.rsandsystem_agent_http.rscreate
ApiStatewith a hardcodedBackendType::Tmux. After #1235 and #1236land, the
AgentManageritself will be responsible for setting the backendtype on agents. Tests should verify:
backend_typematches the backend in usebackend_typeis updated if the backend changedAgentResponse) carries the correctbackend_typeAcceptance Criteria
crates/orchestrator/(or integration test incrates/orchestrator/tests/) that spawns an agent via the API and assertsresponse.backend_type == Some("tmux")(or whichever test backend is used)backend_typeis persisted to storage correctly(read back from DB after spawn)
AgentResponse::from(agent)preserves thebackend_typefieldbackend_name()to verify the value is not hardcodedcargo testpassesKey Files
crates/orchestrator/tests/system_agent_http.rs-- existing test harnesswith
ApiStateconstruction (line 114)crates/orchestrator/tests/conversation_persistence.rs-- another testharness example (line 118)
crates/orchestrator/src/types.rs--AgentResponse::from(Agent)implcrates/orchestrator/src/manager.rs--spawn_agent(),restart_agent()Blocked By
Stack Base
Stack on:
feature/autonomous-pipelineBlocked by: #1236
Parallel: no ordering constraint with #1237 or #1238 (test files only)