@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
|
@@ -39,9 +39,9 @@ use hermetic::HermeticTestEnv;
|
|
|
39
39
|
const TEAM_MD: &str =
|
|
40
40
|
"---\nname: verify031\nobjective: Verify mixed provider windows.\nprovider: codex\n---\n\nTeam.\n";
|
|
41
41
|
|
|
42
|
-
const
|
|
42
|
+
const FAKE_ROLE: &str = "---\nname: faker\nrole: Fake Worker\nprovider: fake\nmodel: fake\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nFake worker.\n";
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const CLAUDE_ROLE: &str = "---\nname: clauder\nrole: Claude Worker\nprovider: claude\nmodel: claude-sonnet-4-6\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\nClaude worker.\n";
|
|
45
45
|
|
|
46
46
|
#[test]
|
|
47
47
|
#[serial(env)]
|
|
@@ -50,7 +50,7 @@ fn worker_mcp_owner_team_scope_must_match_runtime_team_key_not_spec_name() {
|
|
|
50
50
|
let team = mixed_provider_team_dir(&hermetic, "mcp-owner-scope");
|
|
51
51
|
super::launch_spawn::seed_healthy_coordinator(team.parent().unwrap());
|
|
52
52
|
let transport = RecordingTransport::new()
|
|
53
|
-
.with_windows(vec![WindowName::new("
|
|
53
|
+
.with_windows(vec![WindowName::new("clauder"), WindowName::new("faker")]);
|
|
54
54
|
let launch = ready_launch(
|
|
55
55
|
quick_start_with_transport(&team, None, true, None, &transport)
|
|
56
56
|
.expect("quick-start should reach worker spawn path"),
|
|
@@ -108,7 +108,7 @@ fn quick_start_preserves_external_leader_receiver_when_worker_pane_id_collides_a
|
|
|
108
108
|
let _tmux = hermetic.with_env("TMUX", &format!("{caller_endpoint},123,0"));
|
|
109
109
|
let _pane = hermetic.with_env("TMUX_PANE", "%0");
|
|
110
110
|
let _provider = hermetic.with_env("TEAM_AGENT_LEADER_PROVIDER", "codex");
|
|
111
|
-
let team =
|
|
111
|
+
let team = fake_only_team_dir(&hermetic, "external-pane-collision");
|
|
112
112
|
let workspace = team.parent().expect("teamdir has parent workspace");
|
|
113
113
|
let caller = PaneInfo {
|
|
114
114
|
pane_id: PaneId::new("%0"),
|
|
@@ -124,7 +124,7 @@ fn quick_start_preserves_external_leader_receiver_when_worker_pane_id_collides_a
|
|
|
124
124
|
leader_env: Default::default(),
|
|
125
125
|
};
|
|
126
126
|
let transport = RecordingTransport::new()
|
|
127
|
-
.with_windows(vec![WindowName::new("
|
|
127
|
+
.with_windows(vec![WindowName::new("faker")])
|
|
128
128
|
.with_tmux_endpoint(caller_endpoint)
|
|
129
129
|
.with_targets(vec![caller.clone()]);
|
|
130
130
|
let live = crate::transport::test_support::OfflineTransport::default()
|
|
@@ -139,9 +139,9 @@ fn quick_start_preserves_external_leader_receiver_when_worker_pane_id_collides_a
|
|
|
139
139
|
let worker_pane = launch
|
|
140
140
|
.started
|
|
141
141
|
.iter()
|
|
142
|
-
.find(|agent| agent.agent_id.as_str() == "
|
|
142
|
+
.find(|agent| agent.agent_id.as_str() == "faker")
|
|
143
143
|
.map(|agent| agent.target.as_str())
|
|
144
|
-
.expect("fixture precondition:
|
|
144
|
+
.expect("fixture precondition: faker spawned");
|
|
145
145
|
assert_eq!(
|
|
146
146
|
worker_pane, "%0",
|
|
147
147
|
"fixture precondition: first worker in the product -L socket receives bare pane id %0"
|
|
@@ -194,11 +194,10 @@ fn running_worker_state_must_only_be_written_for_windows_that_exist_after_launch
|
|
|
194
194
|
let spec_path = team.join("team.spec.yaml");
|
|
195
195
|
std::fs::write(&spec_path, team_agent::model::yaml::dumps(&spec)).expect("write spec");
|
|
196
196
|
|
|
197
|
-
// Simulates the Mac mini final capture: the
|
|
198
|
-
// (originally Claude, here Copilot) window does not.
|
|
197
|
+
// Simulates the Mac mini final capture: the fake worker's window exists, the claude window does not.
|
|
199
198
|
// launch_with_transport currently never verifies the post-spawn window set before persisting
|
|
200
199
|
// `status=running`, so this fixture pins the state/physical invariant directly.
|
|
201
|
-
let transport = RecordingTransport::new().with_windows(vec![WindowName::new("
|
|
200
|
+
let transport = RecordingTransport::new().with_windows(vec![WindowName::new("faker")]);
|
|
202
201
|
let launch = launch_with_transport(&spec_path, false, true, true, &transport)
|
|
203
202
|
.expect("launch should reach the real spawn/state path");
|
|
204
203
|
assert_eq!(
|
|
@@ -270,10 +269,10 @@ fn leader_bound_delivery_must_target_bound_leader_pane_not_missing_leader_window
|
|
|
270
269
|
},
|
|
271
270
|
"owner_epoch": 1,
|
|
272
271
|
"agents": {
|
|
273
|
-
"
|
|
272
|
+
"faker": {
|
|
274
273
|
"status": "running",
|
|
275
|
-
"provider": "
|
|
276
|
-
"window": "
|
|
274
|
+
"provider": "fake",
|
|
275
|
+
"window": "faker"
|
|
277
276
|
}
|
|
278
277
|
},
|
|
279
278
|
"teams": {
|
|
@@ -292,10 +291,10 @@ fn leader_bound_delivery_must_target_bound_leader_pane_not_missing_leader_window
|
|
|
292
291
|
"owner_epoch": 1
|
|
293
292
|
},
|
|
294
293
|
"agents": {
|
|
295
|
-
"
|
|
294
|
+
"faker": {
|
|
296
295
|
"status": "running",
|
|
297
|
-
"provider": "
|
|
298
|
-
"window": "
|
|
296
|
+
"provider": "fake",
|
|
297
|
+
"window": "faker"
|
|
299
298
|
}
|
|
300
299
|
}
|
|
301
300
|
}
|
|
@@ -308,7 +307,7 @@ fn leader_bound_delivery_must_target_bound_leader_pane_not_missing_leader_window
|
|
|
308
307
|
let message_id = store
|
|
309
308
|
.create_message(
|
|
310
309
|
None,
|
|
311
|
-
"
|
|
310
|
+
"faker",
|
|
312
311
|
"leader",
|
|
313
312
|
"BUG4 worker to leader canary",
|
|
314
313
|
None,
|
|
@@ -318,7 +317,7 @@ fn leader_bound_delivery_must_target_bound_leader_pane_not_missing_leader_window
|
|
|
318
317
|
.expect("create accepted leader-bound message");
|
|
319
318
|
let event_log = EventLog::new(&workspace);
|
|
320
319
|
let transport = RecordingTransport::new()
|
|
321
|
-
.with_windows(vec![WindowName::new("
|
|
320
|
+
.with_windows(vec![WindowName::new("faker")])
|
|
322
321
|
.with_targets(vec![pane_info("%0", "external-leader-socket", "leader")]);
|
|
323
322
|
|
|
324
323
|
let outcome = deliver_pending_message(
|
|
@@ -369,7 +368,7 @@ fn worker_to_leader_delivery_succeeds_when_attached_leader_pane_lives_on_default
|
|
|
369
368
|
pane_info(
|
|
370
369
|
product_worker_pane.as_str(),
|
|
371
370
|
product_session.as_str(),
|
|
372
|
-
"
|
|
371
|
+
"faker",
|
|
373
372
|
),
|
|
374
373
|
]);
|
|
375
374
|
|
|
@@ -395,10 +394,10 @@ fn worker_to_leader_delivery_succeeds_when_attached_leader_pane_lives_on_default
|
|
|
395
394
|
},
|
|
396
395
|
"owner_epoch": 1,
|
|
397
396
|
"agents": {
|
|
398
|
-
"
|
|
397
|
+
"faker": {
|
|
399
398
|
"status": "running",
|
|
400
|
-
"provider": "
|
|
401
|
-
"window": "
|
|
399
|
+
"provider": "fake",
|
|
400
|
+
"window": "faker",
|
|
402
401
|
"pane_id": product_worker_pane.as_str(),
|
|
403
402
|
"startup_prompts": "handled"
|
|
404
403
|
}
|
|
@@ -421,10 +420,10 @@ fn worker_to_leader_delivery_succeeds_when_attached_leader_pane_lives_on_default
|
|
|
421
420
|
"claimed_via": "quick-start"
|
|
422
421
|
},
|
|
423
422
|
"agents": {
|
|
424
|
-
"
|
|
423
|
+
"faker": {
|
|
425
424
|
"status": "running",
|
|
426
|
-
"provider": "
|
|
427
|
-
"window": "
|
|
425
|
+
"provider": "fake",
|
|
426
|
+
"window": "faker",
|
|
428
427
|
"pane_id": product_worker_pane.as_str(),
|
|
429
428
|
"startup_prompts": "handled"
|
|
430
429
|
}
|
|
@@ -440,7 +439,7 @@ fn worker_to_leader_delivery_succeeds_when_attached_leader_pane_lives_on_default
|
|
|
440
439
|
let message_id = store
|
|
441
440
|
.create_message(
|
|
442
441
|
None,
|
|
443
|
-
"
|
|
442
|
+
"faker",
|
|
444
443
|
"leader",
|
|
445
444
|
"BUG4 worker-to-leader default socket canary",
|
|
446
445
|
None,
|
|
@@ -504,10 +503,10 @@ fn assert_bound_reachable_leader_send_message_injects(
|
|
|
504
503
|
},
|
|
505
504
|
"owner_epoch": 7,
|
|
506
505
|
"agents": {
|
|
507
|
-
"
|
|
506
|
+
"faker": {
|
|
508
507
|
"status": "running",
|
|
509
|
-
"provider": "
|
|
510
|
-
"window": "
|
|
508
|
+
"provider": "fake",
|
|
509
|
+
"window": "faker",
|
|
511
510
|
"pane_id": worker_pane.as_str(),
|
|
512
511
|
"startup_prompts": "handled"
|
|
513
512
|
}
|
|
@@ -517,7 +516,7 @@ fn assert_bound_reachable_leader_send_message_injects(
|
|
|
517
516
|
let transport = RecordingTransport::new()
|
|
518
517
|
.with_targets(vec![
|
|
519
518
|
pane_info(leader_pane.as_str(), "external-leader-socket", "leader"),
|
|
520
|
-
pane_info(worker_pane.as_str(), "team-bug4-fresh", "
|
|
519
|
+
pane_info(worker_pane.as_str(), "team-bug4-fresh", "faker"),
|
|
521
520
|
])
|
|
522
521
|
.with_liveness(vec![
|
|
523
522
|
(leader_pane.as_str().to_string(), PaneLiveness::Live),
|
|
@@ -526,7 +525,7 @@ fn assert_bound_reachable_leader_send_message_injects(
|
|
|
526
525
|
let event_log = EventLog::new(&workspace);
|
|
527
526
|
|
|
528
527
|
let mut opts = SendOptions::default();
|
|
529
|
-
opts.sender = TrustedSender::from_runtime_identity(AgentId::new("
|
|
528
|
+
opts.sender = TrustedSender::from_runtime_identity(AgentId::new("faker"));
|
|
530
529
|
opts.requires_ack = false;
|
|
531
530
|
opts.route_task_id = false;
|
|
532
531
|
opts.team = Some(team_agent::model::ids::TeamKey::new("teamdir"));
|
|
@@ -604,7 +603,7 @@ fn unbound_or_unreachable_worker_to_leader_remains_rebind_required_without_autod
|
|
|
604
603
|
"session_name": "team-bug4-unbound",
|
|
605
604
|
"active_team_key": "teamdir",
|
|
606
605
|
"leader": {"id": "leader", "provider": "codex"},
|
|
607
|
-
"agents": {"
|
|
606
|
+
"agents": {"faker": {"status": "running", "provider": "fake", "window": "faker"}}
|
|
608
607
|
}),
|
|
609
608
|
RecordingTransport::new(),
|
|
610
609
|
),
|
|
@@ -622,7 +621,7 @@ fn unbound_or_unreachable_worker_to_leader_remains_rebind_required_without_autod
|
|
|
622
621
|
"owner_epoch": 1
|
|
623
622
|
},
|
|
624
623
|
"team_owner": {"pane_id": "%missing-leader", "provider": "codex", "owner_epoch": 1},
|
|
625
|
-
"agents": {"
|
|
624
|
+
"agents": {"faker": {"status": "running", "provider": "fake", "window": "faker"}}
|
|
626
625
|
}),
|
|
627
626
|
RecordingTransport::new()
|
|
628
627
|
.with_liveness(vec![("%missing-leader".to_string(), PaneLiveness::Dead)]),
|
|
@@ -635,7 +634,7 @@ fn unbound_or_unreachable_worker_to_leader_remains_rebind_required_without_autod
|
|
|
635
634
|
save_runtime_state(&workspace, &state).expect("seed runtime state");
|
|
636
635
|
let event_log = EventLog::new(&workspace);
|
|
637
636
|
let mut opts = SendOptions::default();
|
|
638
|
-
opts.sender = TrustedSender::from_runtime_identity(AgentId::new("
|
|
637
|
+
opts.sender = TrustedSender::from_runtime_identity(AgentId::new("faker"));
|
|
639
638
|
opts.requires_ack = false;
|
|
640
639
|
opts.route_task_id = false;
|
|
641
640
|
opts.team = Some(team_agent::model::ids::TeamKey::new("teamdir"));
|
|
@@ -743,9 +742,9 @@ fn mixed_provider_team_dir(hermetic: &HermeticTestEnv, tag: &str) -> PathBuf {
|
|
|
743
742
|
let team = hermetic.workspace(tag).join("teamdir");
|
|
744
743
|
std::fs::create_dir_all(team.join("agents")).expect("create agents dir");
|
|
745
744
|
std::fs::write(team.join("TEAM.md"), TEAM_MD).expect("write TEAM.md");
|
|
746
|
-
std::fs::write(team.join("agents").join("
|
|
747
|
-
.expect("write
|
|
748
|
-
std::fs::write(team.join("agents").join("
|
|
745
|
+
std::fs::write(team.join("agents").join("clauder.md"), CLAUDE_ROLE)
|
|
746
|
+
.expect("write clauder role");
|
|
747
|
+
std::fs::write(team.join("agents").join("faker.md"), FAKE_ROLE).expect("write faker role");
|
|
749
748
|
team
|
|
750
749
|
}
|
|
751
750
|
|
|
@@ -964,11 +963,11 @@ impl Transport for RecordingTransport {
|
|
|
964
963
|
}
|
|
965
964
|
}
|
|
966
965
|
|
|
967
|
-
fn
|
|
966
|
+
fn fake_only_team_dir(hermetic: &HermeticTestEnv, tag: &str) -> PathBuf {
|
|
968
967
|
let team = hermetic.workspace(tag).join("teamdir");
|
|
969
968
|
std::fs::create_dir_all(team.join("agents")).expect("create agents dir");
|
|
970
969
|
std::fs::write(team.join("TEAM.md"), TEAM_MD).expect("write TEAM.md");
|
|
971
|
-
std::fs::write(team.join("agents").join("
|
|
970
|
+
std::fs::write(team.join("agents").join("faker.md"), FAKE_ROLE).expect("write fake role");
|
|
972
971
|
team
|
|
973
972
|
}
|
|
974
973
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//! Worker provider spawn environment contracts.
|
|
2
2
|
//!
|
|
3
|
-
//! #229 B-layer root cause: spawned
|
|
4
|
-
//! process environment (proxy/CA/PATH/etc.) just like a user typing
|
|
5
|
-
//! then overlay the Team Agent identity env. The contract is
|
|
6
|
-
//!
|
|
3
|
+
//! #229 B-layer root cause: spawned legacy-runtime workers must inherit the parent `team-agent`
|
|
4
|
+
//! process environment (proxy/CA/PATH/etc.) just like a user typing the provider command (here
|
|
5
|
+
//! `copilot`) in the same terminal, then overlay the Team Agent identity env. The contract is
|
|
6
|
+
//! path-generic and covers the three worker spawn surfaces: quick-start/launch, restart, and add-agent.
|
|
7
7
|
|
|
8
8
|
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ use serde_json::json;
|
|
|
21
21
|
use serial_test::serial;
|
|
22
22
|
use team_agent::lifecycle::{
|
|
23
23
|
add_agent_with_transport, fork_agent_with_transport, launch_with_transport,
|
|
24
|
-
restart_with_transport,
|
|
24
|
+
restart_with_transport, LifecycleError,
|
|
25
25
|
};
|
|
26
26
|
use team_agent::model::ids::AgentId;
|
|
27
27
|
use team_agent::transport::{
|
|
@@ -119,7 +119,7 @@ fn tmux_control_filter_uses_env_keys_not_substring_in_inherited_values() {
|
|
|
119
119
|
),
|
|
120
120
|
]);
|
|
121
121
|
let spawn = RecordedSpawn {
|
|
122
|
-
argv: vec!["
|
|
122
|
+
argv: vec!["copilot".to_string()],
|
|
123
123
|
env: env.clone(),
|
|
124
124
|
env_unset: Vec::new(),
|
|
125
125
|
session: SessionName::new("s"),
|
|
@@ -167,8 +167,8 @@ fn worker_spawn_scrubs_cross_provider_process_identity_but_keeps_config_env() {
|
|
|
167
167
|
("NODE_EXTRA_CA_CERTS", "/canary/ca.pem"),
|
|
168
168
|
]);
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
let launch_team =
|
|
171
|
+
compiled_team_dir_for_provider("cross-launch", &[("worker_a", "Launch Worker")], "claude");
|
|
172
172
|
let launch_transport = RecordingTransport::new().with_session_present(false);
|
|
173
173
|
launch_with_transport(
|
|
174
174
|
&launch_team.join("team.spec.yaml"),
|
|
@@ -179,16 +179,25 @@ fn worker_spawn_scrubs_cross_provider_process_identity_but_keeps_config_env() {
|
|
|
179
179
|
)
|
|
180
180
|
.expect("launch fixture should spawn worker");
|
|
181
181
|
|
|
182
|
-
let restart_team =
|
|
183
|
-
|
|
182
|
+
let restart_team = compiled_team_dir_for_provider(
|
|
183
|
+
"cross-restart",
|
|
184
|
+
&[("worker_a", "Restart Worker")],
|
|
185
|
+
"claude",
|
|
186
|
+
);
|
|
187
|
+
seed_restart_state_as(&restart_team, "worker_a", "claude");
|
|
184
188
|
let restart_transport = RecordingTransport::new().with_session_present(false);
|
|
185
189
|
restart_with_transport(&restart_team, true, None, &restart_transport)
|
|
186
190
|
.expect("restart fixture should spawn worker");
|
|
187
191
|
|
|
188
|
-
let add_team =
|
|
189
|
-
|
|
192
|
+
let add_team =
|
|
193
|
+
compiled_team_dir_for_provider("cross-add", &[("worker_a", "Existing Worker")], "claude");
|
|
194
|
+
seed_running_add_agent_state_as(&add_team, "worker_a", "claude");
|
|
190
195
|
let role_file = add_team.parent().unwrap().join("worker_b.md");
|
|
191
|
-
std::fs::write(
|
|
196
|
+
std::fs::write(
|
|
197
|
+
&role_file,
|
|
198
|
+
role_doc_for_provider("worker_b", "Added Worker", "claude"),
|
|
199
|
+
)
|
|
200
|
+
.unwrap();
|
|
192
201
|
let add_transport = RecordingTransport::new().with_session_present(true);
|
|
193
202
|
add_agent_with_transport(
|
|
194
203
|
&add_team,
|
|
@@ -218,11 +227,11 @@ fn worker_spawn_scrubs_cross_provider_process_identity_but_keeps_config_env() {
|
|
|
218
227
|
|
|
219
228
|
#[test]
|
|
220
229
|
#[serial(env)]
|
|
221
|
-
fn
|
|
222
|
-
//
|
|
223
|
-
//
|
|
224
|
-
let _home = hermetic_guard::HermeticTestEnv::enter("
|
|
225
|
-
let team = compiled_team_dir("
|
|
230
|
+
fn worker_spawn_legacy_fork_reports_unverified_not_unsupported() {
|
|
231
|
+
// 已废除的行为:旧的 legacy fork 入口把 in-window fork 当成已验证能力(或报「不支持」),此断言证明它确实没了。
|
|
232
|
+
// 本轮裁定:即便是声明了 fork 能力的 copilot 源席,legacy 入口也必须明确报「未验证」,不是「不支持」,且不 spawn。
|
|
233
|
+
let _home = hermetic_guard::HermeticTestEnv::enter("legacy-fork-unverified");
|
|
234
|
+
let team = compiled_team_dir("legacy-fork-tombstone", &[("worker_a", "Fork Source")]);
|
|
226
235
|
seed_forkable_source_state(&team, "worker_a");
|
|
227
236
|
let transport = RecordingTransport::new().with_session_present(true);
|
|
228
237
|
let err = fork_agent_with_transport(
|
|
@@ -234,16 +243,23 @@ fn worker_spawn_codex_in_window_fork_reports_unverified_not_unsupported() {
|
|
|
234
243
|
None,
|
|
235
244
|
&transport,
|
|
236
245
|
)
|
|
237
|
-
.expect_err("
|
|
238
|
-
let text = err.to_string();
|
|
246
|
+
.expect_err("the legacy fork entry must refuse as unverified");
|
|
239
247
|
assert!(
|
|
240
|
-
|
|
241
|
-
|
|
248
|
+
matches!(
|
|
249
|
+
&err,
|
|
250
|
+
LifecycleError::Provider(message) if message == "copilot native session fork is unverified (未验证); no legacy fork or fresh replacement was performed"
|
|
251
|
+
),
|
|
252
|
+
"the legacy fork entry must report 未验证 for the copilot source; err={err}"
|
|
242
253
|
);
|
|
254
|
+
let text = err.to_string();
|
|
243
255
|
assert!(
|
|
244
256
|
!text.contains("不支持") && !text.contains("does not support"),
|
|
245
257
|
"the ruling is unverified, not unsupported; err={text}"
|
|
246
258
|
);
|
|
259
|
+
assert!(
|
|
260
|
+
transport.spawns.lock().unwrap().is_empty(),
|
|
261
|
+
"the refused legacy fork must not spawn a pane"
|
|
262
|
+
);
|
|
247
263
|
}
|
|
248
264
|
|
|
249
265
|
#[test]
|
|
@@ -331,14 +347,14 @@ fn spawn_env_contract_failures(
|
|
|
331
347
|
"{surface}: worker spawn must filter tmux control env from inherited parent env; present_keys={present:?}"
|
|
332
348
|
));
|
|
333
349
|
}
|
|
334
|
-
if !spawn.argv.iter().any(|part| part == "
|
|
350
|
+
if !spawn.argv.iter().any(|part| part == "copilot") {
|
|
335
351
|
failures.push(format!(
|
|
336
|
-
"{surface}: provider executable must remain the command name `
|
|
352
|
+
"{surface}: provider executable must remain the command name `copilot`"
|
|
337
353
|
));
|
|
338
354
|
}
|
|
339
|
-
if spawn.argv.iter().any(|part| part.ends_with("/
|
|
355
|
+
if spawn.argv.iter().any(|part| part.ends_with("/copilot")) {
|
|
340
356
|
failures.push(format!(
|
|
341
|
-
"{surface}: provider executable must not be hard-coded as an absolute
|
|
357
|
+
"{surface}: provider executable must not be hard-coded as an absolute copilot path"
|
|
342
358
|
));
|
|
343
359
|
}
|
|
344
360
|
failures
|
|
@@ -398,7 +414,7 @@ fn cross_provider_identity_failures(surface: &str, spawn: &RecordedSpawn) -> Vec
|
|
|
398
414
|
}
|
|
399
415
|
|
|
400
416
|
fn compiled_team_dir(label: &str, agents: &[(&str, &str)]) -> PathBuf {
|
|
401
|
-
compiled_team_dir_for_provider(label, agents, "
|
|
417
|
+
compiled_team_dir_for_provider(label, agents, "copilot")
|
|
402
418
|
}
|
|
403
419
|
|
|
404
420
|
fn compiled_team_dir_for_provider(label: &str, agents: &[(&str, &str)], provider: &str) -> PathBuf {
|
|
@@ -428,7 +444,7 @@ fn compiled_team_dir_for_provider(label: &str, agents: &[(&str, &str)], provider
|
|
|
428
444
|
}
|
|
429
445
|
|
|
430
446
|
fn role_doc(name: &str, role: &str) -> String {
|
|
431
|
-
role_doc_for_provider(name, role, "
|
|
447
|
+
role_doc_for_provider(name, role, "copilot")
|
|
432
448
|
}
|
|
433
449
|
|
|
434
450
|
fn role_doc_for_provider(name: &str, role: &str, provider: &str) -> String {
|
|
@@ -438,7 +454,7 @@ fn role_doc_for_provider(name: &str, role: &str, provider: &str) -> String {
|
|
|
438
454
|
}
|
|
439
455
|
|
|
440
456
|
fn seed_restart_state(team: &Path, agent_id: &str) {
|
|
441
|
-
seed_restart_state_as(team, agent_id, "
|
|
457
|
+
seed_restart_state_as(team, agent_id, "copilot");
|
|
442
458
|
}
|
|
443
459
|
|
|
444
460
|
fn seed_restart_state_as(team: &Path, agent_id: &str, provider: &str) {
|
|
@@ -468,7 +484,7 @@ fn seed_restart_state_as(team: &Path, agent_id: &str, provider: &str) {
|
|
|
468
484
|
}
|
|
469
485
|
|
|
470
486
|
fn seed_running_add_agent_state(team: &Path, agent_id: &str) {
|
|
471
|
-
seed_running_add_agent_state_as(team, agent_id, "
|
|
487
|
+
seed_running_add_agent_state_as(team, agent_id, "copilot");
|
|
472
488
|
}
|
|
473
489
|
|
|
474
490
|
fn seed_running_add_agent_state_as(team: &Path, agent_id: &str, provider: &str) {
|
|
@@ -498,28 +514,6 @@ fn seed_running_add_agent_state_as(team: &Path, agent_id: &str, provider: &str)
|
|
|
498
514
|
|
|
499
515
|
fn seed_forkable_source_state(team: &Path, agent_id: &str) {
|
|
500
516
|
let workspace = team_agent::model::paths::team_workspace(team).unwrap();
|
|
501
|
-
let rollout_root = PathBuf::from(std::env::var_os("HOME").expect("hermetic HOME"))
|
|
502
|
-
.join(".codex/sessions/worker-spawn-source");
|
|
503
|
-
std::fs::create_dir_all(&rollout_root).unwrap();
|
|
504
|
-
let rollout = rollout_root.join("rollout-sess-worker-a.jsonl");
|
|
505
|
-
std::fs::write(
|
|
506
|
-
&rollout,
|
|
507
|
-
format!(
|
|
508
|
-
"{}\n{}\n",
|
|
509
|
-
json!({
|
|
510
|
-
"type": "session_meta",
|
|
511
|
-
"payload": {"id": "sess-worker-a", "cwd": workspace}
|
|
512
|
-
}),
|
|
513
|
-
json!({
|
|
514
|
-
"type": "response_item",
|
|
515
|
-
"payload": {"content": [{
|
|
516
|
-
"type": "input_text",
|
|
517
|
-
"text": format!("You are Team Agent worker `{agent_id}` with role `fixture`.")
|
|
518
|
-
}]}
|
|
519
|
-
})
|
|
520
|
-
),
|
|
521
|
-
)
|
|
522
|
-
.unwrap();
|
|
523
517
|
team_agent::state::persist::save_runtime_state(
|
|
524
518
|
&workspace,
|
|
525
519
|
&json!({
|
|
@@ -530,13 +524,12 @@ fn seed_forkable_source_state(team: &Path, agent_id: &str) {
|
|
|
530
524
|
"agents": {
|
|
531
525
|
agent_id: {
|
|
532
526
|
"status": "running",
|
|
533
|
-
"provider": "
|
|
527
|
+
"provider": "copilot",
|
|
534
528
|
"auth_mode": "subscription",
|
|
535
529
|
"role": "Fork Source",
|
|
536
530
|
"window": agent_id,
|
|
537
531
|
"owner_team_id": RUNTIME_TEAM_KEY,
|
|
538
532
|
"session_id": "sess-worker-a",
|
|
539
|
-
"rollout_path": rollout.to_string_lossy().to_string(),
|
|
540
533
|
"captured_at": "2026-07-16T00:00:00+00:00",
|
|
541
534
|
"captured_via": "session.captured",
|
|
542
535
|
"tools": ["mcp_team"]
|
|
@@ -669,11 +662,10 @@ impl RecordingTransport {
|
|
|
669
662
|
session: &SessionName,
|
|
670
663
|
window: &WindowName,
|
|
671
664
|
argv: &[String],
|
|
672
|
-
|
|
665
|
+
_cwd: &Path,
|
|
673
666
|
env: &BTreeMap<String, String>,
|
|
674
667
|
env_unset: &[String],
|
|
675
668
|
) -> SpawnResult {
|
|
676
|
-
emit_codex_fork_backing(argv, cwd);
|
|
677
669
|
let mut spawns = self.spawns.lock().unwrap();
|
|
678
670
|
let pane_id = PaneId::new(format!("%{}", spawns.len() + 1));
|
|
679
671
|
spawns.push(RecordedSpawn {
|
|
@@ -693,36 +685,6 @@ impl RecordingTransport {
|
|
|
693
685
|
}
|
|
694
686
|
}
|
|
695
687
|
|
|
696
|
-
fn emit_codex_fork_backing(argv: &[String], cwd: &Path) {
|
|
697
|
-
if !argv
|
|
698
|
-
.windows(2)
|
|
699
|
-
.any(|pair| pair[0] == "codex" && pair[1] == "fork")
|
|
700
|
-
{
|
|
701
|
-
return;
|
|
702
|
-
}
|
|
703
|
-
static SESSION_SEQ: AtomicU64 = AtomicU64::new(0);
|
|
704
|
-
let session_id = format!(
|
|
705
|
-
"worker-spawn-fork-{}-{}",
|
|
706
|
-
std::process::id(),
|
|
707
|
-
SESSION_SEQ.fetch_add(1, Ordering::Relaxed)
|
|
708
|
-
);
|
|
709
|
-
let root = PathBuf::from(std::env::var_os("HOME").expect("hermetic HOME"))
|
|
710
|
-
.join(".codex/sessions/worker-spawn-env-fixture");
|
|
711
|
-
std::fs::create_dir_all(&root).unwrap();
|
|
712
|
-
let record = serde_json::json!({
|
|
713
|
-
"session_meta": {"payload": {
|
|
714
|
-
"id": session_id.clone(),
|
|
715
|
-
"cwd": cwd.to_string_lossy(),
|
|
716
|
-
"created_at": chrono::Utc::now().to_rfc3339(),
|
|
717
|
-
}}
|
|
718
|
-
});
|
|
719
|
-
std::fs::write(
|
|
720
|
-
root.join(format!("rollout-{session_id}.jsonl")),
|
|
721
|
-
format!("{record}\n"),
|
|
722
|
-
)
|
|
723
|
-
.unwrap();
|
|
724
|
-
}
|
|
725
|
-
|
|
726
688
|
impl Transport for RecordingTransport {
|
|
727
689
|
fn kind(&self) -> BackendKind {
|
|
728
690
|
BackendKind::Tmux
|
|
@@ -800,8 +762,9 @@ impl Transport for RecordingTransport {
|
|
|
800
762
|
_target: &Target,
|
|
801
763
|
range: CaptureRange,
|
|
802
764
|
) -> Result<CapturedText, TransportError> {
|
|
765
|
+
// The Copilot ready screen lets the startup-prompt handler return at once.
|
|
803
766
|
Ok(CapturedText {
|
|
804
|
-
text:
|
|
767
|
+
text: team_agent::provider::COPILOT_READY_MARKER.to_string(),
|
|
805
768
|
range,
|
|
806
769
|
})
|
|
807
770
|
}
|
|
@@ -833,7 +796,7 @@ impl Transport for RecordingTransport {
|
|
|
833
796
|
window_name: Some(spawn.window.clone()),
|
|
834
797
|
pane_index: None,
|
|
835
798
|
tty: None,
|
|
836
|
-
current_command: Some("
|
|
799
|
+
current_command: Some("copilot".to_string()),
|
|
837
800
|
current_path: None,
|
|
838
801
|
active: false,
|
|
839
802
|
pane_pid: None,
|
|
@@ -50,19 +50,16 @@ mod agent_ops;
|
|
|
50
50
|
mod b0_legacy_snapshot_nonauthority_contract;
|
|
51
51
|
mod b0_reader_hideone_audit_contract;
|
|
52
52
|
mod behavioral_diff_264_red;
|
|
53
|
+
mod claude_compatible_config_red;
|
|
53
54
|
mod claude_profile_launch_red;
|
|
54
55
|
mod cli_argv_routing_red;
|
|
55
56
|
mod clone_agent_preserves_source_tools;
|
|
56
57
|
mod clone_fork_copilot_perms_red;
|
|
57
|
-
mod codex_weak_window_attribution_red;
|
|
58
58
|
mod communication_mode_runtime_contract_red;
|
|
59
59
|
mod copilot_provider_red;
|
|
60
60
|
mod core;
|
|
61
61
|
mod f032_startup_prompt_best_effort_red;
|
|
62
|
-
mod grok_effort_argv_red;
|
|
63
|
-
mod grok_mcp_overlay_red;
|
|
64
62
|
mod grok_require_explicit_model_red;
|
|
65
|
-
mod grok_restart_resume_red;
|
|
66
63
|
mod harvest2_a_batch_red;
|
|
67
64
|
mod host_cotenant_death_p0_contract;
|
|
68
65
|
mod issue238_codex_effort_contract;
|
|
@@ -76,8 +73,10 @@ mod phase_b_contracts;
|
|
|
76
73
|
mod phase_golden;
|
|
77
74
|
mod pi_catalog_red;
|
|
78
75
|
mod pi_command_red;
|
|
76
|
+
mod pi_compiler_red;
|
|
79
77
|
mod pi_dual_entry_red;
|
|
80
78
|
mod pi_executable_mcp_red;
|
|
79
|
+
mod pi_fork_session_inheritance_red;
|
|
81
80
|
mod pi_lifecycle_doctor_red;
|
|
82
81
|
mod pi_native_mcp_capability_red;
|
|
83
82
|
mod pi_session_delivery_red;
|
|
@@ -61,9 +61,6 @@ pub mod event_names {
|
|
|
61
61
|
pub const DISPLAY_ADAPTIVE_BLOCKED: &str = "display.adaptive_blocked";
|
|
62
62
|
pub const DISPLAY_ADAPTIVE_REBUILT: &str = "display.adaptive_rebuilt";
|
|
63
63
|
pub const DISPLAY_ADAPTIVE_CLOSED: &str = "display.adaptive_closed";
|
|
64
|
-
/// Directory-scoped grok toml dropped leftover per-seat `TEAM_AGENT_*` keys.
|
|
65
|
-
/// Fields: `path` (file), `keys` (names only — never values).
|
|
66
|
-
pub const GROK_TOML_PER_SEAT_KEYS_CLEARED: &str = "lifecycle.grok_toml.per_seat_keys_cleared";
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
// ===========================================================================
|
|
@@ -396,6 +393,14 @@ pub enum LifecycleError {
|
|
|
396
393
|
/// 编译 spec / role doc 失败(`compile_team`/`compile_role_doc_agent`)。
|
|
397
394
|
#[error("spec compile failed: {0}")]
|
|
398
395
|
Compile(String),
|
|
396
|
+
/// Pi model/schema admission failed before lifecycle reservation or writes.
|
|
397
|
+
#[error("pi model preflight failed: {requested}")]
|
|
398
|
+
PiModelPreflight {
|
|
399
|
+
requested: String,
|
|
400
|
+
candidates: Vec<String>,
|
|
401
|
+
action: String,
|
|
402
|
+
not_ready: bool,
|
|
403
|
+
},
|
|
399
404
|
/// provider 命令构造 / resume 不可用(`ResumeUnavailable`)。
|
|
400
405
|
#[error("provider error: {0}")]
|
|
401
406
|
Provider(String),
|
|
@@ -610,8 +615,8 @@ pub struct AddAgentReport {
|
|
|
610
615
|
pub role_file: PathBuf,
|
|
611
616
|
}
|
|
612
617
|
|
|
613
|
-
/// `fork_agent(...)`
|
|
614
|
-
///
|
|
618
|
+
/// `fork_agent(...)` 结果。Pi 的 snapshot fork 附带可审计的 source/target backing 细节;
|
|
619
|
+
/// 已支持的其他 provider 保持既有报告字段。
|
|
615
620
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
616
621
|
pub struct ForkAgentReport {
|
|
617
622
|
pub source_agent_id: AgentId,
|
|
@@ -619,6 +624,14 @@ pub struct ForkAgentReport {
|
|
|
619
624
|
pub env: AgentActionEnvelope,
|
|
620
625
|
pub session_id: Option<SessionId>,
|
|
621
626
|
pub backing_state: ForkBackingState,
|
|
627
|
+
pub pi_fork: Option<PiForkDetails>,
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
631
|
+
pub struct PiForkDetails {
|
|
632
|
+
pub source_session_id: SessionId,
|
|
633
|
+
pub session_id: SessionId,
|
|
634
|
+
pub backing_path: RolloutPath,
|
|
622
635
|
}
|
|
623
636
|
|
|
624
637
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|