@team-agent/installer 0.5.126 → 0.5.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/README.md +11 -0
- package/crates/team-agent/src/cli/adapters.rs +3 -13
- package/crates/team-agent/src/cli/arguments.rs +4 -0
- package/crates/team-agent/src/cli/diagnose.rs +68 -91
- package/crates/team-agent/src/cli/emit.rs +61 -28
- package/crates/team-agent/src/cli/grok_slot.rs +88 -3
- package/crates/team-agent/src/cli/intent/runtime.rs +38 -9
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +147 -11
- package/crates/team-agent/src/cli/intent/tests.rs +10 -12
- package/crates/team-agent/src/cli/intent.rs +1 -1
- package/crates/team-agent/src/cli/mod.rs +38 -9
- package/crates/team-agent/src/cli/models.rs +789 -186
- package/crates/team-agent/src/cli/schedule.rs +175 -0
- package/crates/team-agent/src/cli/send/persist.rs +0 -36
- package/crates/team-agent/src/cli/send/presentation.rs +1 -1
- package/crates/team-agent/src/cli/send.rs +108 -110
- package/crates/team-agent/src/cli/spec.rs +6 -0
- package/crates/team-agent/src/cli/status_port/brief.rs +5 -67
- package/crates/team-agent/src/cli/tests/leader_watch.rs +12 -62
- package/crates/team-agent/src/cli/tests/mod.rs +3 -3
- package/crates/team-agent/src/cli/tests/named_address.rs +11 -10
- package/crates/team-agent/src/cli/tests/run_delegation.rs +12 -9
- package/crates/team-agent/src/cli/tests/status_send.rs +70 -273
- package/crates/team-agent/src/compiler/tests.rs +39 -27
- package/crates/team-agent/src/compiler.rs +206 -6
- package/crates/team-agent/src/contract_runtime/backend.rs +181 -11
- package/crates/team-agent/src/contract_runtime/commands.rs +338 -7
- package/crates/team-agent/src/contract_runtime/config.rs +30 -19
- package/crates/team-agent/src/contract_runtime/config_tests.rs +24 -4
- package/crates/team-agent/src/contract_runtime/discovery.rs +12 -1
- package/crates/team-agent/src/contract_runtime/fork.rs +3 -10
- package/crates/team-agent/src/contract_runtime/framework.rs +28 -14
- package/crates/team-agent/src/contract_runtime/mcp.rs +19 -24
- package/crates/team-agent/src/contract_runtime/prompt.rs +2 -2
- package/crates/team-agent/src/contract_runtime/registry.rs +93 -130
- package/crates/team-agent/src/coordinator/steps/abnormal.rs +45 -5
- package/crates/team-agent/src/coordinator/tests/api_error_recovery.rs +8 -29
- package/crates/team-agent/src/coordinator/tests/energy.rs +4 -4
- package/crates/team-agent/src/coordinator/tests/health_sync.rs +44 -2
- package/crates/team-agent/src/coordinator/tests/main_preserved.rs +2 -2
- package/crates/team-agent/src/coordinator/tests/spine.rs +1 -1
- package/crates/team-agent/src/coordinator/tests/takeover.rs +3 -3
- package/crates/team-agent/src/coordinator/tick.rs +1 -89
- package/crates/team-agent/src/db/message_store.rs +7 -65
- package/crates/team-agent/src/direct_delivery.rs +368 -0
- package/crates/team-agent/src/inbox_store.rs +169 -0
- package/crates/team-agent/src/leader/registry.rs +5 -0
- package/crates/team-agent/src/leader/start.rs +2 -1
- package/crates/team-agent/src/leader/tests/lease_api.rs +2 -2
- package/crates/team-agent/src/leader/tests/prompt_contract.rs +1 -0
- package/crates/team-agent/src/lib.rs +2 -0
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +33 -0
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +206 -1
- package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +28 -2
- package/crates/team-agent/src/lifecycle/launch/fork_agent.rs +36 -179
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +87 -6
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +13 -488
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +351 -81
- package/crates/team-agent/src/lifecycle/launch/pi_mcp_extension.js +3 -4
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +26 -2
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +41 -31
- package/crates/team-agent/src/lifecycle/launch.rs +27 -12
- package/crates/team-agent/src/lifecycle/profile_launch.rs +318 -64
- package/crates/team-agent/src/lifecycle/restart/agent.rs +1 -0
- package/crates/team-agent/src/lifecycle/restart/avatar.rs +1798 -0
- package/crates/team-agent/src/lifecycle/restart/claude_fork.rs +163 -0
- package/crates/team-agent/src/lifecycle/restart/common.rs +298 -133
- package/crates/team-agent/src/lifecycle/restart/remove.rs +129 -0
- package/crates/team-agent/src/lifecycle/restart/selection.rs +5 -5
- package/crates/team-agent/src/lifecycle/restart.rs +4 -0
- package/crates/team-agent/src/lifecycle/role_config.rs +79 -27
- package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/agent_ops.rs +8 -12
- package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +37 -240
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +325 -0
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +320 -8
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +329 -70
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +378 -4
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +25 -39
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +7 -11
- package/crates/team-agent/src/lifecycle/tests/core.rs +39 -36
- package/crates/team-agent/src/lifecycle/tests/f032_startup_prompt_best_effort_red.rs +22 -8
- package/crates/team-agent/src/lifecycle/tests/fixtures/pi_native_mcp_host.mjs +2 -1
- package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +15 -133
- package/crates/team-agent/src/lifecycle/tests/harvest2_a_batch_red.rs +60 -20
- package/crates/team-agent/src/lifecycle/tests/host_cotenant_death_p0_contract.rs +30 -67
- package/crates/team-agent/src/lifecycle/tests/issue238_codex_effort_contract.rs +3 -31
- package/crates/team-agent/src/lifecycle/tests/lane_ops.rs +194 -169
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +164 -282
- package/crates/team-agent/src/lifecycle/tests/lifecycle_rollback_red.rs +15 -78
- package/crates/team-agent/src/lifecycle/tests/main_preserved.rs +7 -7
- package/crates/team-agent/src/lifecycle/tests/mcp_tool_name_format_red.rs +6 -6
- package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +75 -69
- package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +2 -10
- package/crates/team-agent/src/lifecycle/tests/pi_catalog_red.rs +18 -6
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +70 -52
- package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +210 -0
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +157 -4
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +526 -10
- package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +1419 -0
- package/crates/team-agent/src/lifecycle/tests/pi_lifecycle_doctor_red.rs +68 -1
- package/crates/team-agent/src/lifecycle/tests/pi_native_mcp_capability_red.rs +34 -12
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +94 -2
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +14 -15
- package/crates/team-agent/src/lifecycle/tests/restart.rs +12 -153
- package/crates/team-agent/src/lifecycle/tests/restart_build_before_destroy_0540_contract.rs +27 -5
- package/crates/team-agent/src/lifecycle/tests/restart_liveness_red.rs +59 -10
- package/crates/team-agent/src/lifecycle/tests/restart_rebind_hotfix_252_red.rs +47 -6
- package/crates/team-agent/src/lifecycle/tests/restart_session_capture_red.rs +3 -1374
- package/crates/team-agent/src/lifecycle/tests/resume_recover_red.rs +27 -10
- package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +7 -7
- package/crates/team-agent/src/lifecycle/tests/subprep_codex_trust_roundtrip_red.rs +67 -313
- package/crates/team-agent/src/lifecycle/tests/swallow_batch4_semantics_red.rs +254 -2
- package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/team_in_team_sibling_quick_start_red.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/team_in_team_state_scope_red.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/team_key_retirement_txn_red.rs +4 -4
- package/crates/team-agent/src/lifecycle/tests/upgrade_compat_0211_red.rs +74 -19
- package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +38 -39
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +51 -88
- package/crates/team-agent/src/lifecycle/tests.rs +3 -4
- package/crates/team-agent/src/lifecycle/types.rs +18 -5
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +43 -50
- package/crates/team-agent/src/mcp_server/readiness.rs +130 -149
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +86 -109
- package/crates/team-agent/src/mcp_server/tests/scoped.rs +21 -31
- package/crates/team-agent/src/mcp_server/tests/send.rs +72 -107
- package/crates/team-agent/src/mcp_server/tests/tools.rs +10 -12
- package/crates/team-agent/src/mcp_server/tools.rs +70 -196
- package/crates/team-agent/src/messaging/delivery.rs +143 -253
- package/crates/team-agent/src/messaging/delivery_consumption_tests.rs +5 -5
- package/crates/team-agent/src/messaging/helpers.rs +1 -19
- package/crates/team-agent/src/messaging/mod.rs +1 -0
- package/crates/team-agent/src/messaging/reminders.rs +316 -0
- package/crates/team-agent/src/messaging/scheduler.rs +7 -1
- package/crates/team-agent/src/messaging/tests/dup_inject.rs +255 -150
- package/crates/team-agent/src/messaging/tests/main_preserved.rs +2 -2
- package/crates/team-agent/src/messaging/tests/runtime.rs +9 -115
- package/crates/team-agent/src/messaging/tests/spine.rs +44 -24
- package/crates/team-agent/src/messaging/tests/wave2.rs +13 -20
- package/crates/team-agent/src/messaging/types.rs +1 -0
- package/crates/team-agent/src/provider/adapter.rs +208 -254
- package/crates/team-agent/src/provider/adapters/claude.rs +78 -0
- package/crates/team-agent/src/provider/adapters/claude_fork.rs +131 -0
- package/crates/team-agent/src/provider/adapters/mod.rs +7 -7
- package/crates/team-agent/src/provider/adapters/pi.rs +106 -0
- package/crates/team-agent/src/provider/classify.rs +1 -66
- package/crates/team-agent/src/provider/model_catalog.rs +201 -13
- package/crates/team-agent/src/provider/session/capture.rs +111 -111
- package/crates/team-agent/src/provider/session/context_fork/claude.rs +123 -0
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +10 -18
- package/crates/team-agent/src/provider/session/context_fork.rs +87 -74
- package/crates/team-agent/src/provider/session/mod.rs +2 -3
- package/crates/team-agent/src/provider/session_scan/claude.rs +523 -0
- package/crates/team-agent/src/provider/session_scan/common.rs +47 -47
- package/crates/team-agent/src/provider/session_scan/pi.rs +34 -1
- package/crates/team-agent/src/provider/session_scan.rs +13 -13
- package/crates/team-agent/src/provider/tests/adapter.rs +127 -121
- package/crates/team-agent/src/provider/tests/classify.rs +0 -53
- package/crates/team-agent/src/provider/tests/command_helpers.rs +11 -19
- package/crates/team-agent/src/provider/tests/idle.rs +13 -19
- package/crates/team-agent/src/provider/types.rs +0 -4
- package/crates/team-agent/src/provider/wire.rs +34 -20
- package/crates/team-agent/src/state/abnormal_watch/tests/mod.rs +1 -1
- package/crates/team-agent/src/state/persist.rs +6 -6
- package/crates/team-agent/src/state/projection.rs +1 -1
- package/crates/team-agent/src/state/repository/tests.rs +2 -2
- package/crates/team-agent/src/test_support/models_timeout_fixture.rs +144 -0
- package/crates/team-agent/src/tmux_backend/tests.rs +0 -151
- package/crates/team-agent/src/tmux_backend.rs +9 -43
- package/package.json +4 -4
- package/skills/team-agent/SKILL.md +7 -8
- package/skills/team-agent/command-coverage.json +15 -1
- package/skills/team-agent/docs/reference/team-agent-operator.md +5 -3
- package/skills/team-agent/references/team-agent-operator.md +5 -3
- package/crates/team-agent/src/lifecycle/launch/grok_per_seat.rs +0 -260
- package/crates/team-agent/src/lifecycle/tests/codex_weak_window_attribution_red.rs +0 -683
- package/crates/team-agent/src/lifecycle/tests/grok_effort_argv_red.rs +0 -247
- package/crates/team-agent/src/lifecycle/tests/grok_mcp_overlay_red.rs +0 -507
- package/crates/team-agent/src/lifecycle/tests/grok_restart_resume_red.rs +0 -300
- package/crates/team-agent/src/provider/adapters/codex.rs +0 -101
- package/crates/team-agent/src/provider/adapters/grok.rs +0 -67
- package/crates/team-agent/src/provider/session/context_fork/codex.rs +0 -514
- package/crates/team-agent/src/provider/session_scan/codex.rs +0 -326
- package/crates/team-agent/src/provider/session_scan/grok.rs +0 -288
|
@@ -40,7 +40,8 @@ fn launch_source() -> String {
|
|
|
40
40
|
|
|
41
41
|
const QS_TEAM_MD: &str =
|
|
42
42
|
"---\nname: quickteam\nobjective: Quick start.\nprovider: codex\n---\n\nQuick-start team.\n";
|
|
43
|
-
pub(super) const QS_VALID_ROLE: &str = "---\nname: implementer\nrole: Implementation Engineer\nprovider:
|
|
43
|
+
pub(super) const QS_VALID_ROLE: &str = "---\nname: implementer\nrole: Implementation Engineer\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nImplement bounded tasks.\n";
|
|
44
|
+
const QS_ROLE_NO_PROVIDER: &str = "---\nname: implementer\nrole: Implementation Engineer\nmodel: gpt-5.5\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nImplement bounded tasks.\n";
|
|
44
45
|
|
|
45
46
|
/// A REAL team dir `<base>/teamdir/{TEAM.md, agents/implementer.md}` — already in team-dir
|
|
46
47
|
/// layout, so quick_start's prepare_quick_start_team returns it as-is and writes the compiled
|
|
@@ -64,30 +65,13 @@ fn quick_start_team_dir_with_roles(role_docs: &[(&str, &str)]) -> PathBuf {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
fn role_doc(id: &str) -> String {
|
|
67
|
-
|
|
68
|
-
"---\nname: {id}\nrole: {id} Worker\nprovider: codex\nmodel: gpt-5.5\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\n{id} worker.\n"
|
|
69
|
-
)
|
|
68
|
+
provider_role_doc(id, "fake", "fake")
|
|
70
69
|
}
|
|
71
70
|
|
|
72
|
-
fn
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
session_id: &str,
|
|
76
|
-
embedded_agent_id: &str,
|
|
77
|
-
) -> PathBuf {
|
|
78
|
-
let path = workspace.join(file_name);
|
|
79
|
-
std::fs::write(
|
|
80
|
-
&path,
|
|
81
|
-
format!(
|
|
82
|
-
"{{\"session_meta\":{{\"payload\":{{\"id\":\"{session_id}\",\"cwd\":\"{}\",\"created_at\":\"{}\"}}}}}}\n\
|
|
83
|
-
{{\"type\":\"turn_context\",\"payload\":{{}}}}\n\
|
|
84
|
-
{{\"type\":\"response_item\",\"payload\":{{\"content\":[{{\"type\":\"input_text\",\"text\":\"You are Team Agent worker `{embedded_agent_id}` with role `fixture`.\"}}]}}}}\n",
|
|
85
|
-
workspace.to_string_lossy(),
|
|
86
|
-
chrono::Utc::now().to_rfc3339()
|
|
87
|
-
),
|
|
71
|
+
fn provider_role_doc(id: &str, provider: &str, model: &str) -> String {
|
|
72
|
+
format!(
|
|
73
|
+
"---\nname: {id}\nrole: {id} Worker\nprovider: {provider}\nmodel: {model}\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\n{id} worker.\n"
|
|
88
74
|
)
|
|
89
|
-
.unwrap();
|
|
90
|
-
path
|
|
91
75
|
}
|
|
92
76
|
|
|
93
77
|
fn layout_pane(
|
|
@@ -103,7 +87,7 @@ fn layout_pane(
|
|
|
103
87
|
window_name: Some(crate::transport::WindowName::new(window)),
|
|
104
88
|
pane_index: Some(pane_index),
|
|
105
89
|
tty: None,
|
|
106
|
-
current_command: Some("
|
|
90
|
+
current_command: Some("team-agent".to_string()),
|
|
107
91
|
current_path: None,
|
|
108
92
|
active: pane_index == 0,
|
|
109
93
|
pane_pid: None,
|
|
@@ -158,7 +142,7 @@ fn unowned_running_ws() -> PathBuf {
|
|
|
158
142
|
&ws,
|
|
159
143
|
&json!({
|
|
160
144
|
"session_name": "team-x",
|
|
161
|
-
"agents": { "w1": { "provider": "
|
|
145
|
+
"agents": { "w1": { "provider": "fake", "role": "Worker", "model": "fake", "auth_mode": "subscription" } },
|
|
162
146
|
}),
|
|
163
147
|
)
|
|
164
148
|
.unwrap();
|
|
@@ -475,23 +459,25 @@ fn quick_start_default_workspace_compiled_spec_uses_project_root() {
|
|
|
475
459
|
);
|
|
476
460
|
}
|
|
477
461
|
|
|
478
|
-
//
|
|
479
|
-
//
|
|
480
|
-
|
|
462
|
+
// P0 — quick_start over an INVALID role doc (missing `provider`) must surface the REAL compile
|
|
463
|
+
// error, distinct from the stub's hardcoded "no role docs found". Golden: compile_team raises
|
|
464
|
+
// "missing front matter field provider" (compiler.py:_validate_role_doc), before preflight.
|
|
481
465
|
#[test]
|
|
482
|
-
fn
|
|
483
|
-
let team = quick_start_team_dir(
|
|
484
|
-
|
|
466
|
+
fn quick_start_invalid_role_doc_surfaces_real_compile_error() {
|
|
467
|
+
let team = quick_start_team_dir(QS_ROLE_NO_PROVIDER);
|
|
468
|
+
let transport = OfflineTransport::new();
|
|
469
|
+
let result = quick_start_with_transport(&team, None, true, None, &transport);
|
|
470
|
+
|
|
471
|
+
let text = format!("{result:?}");
|
|
472
|
+
assert!(
|
|
473
|
+
text.contains("provider"),
|
|
474
|
+
"an invalid role doc (missing provider) must surface the real compile error mentioning \
|
|
475
|
+
'provider'; got {text}"
|
|
476
|
+
);
|
|
477
|
+
assert!(
|
|
478
|
+
!text.contains("no role docs found"),
|
|
479
|
+
"must NOT be the hardcoded stub blocker — real preflight/compile distinguishes the cause"
|
|
485
480
|
);
|
|
486
|
-
let spec = crate::compiler::compile_team(&team).expect("an omitted provider is the default pi");
|
|
487
|
-
let providers = spec
|
|
488
|
-
.get("agents")
|
|
489
|
-
.and_then(crate::model::yaml::Value::as_list)
|
|
490
|
-
.expect("compiled agents")
|
|
491
|
-
.iter()
|
|
492
|
-
.map(|agent| agent.get("provider").and_then(crate::model::yaml::Value::as_str))
|
|
493
|
-
.collect::<Vec<_>>();
|
|
494
|
-
assert_eq!(providers, vec![Some("pi_tui")]);
|
|
495
481
|
}
|
|
496
482
|
|
|
497
483
|
// P0 — launch (dry_run) over a real compiled spec must resolve the REAL route/permission plan
|
|
@@ -567,7 +553,7 @@ fn add_agent_proceeds_past_owner_gate_and_reaches_recompile() {
|
|
|
567
553
|
let role = ws.join("w2-role.md");
|
|
568
554
|
std::fs::write(
|
|
569
555
|
&role,
|
|
570
|
-
"---\nname: w2\nrole: Second Worker\nprovider:
|
|
556
|
+
"---\nname: w2\nrole: Second Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nSecond worker.\n",
|
|
571
557
|
)
|
|
572
558
|
.unwrap();
|
|
573
559
|
let transport = OfflineTransport::new();
|
|
@@ -712,7 +698,7 @@ fn unowned_running_ws_all_paused() -> PathBuf {
|
|
|
712
698
|
&ws,
|
|
713
699
|
&json!({
|
|
714
700
|
"session_name": "team-x",
|
|
715
|
-
"agents": { "w1": { "provider": "
|
|
701
|
+
"agents": { "w1": { "provider": "fake", "role": "Worker", "model": "fake", "auth_mode": "subscription", "status": "paused" } },
|
|
716
702
|
}),
|
|
717
703
|
)
|
|
718
704
|
.unwrap();
|
|
@@ -784,7 +770,7 @@ fn spine_add_agent_rejects_duplicate_agent_id() {
|
|
|
784
770
|
&json!({
|
|
785
771
|
"session_name": "team-quickteam",
|
|
786
772
|
"agents": {
|
|
787
|
-
"implementer": {"status": "running", "provider": "
|
|
773
|
+
"implementer": {"status": "running", "provider": "fake", "window": "implementer"}
|
|
788
774
|
}
|
|
789
775
|
}),
|
|
790
776
|
)
|
|
@@ -816,7 +802,7 @@ fn e5_add_agent_does_not_copy_role_into_platform_dir_and_injects_into_spec() {
|
|
|
816
802
|
seed_canonical_team_identity(&team, "teamdir");
|
|
817
803
|
// External role file OUTSIDE team_dir/agents, with recognizable body content.
|
|
818
804
|
let role = team.parent().unwrap().join("w2-external-role.md");
|
|
819
|
-
let role_body = "---\nname: w2\nrole: Second Worker\nprovider:
|
|
805
|
+
let role_body = "---\nname: w2\nrole: Second Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nUNIQUE-E5-BUG1-MARKER body for w2.\n";
|
|
820
806
|
std::fs::write(&role, role_body).unwrap();
|
|
821
807
|
let transport = OfflineTransport::new();
|
|
822
808
|
// The spawn may not complete under OfflineTransport; we only assert the no-copy + spec-inject
|
|
@@ -856,7 +842,7 @@ fn e5_restart_rebuilds_runtime_spec_from_role_docs() {
|
|
|
856
842
|
// Edit a role doc AFTER initial compile: change alpha's role text.
|
|
857
843
|
std::fs::write(
|
|
858
844
|
ws.join("agents").join("alpha.md"),
|
|
859
|
-
"---\nname: alpha\nrole: RENAMED Alpha Role\nprovider:
|
|
845
|
+
"---\nname: alpha\nrole: RENAMED Alpha Role\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nAlpha edited.\n",
|
|
860
846
|
)
|
|
861
847
|
.unwrap();
|
|
862
848
|
let transport = OfflineTransport::new();
|
|
@@ -947,7 +933,7 @@ fn red2still_entry_gate_resolves_parent_dot_team_form_a() {
|
|
|
947
933
|
&base,
|
|
948
934
|
&json!({"session_name": "team-teamdir", "team_dir": team_dir.to_string_lossy(),
|
|
949
935
|
"spec_path": runtime_spec.to_string_lossy(),
|
|
950
|
-
"agents": {"w1": {"status": "running", "provider": "
|
|
936
|
+
"agents": {"w1": {"status": "running", "provider": "fake"}}}),
|
|
951
937
|
)
|
|
952
938
|
.unwrap();
|
|
953
939
|
// Entry gate on team_dir: raw team_dir has NO .team (it's in parent), but resolved → base has it.
|
|
@@ -992,7 +978,7 @@ fn red2still_entry_gate_same_dir_dot_team_form_b() {
|
|
|
992
978
|
&team_dir,
|
|
993
979
|
&json!({"session_name": "team-tb", "team_dir": team_dir.to_string_lossy(),
|
|
994
980
|
"spec_path": runtime_spec.to_string_lossy(),
|
|
995
|
-
"agents": {"w1": {"status": "running", "provider": "
|
|
981
|
+
"agents": {"w1": {"status": "running", "provider": "fake"}}}),
|
|
996
982
|
)
|
|
997
983
|
.unwrap();
|
|
998
984
|
let transport = OfflineTransport::new();
|
|
@@ -1081,7 +1067,7 @@ fn e5_add_agent_resolves_team_dir_to_role_dir_when_runtime_spec_exists() {
|
|
|
1081
1067
|
let role = team.join("w2-role.md");
|
|
1082
1068
|
std::fs::write(
|
|
1083
1069
|
&role,
|
|
1084
|
-
"---\nname: w2\nrole: Second Worker\nprovider:
|
|
1070
|
+
"---\nname: w2\nrole: Second Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nw2.\n",
|
|
1085
1071
|
)
|
|
1086
1072
|
.unwrap();
|
|
1087
1073
|
let transport = OfflineTransport::new();
|
|
@@ -1194,7 +1180,7 @@ fn spawn_launch_not_dry_run_is_no_longer_the_spawn_stub() {
|
|
|
1194
1180
|
// real-machine test above.
|
|
1195
1181
|
#[test]
|
|
1196
1182
|
fn launch_with_transport_records_one_spawn_per_agent_carrying_build_command() {
|
|
1197
|
-
let team = quick_start_team_dir(QS_VALID_ROLE); // one agent: implementer / provider
|
|
1183
|
+
let team = quick_start_team_dir(QS_VALID_ROLE); // one agent: implementer / provider fake
|
|
1198
1184
|
let spec_path = compiled_spec_path(&team);
|
|
1199
1185
|
let transport = OfflineTransport::new();
|
|
1200
1186
|
|
|
@@ -1223,8 +1209,8 @@ fn launch_with_transport_records_one_spawn_per_agent_carrying_build_command() {
|
|
|
1223
1209
|
assert!(
|
|
1224
1210
|
recorded
|
|
1225
1211
|
.iter()
|
|
1226
|
-
.any(|(_, argv)| argv.iter().any(|a| a == "
|
|
1227
|
-
"each spawn argv must carry the agent's provider build_command (
|
|
1212
|
+
.any(|(_, argv)| argv.iter().any(|a| a == "fake-worker")),
|
|
1213
|
+
"each spawn argv must carry the agent's provider build_command (fake-worker); got {recorded:?}"
|
|
1228
1214
|
);
|
|
1229
1215
|
assert!(
|
|
1230
1216
|
report
|
|
@@ -1347,7 +1333,7 @@ fn seed_canonical_team_identity(workspace: &std::path::Path, team_key: &str) {
|
|
|
1347
1333
|
#[serial(env)]
|
|
1348
1334
|
fn quick_start_with_transport_spawns_workers_not_dry_run() {
|
|
1349
1335
|
let _hermetic = hermetic_guard::HermeticTestEnv::enter_with_leader("launch-spawn-spawn-path");
|
|
1350
|
-
let team = quick_start_team_dir(QS_VALID_ROLE); // one agent: implementer / provider
|
|
1336
|
+
let team = quick_start_team_dir(QS_VALID_ROLE); // one agent: implementer / provider fake
|
|
1351
1337
|
let workspace = team.parent().expect("team_workspace(team_dir) = parent"); // where start_coordinator runs
|
|
1352
1338
|
seed_healthy_coordinator(workspace);
|
|
1353
1339
|
let transport = OfflineTransport::new();
|
|
@@ -1392,8 +1378,8 @@ fn quick_start_with_transport_spawns_workers_not_dry_run() {
|
|
|
1392
1378
|
assert!(
|
|
1393
1379
|
recorded
|
|
1394
1380
|
.iter()
|
|
1395
|
-
.any(|(_, argv)| argv.iter().any(|a| a == "
|
|
1396
|
-
"the spawn argv must carry the agent's provider build_command (
|
|
1381
|
+
.any(|(_, argv)| argv.iter().any(|a| a == "fake-worker")),
|
|
1382
|
+
"the spawn argv must carry the agent's provider build_command (fake-worker); got {recorded:?}"
|
|
1397
1383
|
);
|
|
1398
1384
|
}
|
|
1399
1385
|
|
|
@@ -1727,36 +1713,74 @@ fn quick_start_fresh_ws_spawns_resident_tmux_and_coordinator() {
|
|
|
1727
1713
|
// Golden: restart/orchestration.py (Route-B resume spawn), lifecycle/start.py, lifecycle/operations.py.
|
|
1728
1714
|
// ═════════════════════════════════════════════════════════════════════════
|
|
1729
1715
|
|
|
1730
|
-
pub(super) const DELEG_ROLE_ALPHA: &str = "---\nname: alpha\nrole: Alpha Worker\nprovider:
|
|
1731
|
-
pub(super) const DELEG_ROLE_BRAVO: &str = "---\nname: bravo\nrole: Bravo Worker\nprovider:
|
|
1732
|
-
const DELEG_ROLE_WORKER2: &str = "---\nname: worker2\nrole: Second Worker\nprovider:
|
|
1716
|
+
pub(super) const DELEG_ROLE_ALPHA: &str = "---\nname: alpha\nrole: Alpha Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nAlpha.\n";
|
|
1717
|
+
pub(super) const DELEG_ROLE_BRAVO: &str = "---\nname: bravo\nrole: Bravo Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nBravo.\n";
|
|
1718
|
+
const DELEG_ROLE_WORKER2: &str = "---\nname: worker2\nrole: Second Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nSecond worker.\n";
|
|
1733
1719
|
|
|
1734
1720
|
/// A workspace (= self-contained team dir) with a compiled 2-agent spec + state listing alpha/bravo as
|
|
1735
|
-
///
|
|
1721
|
+
/// running `fake` workers that were never captured (no session_id / first_send_at), so restart and
|
|
1722
|
+
/// start-agent fresh-spawn them without --allow-fresh (fake has no resume) + a seeded HEALTHY
|
|
1723
|
+
/// coordinator. Resume-path tests use [`restart_ws_two_copilot_resumable_workers`].
|
|
1736
1724
|
pub(super) fn restart_ws_two_resumable_workers() -> PathBuf {
|
|
1725
|
+
restart_team_ws(
|
|
1726
|
+
&[("alpha", DELEG_ROLE_ALPHA.to_string()), ("bravo", DELEG_ROLE_BRAVO.to_string())],
|
|
1727
|
+
json!({
|
|
1728
|
+
"alpha": {"status": "running", "provider": "fake"},
|
|
1729
|
+
"bravo": {"status": "running", "provider": "fake"}
|
|
1730
|
+
}),
|
|
1731
|
+
)
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
/// Same team as [`restart_ws_two_resumable_workers`], but alpha/bravo are Copilot workers whose
|
|
1735
|
+
/// session ids exist in `<home>/.copilot/session-store.db` (the Copilot resume backing), so restart
|
|
1736
|
+
/// takes the Route-B RESUME path. The caller holds `#[serial(env)]` with `HOME=<home>`.
|
|
1737
|
+
pub(super) fn restart_ws_two_copilot_resumable_workers(home: &std::path::Path) -> PathBuf {
|
|
1738
|
+
seed_copilot_session_store(home, &["sess-a", "sess-b"]);
|
|
1739
|
+
restart_team_ws(
|
|
1740
|
+
&[
|
|
1741
|
+
("alpha", provider_role_doc("alpha", "copilot", "gpt-5.5")),
|
|
1742
|
+
("bravo", provider_role_doc("bravo", "copilot", "gpt-5.5")),
|
|
1743
|
+
],
|
|
1744
|
+
json!({
|
|
1745
|
+
"alpha": {"status": "running", "provider": "copilot", "session_id": "sess-a", "first_send_at": "2026-05-27T10:00:00+00:00"},
|
|
1746
|
+
"bravo": {"status": "running", "provider": "copilot", "session_id": "sess-b", "first_send_at": "2026-05-27T10:00:00+00:00"}
|
|
1747
|
+
}),
|
|
1748
|
+
)
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
/// Copilot resume backing is a `sessions` row in `$HOME/.copilot/session-store.db`.
|
|
1752
|
+
pub(super) fn seed_copilot_session_store(home: &std::path::Path, session_ids: &[&str]) {
|
|
1753
|
+
let db = home.join(".copilot").join("session-store.db");
|
|
1754
|
+
std::fs::create_dir_all(db.parent().unwrap()).unwrap();
|
|
1755
|
+
let conn = rusqlite::Connection::open(db).unwrap();
|
|
1756
|
+
conn.execute_batch("create table if not exists sessions (id text primary key);").unwrap();
|
|
1757
|
+
for session_id in session_ids {
|
|
1758
|
+
conn.execute(
|
|
1759
|
+
"insert or replace into sessions(id) values (?1)",
|
|
1760
|
+
[*session_id],
|
|
1761
|
+
)
|
|
1762
|
+
.unwrap();
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
fn restart_team_ws(roles: &[(&str, String)], agents: serde_json::Value) -> PathBuf {
|
|
1737
1767
|
let ws = temp_ws().join("restartteam");
|
|
1738
1768
|
std::fs::create_dir_all(ws.join("agents")).unwrap();
|
|
1739
|
-
let alpha_rollout = ws.join("alpha-rollout.jsonl");
|
|
1740
|
-
let bravo_rollout = ws.join("bravo-rollout.jsonl");
|
|
1741
|
-
std::fs::write(&alpha_rollout, "{}\n").unwrap();
|
|
1742
|
-
std::fs::write(&bravo_rollout, "{}\n").unwrap();
|
|
1743
1769
|
std::fs::write(
|
|
1744
1770
|
ws.join("TEAM.md"),
|
|
1745
1771
|
"---\nname: restartteam\nobjective: Restart probe.\nprovider: codex\n---\n\nteam.\n",
|
|
1746
1772
|
)
|
|
1747
1773
|
.unwrap();
|
|
1748
|
-
|
|
1749
|
-
|
|
1774
|
+
for (id, doc) in roles {
|
|
1775
|
+
std::fs::write(ws.join("agents").join(format!("{id}.md")), doc).unwrap();
|
|
1776
|
+
}
|
|
1750
1777
|
let spec = crate::compiler::compile_team(&ws).expect("compile 2-agent team");
|
|
1751
1778
|
std::fs::write(ws.join("team.spec.yaml"), crate::model::yaml::dumps(&spec)).unwrap();
|
|
1752
1779
|
crate::state::persist::save_runtime_state(
|
|
1753
1780
|
&ws,
|
|
1754
1781
|
&json!({
|
|
1755
1782
|
"session_name": "team-restartteam",
|
|
1756
|
-
"agents":
|
|
1757
|
-
"alpha": {"status": "running", "provider": "codex", "session_id": "sess-a", "rollout_path": alpha_rollout.to_string_lossy(), "first_send_at": "2026-05-27T10:00:00+00:00"},
|
|
1758
|
-
"bravo": {"status": "running", "provider": "codex", "session_id": "sess-b", "rollout_path": bravo_rollout.to_string_lossy(), "first_send_at": "2026-05-27T10:00:00+00:00"}
|
|
1759
|
-
}
|
|
1783
|
+
"agents": agents
|
|
1760
1784
|
}),
|
|
1761
1785
|
)
|
|
1762
1786
|
.unwrap();
|
|
@@ -1767,8 +1791,6 @@ pub(super) fn restart_ws_two_resumable_workers() -> PathBuf {
|
|
|
1767
1791
|
fn restart_ws_one_resumable_worker() -> PathBuf {
|
|
1768
1792
|
let ws = temp_ws().join("restartone");
|
|
1769
1793
|
std::fs::create_dir_all(ws.join("agents")).unwrap();
|
|
1770
|
-
let rollout = ws.join("alpha-rollout.jsonl");
|
|
1771
|
-
std::fs::write(&rollout, "{}\n").unwrap();
|
|
1772
1794
|
std::fs::write(
|
|
1773
1795
|
ws.join("TEAM.md"),
|
|
1774
1796
|
"---\nname: restartone\nobjective: Restart readiness probe.\nprovider: codex\n---\n\nteam.\n",
|
|
@@ -1782,7 +1804,7 @@ fn restart_ws_one_resumable_worker() -> PathBuf {
|
|
|
1782
1804
|
&json!({
|
|
1783
1805
|
"session_name": "team-restartone",
|
|
1784
1806
|
"agents": {
|
|
1785
|
-
"alpha": {"status": "running", "provider": "
|
|
1807
|
+
"alpha": {"status": "running", "provider": "fake"}
|
|
1786
1808
|
}
|
|
1787
1809
|
}),
|
|
1788
1810
|
)
|
|
@@ -1794,10 +1816,13 @@ fn restart_ws_one_resumable_worker() -> PathBuf {
|
|
|
1794
1816
|
// 2 [P0] — restart_with_transport must drive the REAL Route-B resume spawn: one spawn per resumable
|
|
1795
1817
|
// worker. The first resumed worker recreates the session with spawn_first; later workers may use
|
|
1796
1818
|
// spawn_into only after a live-session check proves that recreated session still exists. Each spawn
|
|
1797
|
-
// carries the provider
|
|
1819
|
+
// carries the provider resume command, and the coordinator is started. Copilot is the resumable
|
|
1820
|
+
// legacy provider; its backing is the hermetic HOME session store.
|
|
1798
1821
|
#[test]
|
|
1822
|
+
#[serial(env)]
|
|
1799
1823
|
fn restart_with_transport_spawns_resumable_workers_not_stub() {
|
|
1800
|
-
let
|
|
1824
|
+
let hermetic = enter_hermetic("launch-spawn-restart-resume");
|
|
1825
|
+
let ws = restart_ws_two_copilot_resumable_workers(hermetic.home());
|
|
1801
1826
|
let mut state = crate::state::persist::load_runtime_state(&ws).unwrap();
|
|
1802
1827
|
state["generation"] = json!("old-destroyed-session-birth");
|
|
1803
1828
|
crate::state::persist::save_runtime_state(&ws, &state).unwrap();
|
|
@@ -1821,8 +1846,9 @@ fn restart_with_transport_spawns_resumable_workers_not_stub() {
|
|
|
1821
1846
|
"with has-session=true after alpha spawn, restart may add bravo with spawn_into; this is liveness-based, not index-based; got {recorded:?}"
|
|
1822
1847
|
);
|
|
1823
1848
|
assert!(
|
|
1824
|
-
recorded.iter().all(|(_, argv)| argv.iter().any(|a| a == "
|
|
1825
|
-
|
|
1849
|
+
recorded.iter().all(|(_, argv)| argv.iter().any(|a| a == "copilot")
|
|
1850
|
+
&& argv.iter().any(|a| a == "--resume")),
|
|
1851
|
+
"each resumed worker's spawn argv must carry the provider resume command (copilot --resume); got {recorded:?}"
|
|
1826
1852
|
);
|
|
1827
1853
|
assert!(
|
|
1828
1854
|
matches!(result, Ok(RestartReport::Restarted { coordinator_started: true, .. })),
|
|
@@ -1842,7 +1868,7 @@ fn restart_with_transport_spawns_resumable_workers_not_stub() {
|
|
|
1842
1868
|
.expect("restart.completed event for successful restart");
|
|
1843
1869
|
assert_eq!(completed.get("rc").and_then(|v| v.as_str()), Some("ok"));
|
|
1844
1870
|
|
|
1845
|
-
let ws =
|
|
1871
|
+
let ws = restart_ws_two_copilot_resumable_workers(hermetic.home());
|
|
1846
1872
|
let dead_after_first = OfflineTransport::new().with_session_absent_after_spawn_first();
|
|
1847
1873
|
let result = restart_with_transport_with_readiness_deadline(
|
|
1848
1874
|
&ws,
|
|
@@ -1896,8 +1922,6 @@ fn restart_with_transport_spawns_resumable_workers_not_stub() {
|
|
|
1896
1922
|
fn restart_runtime_spec_spawns_from_run_workspace_not_runtime_dir() {
|
|
1897
1923
|
let workspace = temp_ws();
|
|
1898
1924
|
std::fs::create_dir_all(workspace.join("agents")).unwrap();
|
|
1899
|
-
let rollout = workspace.join("alpha-rollout.jsonl");
|
|
1900
|
-
std::fs::write(&rollout, "{}\n").unwrap();
|
|
1901
1925
|
std::fs::write(
|
|
1902
1926
|
workspace.join("TEAM.md"),
|
|
1903
1927
|
"---\nname: current\nobjective: Restart cwd probe.\nprovider: codex\n---\n\nteam.\n",
|
|
@@ -1918,10 +1942,7 @@ fn restart_runtime_spec_spawns_from_run_workspace_not_runtime_dir() {
|
|
|
1918
1942
|
"agents": {
|
|
1919
1943
|
"alpha": {
|
|
1920
1944
|
"status": "running",
|
|
1921
|
-
"provider": "
|
|
1922
|
-
"session_id": "sess-a",
|
|
1923
|
-
"rollout_path": rollout.to_string_lossy(),
|
|
1924
|
-
"first_send_at": "2026-05-27T10:00:00+00:00",
|
|
1945
|
+
"provider": "fake",
|
|
1925
1946
|
"spawn_cwd": null
|
|
1926
1947
|
}
|
|
1927
1948
|
}
|
|
@@ -1935,7 +1956,7 @@ fn restart_runtime_spec_spawns_from_run_workspace_not_runtime_dir() {
|
|
|
1935
1956
|
|
|
1936
1957
|
assert!(
|
|
1937
1958
|
matches!(result, Ok(RestartReport::Restarted { .. })),
|
|
1938
|
-
"restart should succeed for a
|
|
1959
|
+
"restart should succeed for a never-captured project-root team: {result:?}"
|
|
1939
1960
|
);
|
|
1940
1961
|
assert_eq!(
|
|
1941
1962
|
transport.spawn_cwd_records(),
|
|
@@ -1978,7 +1999,9 @@ fn restart_runtime_spec_spawns_from_run_workspace_not_runtime_dir() {
|
|
|
1978
1999
|
}
|
|
1979
2000
|
|
|
1980
2001
|
#[test]
|
|
2002
|
+
#[serial(env)]
|
|
1981
2003
|
fn restart_allow_fresh_does_not_force_fresh_other_agents_when_one_session_capture_times_out() {
|
|
2004
|
+
let hermetic = enter_hermetic("launch-spawn-restart-atomic");
|
|
1982
2005
|
let ws = temp_ws().join("restartatomic");
|
|
1983
2006
|
std::fs::create_dir_all(ws.join("agents")).unwrap();
|
|
1984
2007
|
std::fs::write(
|
|
@@ -1986,19 +2009,22 @@ fn restart_allow_fresh_does_not_force_fresh_other_agents_when_one_session_captur
|
|
|
1986
2009
|
"---\nname: restartatomic\nobjective: Restart atomicity probe.\nprovider: codex\n---\n\nteam.\n",
|
|
1987
2010
|
)
|
|
1988
2011
|
.unwrap();
|
|
1989
|
-
std::fs::write(ws.join("agents").join("alpha.md"), DELEG_ROLE_ALPHA).unwrap();
|
|
1990
|
-
std::fs::write(ws.join("agents").join("bravo.md"), DELEG_ROLE_BRAVO).unwrap();
|
|
1991
|
-
|
|
1992
|
-
let sessions_root = ws.join("codex-sessions");
|
|
1993
|
-
let dated = sessions_root.join("2026").join("06").join("20");
|
|
1994
|
-
std::fs::create_dir_all(&dated).unwrap();
|
|
1995
|
-
let alpha_session = "019ee540-37ed-7a20-a141-1d654224d209";
|
|
1996
2012
|
std::fs::write(
|
|
1997
|
-
|
|
1998
|
-
"
|
|
2013
|
+
ws.join("agents").join("alpha.md"),
|
|
2014
|
+
provider_role_doc("alpha", "copilot", "gpt-5.5"),
|
|
2015
|
+
)
|
|
2016
|
+
.unwrap();
|
|
2017
|
+
std::fs::write(
|
|
2018
|
+
ws.join("agents").join("bravo.md"),
|
|
2019
|
+
provider_role_doc("bravo", "copilot", "gpt-5.5"),
|
|
1999
2020
|
)
|
|
2000
2021
|
.unwrap();
|
|
2001
2022
|
|
|
2023
|
+
// alpha's resume backing is its Copilot session-store row; bravo has none, so only bravo's
|
|
2024
|
+
// session convergence times out.
|
|
2025
|
+
let alpha_session = "019ee540-37ed-7a20-a141-1d654224d209";
|
|
2026
|
+
seed_copilot_session_store(hermetic.home(), &[alpha_session]);
|
|
2027
|
+
|
|
2002
2028
|
let spec = crate::compiler::compile_team(&ws).expect("compile restart team");
|
|
2003
2029
|
std::fs::write(ws.join("team.spec.yaml"), crate::model::yaml::dumps(&spec)).unwrap();
|
|
2004
2030
|
crate::state::persist::save_runtime_state(
|
|
@@ -2008,15 +2034,13 @@ fn restart_allow_fresh_does_not_force_fresh_other_agents_when_one_session_captur
|
|
|
2008
2034
|
"agents": {
|
|
2009
2035
|
"alpha": {
|
|
2010
2036
|
"status": "running",
|
|
2011
|
-
"provider": "
|
|
2037
|
+
"provider": "copilot",
|
|
2012
2038
|
"session_id": alpha_session,
|
|
2013
|
-
"rollout_path": ws.join("stale").join("missing-alpha.jsonl").to_string_lossy(),
|
|
2014
|
-
"codex_sessions_root": sessions_root.to_string_lossy(),
|
|
2015
2039
|
"first_send_at": "2026-05-27T10:00:00+00:00"
|
|
2016
2040
|
},
|
|
2017
2041
|
"bravo": {
|
|
2018
2042
|
"status": "running",
|
|
2019
|
-
"provider": "
|
|
2043
|
+
"provider": "copilot",
|
|
2020
2044
|
"session_id": null,
|
|
2021
2045
|
"spawn_cwd": ws.to_string_lossy(),
|
|
2022
2046
|
"first_send_at": "2026-05-27T10:00:00+00:00"
|
|
@@ -2055,7 +2079,7 @@ fn restart_allow_fresh_does_not_force_fresh_other_agents_when_one_session_captur
|
|
|
2055
2079
|
assert_eq!(
|
|
2056
2080
|
alpha.get("decision").and_then(|v| v.as_str()),
|
|
2057
2081
|
Some("resume"),
|
|
2058
|
-
"alpha has session_id plus matching
|
|
2082
|
+
"alpha has session_id plus a matching Copilot session-store row and must not be forced fresh: {alpha}"
|
|
2059
2083
|
);
|
|
2060
2084
|
assert!(
|
|
2061
2085
|
alpha.get("forced_fresh").is_none(),
|
|
@@ -2076,153 +2100,6 @@ fn restart_allow_fresh_does_not_force_fresh_other_agents_when_one_session_captur
|
|
|
2076
2100
|
);
|
|
2077
2101
|
}
|
|
2078
2102
|
|
|
2079
|
-
#[test]
|
|
2080
|
-
fn restart_allow_fresh_clears_codex_identity_mismatch_tuple_before_capture() {
|
|
2081
|
-
let ws = temp_ws().join("restartcrossbindallowfresh");
|
|
2082
|
-
std::fs::create_dir_all(ws.join("agents")).unwrap();
|
|
2083
|
-
std::fs::write(
|
|
2084
|
-
ws.join("TEAM.md"),
|
|
2085
|
-
"---\nname: restartcrossbindallowfresh\nobjective: Restart crossbind repair.\nprovider: codex\n---\n\nteam.\n",
|
|
2086
|
-
)
|
|
2087
|
-
.unwrap();
|
|
2088
|
-
std::fs::write(ws.join("agents").join("alpha.md"), DELEG_ROLE_ALPHA).unwrap();
|
|
2089
|
-
std::fs::write(ws.join("agents").join("bravo.md"), DELEG_ROLE_BRAVO).unwrap();
|
|
2090
|
-
let alpha_session = "019f3586-6eb4-7552-8680-c833b483a289";
|
|
2091
|
-
let alpha_rollout = codex_identity_rollout(&ws, "alpha-rollout.jsonl", alpha_session, "alpha");
|
|
2092
|
-
let spec = crate::compiler::compile_team(&ws).expect("compile crossbind team");
|
|
2093
|
-
std::fs::write(ws.join("team.spec.yaml"), crate::model::yaml::dumps(&spec)).unwrap();
|
|
2094
|
-
crate::state::persist::save_runtime_state(
|
|
2095
|
-
&ws,
|
|
2096
|
-
&json!({
|
|
2097
|
-
"session_name": "team-restartcrossbindallowfresh",
|
|
2098
|
-
"agents": {
|
|
2099
|
-
"alpha": {
|
|
2100
|
-
"status": "running",
|
|
2101
|
-
"provider": "codex",
|
|
2102
|
-
"window": "alpha",
|
|
2103
|
-
"first_send_at": "2026-07-06T03:45:00+00:00",
|
|
2104
|
-
"session_id": alpha_session,
|
|
2105
|
-
"rollout_path": alpha_rollout.to_string_lossy(),
|
|
2106
|
-
"captured_at": "2026-07-06T03:45:13.596763+00:00",
|
|
2107
|
-
"captured_via": "fs_watch",
|
|
2108
|
-
"attribution_confidence": "high",
|
|
2109
|
-
"spawn_cwd": ws.to_string_lossy()
|
|
2110
|
-
},
|
|
2111
|
-
"bravo": {
|
|
2112
|
-
"status": "running",
|
|
2113
|
-
"provider": "codex",
|
|
2114
|
-
"window": "bravo",
|
|
2115
|
-
"first_send_at": "2026-07-06T03:45:00+00:00",
|
|
2116
|
-
"session_id": alpha_session,
|
|
2117
|
-
"rollout_path": alpha_rollout.to_string_lossy(),
|
|
2118
|
-
"captured_at": "2026-07-06T03:45:13.596763+00:00",
|
|
2119
|
-
"captured_via": "fs_watch",
|
|
2120
|
-
"attribution_confidence": "high",
|
|
2121
|
-
"spawn_cwd": ws.to_string_lossy()
|
|
2122
|
-
}
|
|
2123
|
-
}
|
|
2124
|
-
}),
|
|
2125
|
-
)
|
|
2126
|
-
.unwrap();
|
|
2127
|
-
seed_healthy_coordinator(&ws);
|
|
2128
|
-
let transport = OfflineTransport::new();
|
|
2129
|
-
|
|
2130
|
-
let result = restart_with_transport(&ws, true, None, &transport);
|
|
2131
|
-
|
|
2132
|
-
assert!(
|
|
2133
|
-
matches!(result, Ok(RestartReport::Restarted { .. })),
|
|
2134
|
-
"allow-fresh restart should repair by fresh-spawning only poisoned bravo; got {result:?}"
|
|
2135
|
-
);
|
|
2136
|
-
let windows = transport.spawn_window_records();
|
|
2137
|
-
let records = transport.spawn_records();
|
|
2138
|
-
let bravo_idx = windows
|
|
2139
|
-
.iter()
|
|
2140
|
-
.position(|(_, window)| window == "bravo")
|
|
2141
|
-
.expect("bravo must spawn");
|
|
2142
|
-
assert!(
|
|
2143
|
-
!records[bravo_idx].1.iter().any(|arg| arg == "resume"),
|
|
2144
|
-
"poisoned bravo must fresh-start without codex resume argv; records={records:?}"
|
|
2145
|
-
);
|
|
2146
|
-
|
|
2147
|
-
let mut state = crate::state::persist::load_runtime_state(&ws).expect("load state");
|
|
2148
|
-
let bravo = state.pointer("/agents/bravo").expect("bravo");
|
|
2149
|
-
for field in [
|
|
2150
|
-
"session_id",
|
|
2151
|
-
"rollout_path",
|
|
2152
|
-
"captured_at",
|
|
2153
|
-
"captured_via",
|
|
2154
|
-
"attribution_confidence",
|
|
2155
|
-
"capture_state",
|
|
2156
|
-
] {
|
|
2157
|
-
let value = bravo.get(field);
|
|
2158
|
-
assert!(
|
|
2159
|
-
value.is_none() || value == Some(&serde_json::Value::Null),
|
|
2160
|
-
"allow-fresh must clear poisoned bravo {field}; got {value:?} in {bravo}"
|
|
2161
|
-
);
|
|
2162
|
-
}
|
|
2163
|
-
if let Some(teams) = state.get("teams").and_then(serde_json::Value::as_object) {
|
|
2164
|
-
for (team_key, team_state) in teams {
|
|
2165
|
-
if let Some(team_bravo) = team_state.pointer("/agents/bravo") {
|
|
2166
|
-
for field in [
|
|
2167
|
-
"session_id",
|
|
2168
|
-
"rollout_path",
|
|
2169
|
-
"captured_at",
|
|
2170
|
-
"captured_via",
|
|
2171
|
-
"attribution_confidence",
|
|
2172
|
-
"capture_state",
|
|
2173
|
-
] {
|
|
2174
|
-
let value = team_bravo.get(field);
|
|
2175
|
-
assert!(
|
|
2176
|
-
value.is_none() || value == Some(&serde_json::Value::Null),
|
|
2177
|
-
"allow-fresh must clear teams.{team_key}.agents.bravo {field}; got {value:?} in {team_bravo}"
|
|
2178
|
-
);
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
|
|
2184
|
-
let fresh_session = "019f3587-bravo-fresh";
|
|
2185
|
-
let fresh_rollout =
|
|
2186
|
-
codex_identity_rollout(&ws, "bravo-fresh-rollout.jsonl", fresh_session, "bravo");
|
|
2187
|
-
let mut adapter_for = |provider| crate::provider::adapter::get_adapter(provider);
|
|
2188
|
-
crate::provider::session::capture::capture_missing_provider_sessions_once(
|
|
2189
|
-
&mut state,
|
|
2190
|
-
&mut adapter_for,
|
|
2191
|
-
true,
|
|
2192
|
-
0,
|
|
2193
|
-
)
|
|
2194
|
-
.expect("fresh bravo capture should run");
|
|
2195
|
-
let bravo = state.pointer("/agents/bravo").expect("bravo after capture");
|
|
2196
|
-
assert_eq!(
|
|
2197
|
-
bravo.get("session_id").and_then(serde_json::Value::as_str),
|
|
2198
|
-
Some(fresh_session),
|
|
2199
|
-
"fresh bravo rollout should be capturable after allow-fresh clears poison; rollout={fresh_rollout:?} state={bravo}"
|
|
2200
|
-
);
|
|
2201
|
-
assert_eq!(
|
|
2202
|
-
bravo
|
|
2203
|
-
.get("rollout_path")
|
|
2204
|
-
.and_then(serde_json::Value::as_str),
|
|
2205
|
-
Some(fresh_rollout.to_string_lossy().as_ref())
|
|
2206
|
-
);
|
|
2207
|
-
let plan = crate::lifecycle::restart::classify_restart_plan_with_resume_validation(
|
|
2208
|
-
Some(&ws),
|
|
2209
|
-
&state,
|
|
2210
|
-
false,
|
|
2211
|
-
)
|
|
2212
|
-
.expect("classify after fresh capture");
|
|
2213
|
-
assert!(
|
|
2214
|
-
plan.unresumable.is_empty(),
|
|
2215
|
-
"next restart must not loop on session_identity_mismatch after fresh capture; got {:?}",
|
|
2216
|
-
plan.unresumable
|
|
2217
|
-
);
|
|
2218
|
-
let bravo_decision = plan
|
|
2219
|
-
.decisions
|
|
2220
|
-
.iter()
|
|
2221
|
-
.find(|decision| decision.agent_id.as_str() == "bravo")
|
|
2222
|
-
.expect("bravo decision");
|
|
2223
|
-
assert_eq!(bravo_decision.decision, ResumeDecision::Resume);
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
2103
|
#[test]
|
|
2227
2104
|
fn restart_spawn_failure_isolated_to_partial_report() {
|
|
2228
2105
|
let ws = restart_ws_two_resumable_workers();
|
|
@@ -2386,19 +2263,21 @@ fn restart_times_out_when_spawned_worker_pane_is_not_addressable() {
|
|
|
2386
2263
|
}
|
|
2387
2264
|
|
|
2388
2265
|
// 3 [P0] — start_agent_with_transport on a non-paused agent with a session_id must spawn EXACTLY ONE
|
|
2389
|
-
// worker (resume) carrying the provider
|
|
2390
|
-
// ZERO spawns -> RED at recorded.len().
|
|
2266
|
+
// worker (resume) carrying the provider resume command. Today the stub returns RequirementUnmet with
|
|
2267
|
+
// ZERO spawns -> RED at recorded.len(). Copilot is the resumable legacy provider; its backing is the
|
|
2268
|
+
// hermetic HOME session store.
|
|
2391
2269
|
#[test]
|
|
2270
|
+
#[serial(env)]
|
|
2392
2271
|
fn start_agent_with_transport_spawns_resume_not_stub() {
|
|
2272
|
+
let hermetic = enter_hermetic("launch-spawn-start-agent-resume");
|
|
2393
2273
|
let ws = temp_ws().join("startagentws");
|
|
2394
2274
|
std::fs::create_dir_all(&ws).unwrap();
|
|
2395
|
-
|
|
2396
|
-
std::fs::write(&rollout, "{}\n").unwrap();
|
|
2275
|
+
seed_copilot_session_store(hermetic.home(), &["sess-a"]);
|
|
2397
2276
|
crate::state::persist::save_runtime_state(
|
|
2398
2277
|
&ws,
|
|
2399
2278
|
&json!({
|
|
2400
2279
|
"session_name": "team-sa",
|
|
2401
|
-
"agents": {"alpha": {"status": "running", "provider": "
|
|
2280
|
+
"agents": {"alpha": {"status": "running", "provider": "copilot", "session_id": "sess-a", "first_send_at": "2026-05-27T10:00:00+00:00"}}
|
|
2402
2281
|
}),
|
|
2403
2282
|
)
|
|
2404
2283
|
.unwrap();
|
|
@@ -2423,8 +2302,12 @@ fn start_agent_with_transport_spawns_resume_not_stub() {
|
|
|
2423
2302
|
with ZERO spawns; got {recorded:?}"
|
|
2424
2303
|
);
|
|
2425
2304
|
assert!(
|
|
2426
|
-
recorded[0].1.iter().any(|a| a == "
|
|
2427
|
-
|
|
2305
|
+
recorded[0].1.iter().any(|a| a == "copilot")
|
|
2306
|
+
&& recorded[0]
|
|
2307
|
+
.1
|
|
2308
|
+
.windows(2)
|
|
2309
|
+
.any(|pair| pair[0] == "--resume" && pair[1] == "sess-a"),
|
|
2310
|
+
"the resume spawn argv must carry the provider resume command (copilot --resume sess-a); got {:?}",
|
|
2428
2311
|
recorded[0].1
|
|
2429
2312
|
);
|
|
2430
2313
|
}
|
|
@@ -2476,8 +2359,8 @@ fn add_agent_with_transport_spawns_new_worker_not_stub() {
|
|
|
2476
2359
|
then returns RequirementUnmet with ZERO spawns; got {recorded:?}"
|
|
2477
2360
|
);
|
|
2478
2361
|
assert!(
|
|
2479
|
-
recorded.iter().any(|(_, argv)| argv.iter().any(|a| a == "
|
|
2480
|
-
"the new worker's spawn argv must carry the provider build_command (
|
|
2362
|
+
recorded.iter().any(|(_, argv)| argv.iter().any(|a| a == "fake-worker")),
|
|
2363
|
+
"the new worker's spawn argv must carry the provider build_command (fake-worker); got {recorded:?}"
|
|
2481
2364
|
);
|
|
2482
2365
|
}
|
|
2483
2366
|
|
|
@@ -2498,7 +2381,7 @@ fn add_agent_role_doc_exists_runtime_missing_succeeds() {
|
|
|
2498
2381
|
&json!({
|
|
2499
2382
|
"session_name": "team-addroledoc",
|
|
2500
2383
|
"agents": {
|
|
2501
|
-
"implementer": {"status": "running", "provider": "
|
|
2384
|
+
"implementer": {"status": "running", "provider": "fake", "window": "implementer"}
|
|
2502
2385
|
}
|
|
2503
2386
|
}),
|
|
2504
2387
|
)
|
|
@@ -2546,7 +2429,7 @@ fn start_agent_runtime_missing_role_doc_exists_no_side_effect() {
|
|
|
2546
2429
|
&json!({
|
|
2547
2430
|
"session_name": "team-startmissing",
|
|
2548
2431
|
"agents": {
|
|
2549
|
-
"implementer": {"status": "running", "provider": "
|
|
2432
|
+
"implementer": {"status": "running", "provider": "fake", "window": "implementer"}
|
|
2550
2433
|
}
|
|
2551
2434
|
}),
|
|
2552
2435
|
)
|
|
@@ -2701,22 +2584,21 @@ fn restart_allow_fresh_copilot_keeps_session_id_null_until_capture_confirms() {
|
|
|
2701
2584
|
let _ = plan; // shape verified above; details depend on classifier internals.
|
|
2702
2585
|
}
|
|
2703
2586
|
|
|
2704
|
-
/// 0.4.6 tuple-atomic contract (audit, line 268):
|
|
2705
|
-
///
|
|
2706
|
-
/// input row had a stale session_id.
|
|
2587
|
+
/// 0.4.6 tuple-atomic contract (audit, line 268): Claude fresh restart
|
|
2588
|
+
/// leaves session_id=null even when input row had a stale session_id.
|
|
2707
2589
|
/// The poisoned-row scenario (Bug 045 release-engineer state).
|
|
2708
2590
|
#[test]
|
|
2709
|
-
fn
|
|
2710
|
-
let ws = temp_ws().join("
|
|
2591
|
+
fn restart_allow_fresh_claude_clears_poisoned_session_id() {
|
|
2592
|
+
let ws = temp_ws().join("restartclaude046");
|
|
2711
2593
|
std::fs::create_dir_all(ws.join("agents")).unwrap();
|
|
2712
2594
|
std::fs::write(
|
|
2713
2595
|
ws.join("TEAM.md"),
|
|
2714
|
-
"---\nname:
|
|
2596
|
+
"---\nname: restartclaude046\nobjective: 0.4.6 contract.\nprovider: claude\n---\n\nteam.\n",
|
|
2715
2597
|
)
|
|
2716
2598
|
.unwrap();
|
|
2717
2599
|
std::fs::write(
|
|
2718
2600
|
ws.join("agents").join("alpha.md"),
|
|
2719
|
-
"---\nname: alpha\nrole: Alpha\nprovider:
|
|
2601
|
+
"---\nname: alpha\nrole: Alpha\nprovider: claude\nmodel: sonnet\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nAlpha.\n",
|
|
2720
2602
|
)
|
|
2721
2603
|
.unwrap();
|
|
2722
2604
|
let spec = crate::compiler::compile_team(&ws).expect("compile");
|
|
@@ -2725,11 +2607,11 @@ fn restart_allow_fresh_copilot_clears_poisoned_session_id() {
|
|
|
2725
2607
|
crate::state::persist::save_runtime_state(
|
|
2726
2608
|
&ws,
|
|
2727
2609
|
&json!({
|
|
2728
|
-
"session_name": "team-
|
|
2610
|
+
"session_name": "team-restartclaude046",
|
|
2729
2611
|
"agents": {
|
|
2730
2612
|
"alpha": {
|
|
2731
2613
|
"status": "running",
|
|
2732
|
-
"provider": "
|
|
2614
|
+
"provider": "claude",
|
|
2733
2615
|
"window": "alpha",
|
|
2734
2616
|
"first_send_at": "2026-06-23T10:00:00+00:00",
|
|
2735
2617
|
"session_id": stale_uuid,
|
|
@@ -2747,7 +2629,7 @@ fn restart_allow_fresh_copilot_clears_poisoned_session_id() {
|
|
|
2747
2629
|
let result = restart_with_transport(&ws, true, None, &transport);
|
|
2748
2630
|
assert!(
|
|
2749
2631
|
matches!(result, Ok(RestartReport::Restarted { .. })),
|
|
2750
|
-
"allow-fresh restart should fresh-spawn the
|
|
2632
|
+
"allow-fresh restart should fresh-spawn the claude worker; got {result:?}"
|
|
2751
2633
|
);
|
|
2752
2634
|
|
|
2753
2635
|
let state = crate::state::persist::load_runtime_state(&ws).expect("load state");
|
|
@@ -2755,7 +2637,7 @@ fn restart_allow_fresh_copilot_clears_poisoned_session_id() {
|
|
|
2755
2637
|
assert_eq!(
|
|
2756
2638
|
agent.get("session_id"),
|
|
2757
2639
|
Some(&serde_json::Value::Null),
|
|
2758
|
-
"0.4.6 contract: fresh restart must clear stale session_id; agent={agent}"
|
|
2640
|
+
"0.4.6 contract: Claude fresh restart must clear stale session_id; agent={agent}"
|
|
2759
2641
|
);
|
|
2760
2642
|
// C1 dual-projection: teams.<key>.agents.alpha.session_id must also be null.
|
|
2761
2643
|
if let Some(teams) = state.get("teams").and_then(serde_json::Value::as_object) {
|
|
@@ -2787,7 +2669,7 @@ fn fork_refuses_source_with_partial_tuple() {
|
|
|
2787
2669
|
.unwrap();
|
|
2788
2670
|
std::fs::write(
|
|
2789
2671
|
ws.join("agents").join("src.md"),
|
|
2790
|
-
"---\nname: src\nrole: Source\nprovider:
|
|
2672
|
+
"---\nname: src\nrole: Source\nprovider: copilot\nmodel: gpt-5.5\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nSrc.\n",
|
|
2791
2673
|
)
|
|
2792
2674
|
.unwrap();
|
|
2793
2675
|
let spec = crate::compiler::compile_team(&ws).expect("compile");
|
|
@@ -2799,7 +2681,7 @@ fn fork_refuses_source_with_partial_tuple() {
|
|
|
2799
2681
|
"agents": {
|
|
2800
2682
|
"src": {
|
|
2801
2683
|
"status": "running",
|
|
2802
|
-
"provider": "
|
|
2684
|
+
"provider": "copilot",
|
|
2803
2685
|
"window": "src",
|
|
2804
2686
|
"first_send_at": "2026-06-25T10:00:00+00:00",
|
|
2805
2687
|
"session_id": "scalar-only-uuid",
|
|
@@ -2857,8 +2739,8 @@ fn stop_agent_adaptive_kills_target_pane_not_shared_layout_window() {
|
|
|
2857
2739
|
"session_name": session,
|
|
2858
2740
|
"legacy_display_key": "adaptive",
|
|
2859
2741
|
"agents": {
|
|
2860
|
-
"w1": {"status": "running", "provider": "
|
|
2861
|
-
"w2": {"status": "running", "provider": "
|
|
2742
|
+
"w1": {"status": "running", "provider": "fake", "window": "team-w1", "layout_window": "team-w1", "layout_index": 0, "pane_index": 0, "pane_id": "%1"},
|
|
2743
|
+
"w2": {"status": "running", "provider": "fake", "window": "team-w1", "layout_window": "team-w1", "layout_index": 0, "pane_index": 1, "pane_id": "%2"}
|
|
2862
2744
|
}
|
|
2863
2745
|
}),
|
|
2864
2746
|
)
|
|
@@ -3106,12 +2988,12 @@ fn quick_start_running_agent_state_shape_after_spawn_is_golden() {
|
|
|
3106
2988
|
"spawned_at",
|
|
3107
2989
|
"pane_id",
|
|
3108
2990
|
],
|
|
3109
|
-
"
|
|
2991
|
+
"the fake worker has no pre-assigned session id, so no framework _pending_session_id; raw={raw}"
|
|
3110
2992
|
);
|
|
3111
2993
|
assert_eq!(agent["status"], json!("running"));
|
|
3112
|
-
assert_eq!(agent["provider"], json!("
|
|
2994
|
+
assert_eq!(agent["provider"], json!("fake"));
|
|
3113
2995
|
assert_eq!(agent["agent_id"], json!("implementer"));
|
|
3114
|
-
assert_eq!(agent["model"], json!("
|
|
2996
|
+
assert_eq!(agent["model"], json!("fake"));
|
|
3115
2997
|
assert_eq!(agent["auth_mode"], json!("subscription"));
|
|
3116
2998
|
assert!(agent["profile"].is_null());
|
|
3117
2999
|
assert_eq!(agent["window"], json!("implementer"));
|
|
@@ -3204,9 +3086,9 @@ fn quick_start_paused_agent_state_is_paused_provider_only_and_not_spawned() {
|
|
|
3204
3086
|
"team_dir": team.to_string_lossy(),
|
|
3205
3087
|
"agents": {
|
|
3206
3088
|
"implementer": {
|
|
3207
|
-
"provider": "
|
|
3089
|
+
"provider": "fake",
|
|
3208
3090
|
"role": "Implementation Engineer",
|
|
3209
|
-
"model": "
|
|
3091
|
+
"model": "fake",
|
|
3210
3092
|
"auth_mode": "subscription"
|
|
3211
3093
|
}
|
|
3212
3094
|
},
|
|
@@ -3232,7 +3114,7 @@ fn quick_start_paused_agent_state_is_paused_provider_only_and_not_spawned() {
|
|
|
3232
3114
|
"paused agent state must be exactly golden launch/core.py:171-173; raw={raw}"
|
|
3233
3115
|
);
|
|
3234
3116
|
assert_eq!(agent["status"], json!("paused"));
|
|
3235
|
-
assert_eq!(agent["provider"], json!("
|
|
3117
|
+
assert_eq!(agent["provider"], json!("fake"));
|
|
3236
3118
|
assert!(
|
|
3237
3119
|
transport.spawn_records().is_empty(),
|
|
3238
3120
|
"paused agent must not spawn any terminal window; got {:?}",
|
|
@@ -3536,7 +3418,7 @@ fn e43_adaptive_placement_skips_existing_agent_whose_live_pane_window_name_diffe
|
|
|
3536
3418
|
"agents": {
|
|
3537
3419
|
"architect": {
|
|
3538
3420
|
"status": "running",
|
|
3539
|
-
"provider": "
|
|
3421
|
+
"provider": "fake",
|
|
3540
3422
|
"window": "architect",
|
|
3541
3423
|
// Stale residue — placement must NOT inherit this name.
|
|
3542
3424
|
"layout_window": "team-w2",
|
|
@@ -3613,7 +3495,7 @@ fn e43_add_agent_does_not_split_against_phantom_layout_window() {
|
|
|
3613
3495
|
"agents": {
|
|
3614
3496
|
"architect": {
|
|
3615
3497
|
"status": "running",
|
|
3616
|
-
"provider": "
|
|
3498
|
+
"provider": "fake",
|
|
3617
3499
|
"window": "architect",
|
|
3618
3500
|
"layout_window": "team-w2",
|
|
3619
3501
|
"pane_id": "%1",
|
|
@@ -3700,7 +3582,7 @@ fn e45_adaptive_placement_returns_none_when_no_real_team_w_window_present_in_sta
|
|
|
3700
3582
|
"agents": {
|
|
3701
3583
|
"developer": {
|
|
3702
3584
|
"status": "running",
|
|
3703
|
-
"provider": "
|
|
3585
|
+
"provider": "fake",
|
|
3704
3586
|
"window": "developer",
|
|
3705
3587
|
"layout_window": "developer",
|
|
3706
3588
|
"layout_index": 0u64,
|
|
@@ -3708,7 +3590,7 @@ fn e45_adaptive_placement_returns_none_when_no_real_team_w_window_present_in_sta
|
|
|
3708
3590
|
},
|
|
3709
3591
|
"test-engineer": {
|
|
3710
3592
|
"status": "running",
|
|
3711
|
-
"provider": "
|
|
3593
|
+
"provider": "fake",
|
|
3712
3594
|
"window": "test-engineer",
|
|
3713
3595
|
"layout_window": "test-engineer",
|
|
3714
3596
|
"pane_id": "%521",
|
|
@@ -3762,7 +3644,7 @@ fn e45_adaptive_existing_placement_returns_none_when_claim_is_per_agent_window()
|
|
|
3762
3644
|
"agents": {
|
|
3763
3645
|
"developer": {
|
|
3764
3646
|
"status": "running",
|
|
3765
|
-
"provider": "
|
|
3647
|
+
"provider": "fake",
|
|
3766
3648
|
"window": "developer",
|
|
3767
3649
|
"layout_window": "developer",
|
|
3768
3650
|
"layout_index": 0u64,
|
|
@@ -3822,7 +3704,7 @@ fn e45_add_agent_opens_new_window_does_not_split_into_per_agent_window() {
|
|
|
3822
3704
|
"agents": {
|
|
3823
3705
|
"developer": {
|
|
3824
3706
|
"status": "running",
|
|
3825
|
-
"provider": "
|
|
3707
|
+
"provider": "fake",
|
|
3826
3708
|
"window": "developer",
|
|
3827
3709
|
"layout_window": "developer",
|
|
3828
3710
|
"layout_index": 0u64,
|
|
@@ -3957,7 +3839,7 @@ fn e42_add_then_remove_round_trip_resolves_canonical_spec_not_legacy() {
|
|
|
3957
3839
|
"session_name": "team-iso",
|
|
3958
3840
|
"spec_path": legacy_spec_path.to_string_lossy(),
|
|
3959
3841
|
"agents": {
|
|
3960
|
-
"implementer": {"status": "running", "provider": "
|
|
3842
|
+
"implementer": {"status": "running", "provider": "fake", "window": "implementer"}
|
|
3961
3843
|
}
|
|
3962
3844
|
}),
|
|
3963
3845
|
)
|