@team-agent/installer 0.5.125 → 0.5.127
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/crates/team-agent/src/cli/diagnose.rs +0 -137
- package/crates/team-agent/src/cli/emit.rs +13 -8
- package/crates/team-agent/src/cli/grok_slot.rs +88 -3
- package/crates/team-agent/src/cli/intent/runtime.rs +6 -4
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +55 -10
- package/crates/team-agent/src/cli/mod.rs +35 -29
- package/crates/team-agent/src/cli/models.rs +33 -944
- package/crates/team-agent/src/cli/tests/leader_watch.rs +1 -1
- package/crates/team-agent/src/cli/tests/mod.rs +3 -3
- package/crates/team-agent/src/cli/tests/run_delegation.rs +8 -7
- package/crates/team-agent/src/cli/tests/status_send.rs +2 -2
- package/crates/team-agent/src/compiler/tests.rs +54 -12
- package/crates/team-agent/src/compiler.rs +7 -205
- package/crates/team-agent/src/contract_runtime/backend.rs +97 -38
- package/crates/team-agent/src/contract_runtime/commands.rs +335 -4
- package/crates/team-agent/src/contract_runtime/config.rs +12 -8
- package/crates/team-agent/src/contract_runtime/fork.rs +368 -0
- package/crates/team-agent/src/contract_runtime/framework.rs +8 -13
- package/crates/team-agent/src/contract_runtime/mod.rs +1 -0
- package/crates/team-agent/src/contract_runtime/registry.rs +100 -60
- package/crates/team-agent/src/coordinator/steps/abnormal.rs +45 -5
- package/crates/team-agent/src/coordinator/tests/api_error_recovery.rs +54 -16
- package/crates/team-agent/src/coordinator/tests/energy.rs +4 -4
- package/crates/team-agent/src/coordinator/tests/health_sync.rs +2 -44
- 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/leader/start.rs +1 -1
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +2 -195
- package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +11 -27
- package/crates/team-agent/src/lifecycle/launch/fork_agent.rs +22 -200
- package/crates/team-agent/src/lifecycle/launch/fork_entry.rs +6 -87
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +5 -496
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +74 -244
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +2 -26
- package/crates/team-agent/src/lifecycle/launch/role_source.rs +5 -0
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +26 -51
- package/crates/team-agent/src/lifecycle/launch.rs +3 -34
- package/crates/team-agent/src/lifecycle/profile_launch.rs +18 -373
- package/crates/team-agent/src/lifecycle/restart/common.rs +45 -463
- 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 +0 -2
- package/crates/team-agent/src/lifecycle/role_config.rs +40 -13
- 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 +38 -236
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +8 -320
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +106 -186
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +4 -334
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +19 -15
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +2 -2
- package/crates/team-agent/src/lifecycle/tests/core.rs +33 -58
- package/crates/team-agent/src/lifecycle/tests/f032_startup_prompt_best_effort_red.rs +22 -8
- 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 +3 -51
- 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 +162 -284
- 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/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 +6 -18
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +52 -70
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +4 -157
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +10 -302
- package/crates/team-agent/src/lifecycle/tests/pi_lifecycle_doctor_red.rs +1 -68
- package/crates/team-agent/src/lifecycle/tests/pi_native_mcp_capability_red.rs +1 -19
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +2 -100
- package/crates/team-agent/src/lifecycle/tests/quick_start_worker_readiness_red.rs +15 -14
- 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 -1478
- 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 +2 -254
- 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 +39 -38
- package/crates/team-agent/src/lifecycle/tests/worker_spawn_env_red.rs +42 -97
- package/crates/team-agent/src/lifecycle/tests.rs +0 -7
- package/crates/team-agent/src/lifecycle/types.rs +2 -21
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +15 -17
- package/crates/team-agent/src/messaging/delivery.rs +14 -195
- package/crates/team-agent/src/messaging/delivery_consumption_tests.rs +5 -5
- package/crates/team-agent/src/messaging/tests/dup_inject.rs +68 -69
- package/crates/team-agent/src/messaging/tests/main_preserved.rs +2 -2
- package/crates/team-agent/src/messaging/tests/runtime.rs +5 -5
- package/crates/team-agent/src/messaging/tests/spine.rs +30 -32
- package/crates/team-agent/src/messaging/tests/wave2.rs +13 -20
- package/crates/team-agent/src/provider/adapter.rs +71 -572
- package/crates/team-agent/src/provider/adapters/mod.rs +6 -8
- package/crates/team-agent/src/provider/model_catalog.rs +13 -201
- package/crates/team-agent/src/provider/session/capture.rs +11 -211
- package/crates/team-agent/src/provider/session/context_fork/outcome.rs +8 -24
- package/crates/team-agent/src/provider/session/context_fork.rs +29 -240
- package/crates/team-agent/src/provider/session/mod.rs +2 -3
- package/crates/team-agent/src/provider/session_scan/common.rs +27 -87
- package/crates/team-agent/src/provider/session_scan/pi.rs +1 -34
- package/crates/team-agent/src/provider/session_scan.rs +7 -23
- package/crates/team-agent/src/provider/tests/adapter.rs +66 -204
- package/crates/team-agent/src/provider/tests/command_helpers.rs +3 -29
- package/crates/team-agent/src/provider/tests/idle.rs +0 -68
- package/crates/team-agent/src/provider/types.rs +0 -4
- package/crates/team-agent/src/provider/wire.rs +77 -23
- 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/repository/tests.rs +2 -2
- package/crates/team-agent/src/tmux_backend.rs +4 -3
- package/package.json +4 -4
- package/skills/team-agent/SKILL.md +8 -5
- package/skills/team-agent/command-coverage.json +29 -1
- package/skills/team-agent/docs/reference/team-agent-operator.md +7 -3
- package/skills/team-agent/references/team-agent-operator.md +7 -3
- package/crates/team-agent/src/lifecycle/launch/grok_per_seat.rs +0 -260
- package/crates/team-agent/src/lifecycle/restart/avatar.rs +0 -1805
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +0 -325
- 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/lifecycle/tests/pi_compiler_red.rs +0 -210
- package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +0 -1409
- package/crates/team-agent/src/provider/adapters/claude.rs +0 -78
- package/crates/team-agent/src/provider/adapters/claude_fork.rs +0 -131
- 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/adapters/pi.rs +0 -100
- package/crates/team-agent/src/provider/session/context_fork/claude.rs +0 -123
- package/crates/team-agent/src/provider/session/context_fork/codex.rs +0 -514
- package/crates/team-agent/src/provider/session_scan/claude.rs +0 -523
- package/crates/team-agent/src/provider/session_scan/codex.rs +0 -326
- package/crates/team-agent/src/provider/session_scan/grok.rs +0 -288
- package/crates/team-agent/src/test_support/models_timeout_fixture.rs +0 -144
|
@@ -7,6 +7,7 @@ use team_agent_contract::contract::{
|
|
|
7
7
|
types::InstanceIdentity,
|
|
8
8
|
hooks::{PlanHook, ProviderHooks},
|
|
9
9
|
plan::{CatalogObservation, LaunchEntrypoint, LaunchPlan, ResolvedLaunch},
|
|
10
|
+
session::ResumeBinding,
|
|
10
11
|
types::{ContractError, NativeIdentity, Support},
|
|
11
12
|
};
|
|
12
13
|
use team_agent_contract::kiro::{self, KiroAdapter, KIRO_DESCRIPTOR};
|
|
@@ -21,16 +22,19 @@ use team_agent_contract::runtime::{
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const DESCRIPTORS: &[&ProviderDescriptor] = &[&KIRO_DESCRIPTOR, &CURSOR_DESCRIPTOR, &GROK_BUILD_DESCRIPTOR, &CODEX_DESCRIPTOR, &PI_DESCRIPTOR, &CLAUDE_DESCRIPTOR];
|
|
24
|
-
///
|
|
25
|
-
///
|
|
26
|
-
///
|
|
27
|
-
///
|
|
28
|
-
|
|
29
|
-
///
|
|
30
|
-
///
|
|
31
|
-
/// keeps its key and is never reclassified ([`descriptor`] does not match it).
|
|
25
|
+
/// Declaration names that select a leaf: Cursor's legacy key, its npm
|
|
26
|
+
/// package/public command and its binary; the public names of Claude Code,
|
|
27
|
+
/// Codex, Grok Build and Pi (`pi` is also the default role provider). The
|
|
28
|
+
/// leaf's distinct id is what compiled specs and state carry. A persisted
|
|
29
|
+
/// legacy state row keeps its key and is never reclassified ([`descriptor`]
|
|
30
|
+
/// does not match it). Leaders are not leaves: `team-agent codex|grok|claude|pi`
|
|
31
|
+
/// keep their own launchers.
|
|
32
32
|
const TRANSITION: &[(&str, &ProviderDescriptor)] = &[
|
|
33
33
|
("cursor_agent", &CURSOR_DESCRIPTOR), ("cursor-agent", &CURSOR_DESCRIPTOR), ("agent", &CURSOR_DESCRIPTOR),
|
|
34
|
+
("claude", &CLAUDE_DESCRIPTOR), ("claude_code", &CLAUDE_DESCRIPTOR), ("claude-code", &CLAUDE_DESCRIPTOR),
|
|
35
|
+
("codex", &CODEX_DESCRIPTOR), ("codex_cli", &CODEX_DESCRIPTOR), ("codex-cli", &CODEX_DESCRIPTOR),
|
|
36
|
+
("grok", &GROK_BUILD_DESCRIPTOR),
|
|
37
|
+
("pi", &PI_DESCRIPTOR),
|
|
34
38
|
];
|
|
35
39
|
|
|
36
40
|
/// One provider's public command route: the PATH-selected entry the pane execs
|
|
@@ -186,6 +190,21 @@ impl NativeProvider {
|
|
|
186
190
|
}
|
|
187
191
|
}
|
|
188
192
|
|
|
193
|
+
/// The exact local backing a native new-seat fork reads, for a leaf that
|
|
194
|
+
/// addresses its parent by path (Claude's transcript). None: the native
|
|
195
|
+
/// CLI resolves the parent by ID itself. Pure; the caller checks the file.
|
|
196
|
+
pub fn native_fork_source(
|
|
197
|
+
self,
|
|
198
|
+
runtime: Option<&NativeRuntime>,
|
|
199
|
+
source: &ResumeBinding,
|
|
200
|
+
) -> Result<Option<PathBuf>, ContractError> {
|
|
201
|
+
match (self, runtime) {
|
|
202
|
+
(Self::Claude, Some(NativeRuntime::Claude(runtime))) => claude::transcript_path(runtime.home(), source).map(Some),
|
|
203
|
+
(Self::Claude, _) => Err(ContractError::Mismatch("native runtime provider")),
|
|
204
|
+
_ => Ok(None),
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
189
208
|
pub fn server_key_for(self, identity: &InstanceIdentity) -> Result<String, ContractError> {
|
|
190
209
|
match self {
|
|
191
210
|
Self::GrokBuild => Ok(grok_build::server_key(identity)),
|
|
@@ -340,23 +359,33 @@ pub fn descriptor(key: &str) -> Option<&'static ProviderDescriptor> {
|
|
|
340
359
|
})
|
|
341
360
|
}
|
|
342
361
|
|
|
343
|
-
/// The leaf a role document
|
|
344
|
-
///
|
|
345
|
-
///
|
|
346
|
-
pub fn declared(key: &str
|
|
347
|
-
|
|
348
|
-
.or_else(|| TRANSITION.iter().find(|(retired, _)| *retired == key))
|
|
362
|
+
/// The leaf a role document or CLI value selects: a canonical contract key or
|
|
363
|
+
/// a transition name (Cursor, Claude Code, Codex, Grok Build, Pi). No flag is
|
|
364
|
+
/// needed; `contract_runtime: true` is accepted but selects nothing extra.
|
|
365
|
+
pub fn declared(key: &str) -> Option<&'static ProviderDescriptor> {
|
|
366
|
+
TRANSITION.iter().find(|(retired, _)| *retired == key)
|
|
349
367
|
.map(|(_, descriptor)| *descriptor)
|
|
350
368
|
.or_else(|| descriptor(key))
|
|
351
369
|
}
|
|
352
370
|
|
|
371
|
+
/// The provider name a generated role document records for a leaf. Claude
|
|
372
|
+
/// Code, Codex, Grok Build and Pi keep their public command names, which
|
|
373
|
+
/// declare the leaf; every other leaf is named by its canonical id.
|
|
374
|
+
pub fn public_name(descriptor: &ProviderDescriptor) -> &'static str {
|
|
375
|
+
match descriptor.identity.id {
|
|
376
|
+
"claude_tui" => "claude",
|
|
377
|
+
"codex_tui" => "codex",
|
|
378
|
+
"grok_build" => "grok",
|
|
379
|
+
"pi_tui" => "pi",
|
|
380
|
+
id => id,
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
353
384
|
/// Recognize a misspelled/case-modified contract declaration so it can fail
|
|
354
385
|
/// explicitly instead of accidentally selecting a legacy default provider.
|
|
355
|
-
|
|
356
|
-
pub fn recognizes(key: &str, contract_runtime: bool) -> bool {
|
|
386
|
+
pub fn recognizes(key: &str) -> bool {
|
|
357
387
|
let key = key.trim();
|
|
358
|
-
|
|
359
|
-
|| TRANSITION.iter().any(|(retired, _)| retired.eq_ignore_ascii_case(key))
|
|
388
|
+
TRANSITION.iter().any(|(retired, _)| retired.eq_ignore_ascii_case(key))
|
|
360
389
|
|| DESCRIPTORS.iter().any(|descriptor| {
|
|
361
390
|
descriptor.identity.id.eq_ignore_ascii_case(key)
|
|
362
391
|
|| descriptor
|
|
@@ -375,27 +404,21 @@ mod tests {
|
|
|
375
404
|
fn canonical_cursor_does_not_reclassify_legacy_names() {
|
|
376
405
|
assert_eq!(provider("cursor").unwrap(), NativeProvider::Cursor);
|
|
377
406
|
assert_eq!(provider("kiro").unwrap(), NativeProvider::Kiro);
|
|
378
|
-
|
|
379
|
-
assert!(descriptor(legacy).is_none());
|
|
380
|
-
assert!(!recognizes(legacy, false));
|
|
381
|
-
assert!(provider(legacy).is_err());
|
|
382
|
-
}
|
|
383
|
-
// Every Cursor name declares the leaf; a persisted legacy row keeps its runtime.
|
|
407
|
+
// Every Cursor name declares the leaf; a persisted legacy row is never reclassified.
|
|
384
408
|
for name in ["cursor", "cursor_agent", "cursor-agent", "agent"] {
|
|
385
|
-
assert_eq!(declared(name
|
|
386
|
-
assert_eq!(declared(name, true).unwrap().identity.id, "cursor");
|
|
409
|
+
assert_eq!(declared(name).unwrap().identity.id, "cursor");
|
|
387
410
|
}
|
|
388
411
|
for legacy in ["cursor_agent", "cursor-agent", "agent"] {
|
|
389
412
|
assert!(descriptor(legacy).is_none());
|
|
390
413
|
assert!(provider(legacy).is_err());
|
|
391
414
|
}
|
|
392
|
-
assert!(recognizes(" Cursor_Agent "
|
|
393
|
-
assert!(declared("Cursor_Agent"
|
|
415
|
+
assert!(recognizes(" Cursor_Agent "));
|
|
416
|
+
assert!(declared("Cursor_Agent").is_none());
|
|
394
417
|
assert_eq!(provider("grok_build").unwrap(), NativeProvider::GrokBuild);
|
|
395
|
-
assert!(recognizes(" Grok_Build "
|
|
418
|
+
assert!(recognizes(" Grok_Build "));
|
|
396
419
|
assert!(descriptor("Grok_Build").is_none());
|
|
397
420
|
assert!(GROK_BUILD_DESCRIPTOR.identity.aliases.is_empty());
|
|
398
|
-
assert!(recognizes(" Cursor "
|
|
421
|
+
assert!(recognizes(" Cursor "));
|
|
399
422
|
assert!(descriptor("Cursor").is_none());
|
|
400
423
|
for descriptor in descriptors() {
|
|
401
424
|
assert_eq!(provider(descriptor.identity.id).unwrap().descriptor(), *descriptor);
|
|
@@ -403,24 +426,28 @@ mod tests {
|
|
|
403
426
|
}
|
|
404
427
|
|
|
405
428
|
#[test]
|
|
406
|
-
fn
|
|
429
|
+
fn every_public_codex_name_selects_the_leaf_and_a_legacy_row_is_never_reclassified() {
|
|
407
430
|
assert_eq!(CODEX_DESCRIPTOR.identity.id, "codex_tui");
|
|
408
431
|
assert_eq!(CODEX_DESCRIPTOR.identity.binary, "codex");
|
|
409
432
|
assert_eq!(provider("codex_tui").unwrap(), NativeProvider::Codex);
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
assert!(
|
|
418
|
-
|
|
433
|
+
assert_eq!(declared("codex_tui"), Some(&CODEX_DESCRIPTOR));
|
|
434
|
+
// Every public Codex name declares the leaf without opt-in; a persisted
|
|
435
|
+
// legacy `codex` row keeps its key and is never reclassified.
|
|
436
|
+
for name in ["codex", "codex_cli", "codex-cli"] {
|
|
437
|
+
assert_eq!(declared(name), Some(&CODEX_DESCRIPTOR), "{name}");
|
|
438
|
+
assert!(recognizes(name), "{name}");
|
|
439
|
+
assert!(descriptor(name).is_none(), "{name}");
|
|
440
|
+
assert!(provider(name).is_err(), "{name}");
|
|
441
|
+
}
|
|
442
|
+
for spelling in [" Codex ", "CODEX", "Codex_CLI"] {
|
|
443
|
+
assert!(recognizes(spelling), "{spelling:?}");
|
|
419
444
|
}
|
|
420
|
-
// A case variant
|
|
421
|
-
assert!(declared("Codex"
|
|
422
|
-
|
|
423
|
-
assert_eq!(declared(
|
|
445
|
+
// A case variant is recognized (to fail explicitly), never selected.
|
|
446
|
+
assert!(declared("Codex").is_none());
|
|
447
|
+
assert_eq!(public_name(&CODEX_DESCRIPTOR), "codex");
|
|
448
|
+
assert_eq!(declared(public_name(&CODEX_DESCRIPTOR)), Some(&CODEX_DESCRIPTOR));
|
|
449
|
+
assert_eq!(declared("claude"), Some(&CLAUDE_DESCRIPTOR));
|
|
450
|
+
assert_eq!(declared("grok_build"), Some(&GROK_BUILD_DESCRIPTOR));
|
|
424
451
|
let mut identity = InstanceIdentity {
|
|
425
452
|
scope: team_agent_contract::contract::types::ScopeId::new("scope").unwrap(),
|
|
426
453
|
seat: team_agent_contract::contract::types::SeatId::new("worker").unwrap(),
|
|
@@ -447,15 +474,20 @@ mod tests {
|
|
|
447
474
|
assert_eq!(CLAUDE_DESCRIPTOR.identity.id, "claude_tui");
|
|
448
475
|
assert_eq!(CLAUDE_DESCRIPTOR.identity.binary, "claude");
|
|
449
476
|
assert_eq!(provider("claude_tui").unwrap(), NativeProvider::Claude);
|
|
450
|
-
assert_eq!(declared("claude_tui"
|
|
451
|
-
//
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
assert!(
|
|
456
|
-
assert!(
|
|
477
|
+
assert_eq!(declared("claude_tui"), Some(&CLAUDE_DESCRIPTOR));
|
|
478
|
+
// Every public Claude name declares the leaf; a persisted legacy row
|
|
479
|
+
// keeps its key and is never reclassified.
|
|
480
|
+
for name in ["claude", "claude_code", "claude-code"] {
|
|
481
|
+
assert_eq!(declared(name), Some(&CLAUDE_DESCRIPTOR), "{name}");
|
|
482
|
+
assert!(recognizes(name), "{name}");
|
|
483
|
+
assert!(descriptor(name).is_none(), "{name}");
|
|
484
|
+
assert!(provider(name).is_err(), "{name}");
|
|
457
485
|
}
|
|
458
|
-
assert!(
|
|
486
|
+
assert!(declared("Claude").is_none());
|
|
487
|
+
assert_eq!(public_name(&CLAUDE_DESCRIPTOR), "claude");
|
|
488
|
+
assert_eq!(declared(public_name(&CLAUDE_DESCRIPTOR)), Some(&CLAUDE_DESCRIPTOR));
|
|
489
|
+
assert!(recognizes(" Claude "));
|
|
490
|
+
assert!(recognizes(" Claude_TUI "));
|
|
459
491
|
let mut identity = InstanceIdentity {
|
|
460
492
|
scope: ScopeId::new("scope").unwrap(), seat: SeatId::new("worker").unwrap(),
|
|
461
493
|
instance: InstanceId::new("instance").unwrap(), generation: Generation(1),
|
|
@@ -478,22 +510,23 @@ mod tests {
|
|
|
478
510
|
}
|
|
479
511
|
|
|
480
512
|
#[test]
|
|
481
|
-
fn
|
|
513
|
+
fn bare_pi_selects_the_leaf_and_a_legacy_row_is_never_reclassified() {
|
|
482
514
|
use team_agent_contract::contract::types::{Generation, InstanceId, ScopeId, SeatId};
|
|
483
515
|
assert_eq!(PI_DESCRIPTOR.identity.id, "pi_tui");
|
|
484
516
|
assert_eq!(PI_DESCRIPTOR.identity.binary, "pi");
|
|
485
517
|
assert_eq!(provider("pi_tui").unwrap(), NativeProvider::Pi);
|
|
486
|
-
//
|
|
518
|
+
// `pi` (also the default role provider) declares the leaf; a
|
|
519
|
+
// persisted legacy `pi` row is never reclassified.
|
|
487
520
|
assert!(descriptor("pi").is_none());
|
|
488
521
|
assert!(provider("pi").is_err());
|
|
489
|
-
|
|
490
|
-
assert_eq!(declared("
|
|
491
|
-
assert_eq!(declared("pi_tui", false), Some(&PI_DESCRIPTOR));
|
|
522
|
+
assert_eq!(declared("pi"), Some(&PI_DESCRIPTOR));
|
|
523
|
+
assert_eq!(declared("pi_tui"), Some(&PI_DESCRIPTOR));
|
|
492
524
|
for spelling in ["pi", " Pi ", "PI"] {
|
|
493
|
-
assert!(
|
|
494
|
-
assert!(recognizes(spelling, true), "{spelling:?}");
|
|
525
|
+
assert!(recognizes(spelling), "{spelling:?}");
|
|
495
526
|
}
|
|
496
|
-
assert!(declared("Pi"
|
|
527
|
+
assert!(declared("Pi").is_none());
|
|
528
|
+
assert_eq!(public_name(&PI_DESCRIPTOR), "pi");
|
|
529
|
+
assert_eq!(public_name(&CURSOR_DESCRIPTOR), "cursor");
|
|
497
530
|
let mut identity = InstanceIdentity {
|
|
498
531
|
scope: ScopeId::new("scope").unwrap(), seat: SeatId::new("worker").unwrap(),
|
|
499
532
|
instance: InstanceId::new("instance").unwrap(), generation: Generation(1),
|
|
@@ -517,6 +550,13 @@ mod tests {
|
|
|
517
550
|
#[test]
|
|
518
551
|
fn grok_server_key_is_generation_bound_and_has_no_inspector_fallback() {
|
|
519
552
|
use team_agent_contract::contract::types::{Generation, InstanceId, ScopeId, SeatId};
|
|
553
|
+
// The public `grok` name declares the leaf; a legacy `grok` row is never reclassified.
|
|
554
|
+
assert_eq!(declared("grok"), Some(&GROK_BUILD_DESCRIPTOR));
|
|
555
|
+
assert!(recognizes(" Grok "));
|
|
556
|
+
assert!(declared("Grok").is_none());
|
|
557
|
+
assert!(descriptor("grok").is_none());
|
|
558
|
+
assert!(provider("grok").is_err());
|
|
559
|
+
assert_eq!(public_name(&GROK_BUILD_DESCRIPTOR), "grok");
|
|
520
560
|
let mut identity = InstanceIdentity {
|
|
521
561
|
scope: ScopeId::new("scope").unwrap(), seat: SeatId::new("worker").unwrap(),
|
|
522
562
|
instance: InstanceId::new("instance").unwrap(), generation: Generation(1),
|
|
@@ -219,11 +219,8 @@ pub(crate) fn detect_abnormal_exits(
|
|
|
219
219
|
{
|
|
220
220
|
continue;
|
|
221
221
|
}
|
|
222
|
-
let
|
|
223
|
-
|
|
224
|
-
let manual_recovery_hint = format!(
|
|
225
|
-
"No automatic restart was performed.\nTo recover manually, run: {manual_command}"
|
|
226
|
-
);
|
|
222
|
+
let manual_recovery_hint =
|
|
223
|
+
recovery_hint(agent.agent_id.as_str(), agent.provider, workspace, team.as_str());
|
|
227
224
|
let content = format_abnormal_exit_message(
|
|
228
225
|
&team,
|
|
229
226
|
&agent,
|
|
@@ -1392,6 +1389,27 @@ pid_status: {pid_status}\n\n\
|
|
|
1392
1389
|
)
|
|
1393
1390
|
}
|
|
1394
1391
|
|
|
1392
|
+
/// A pre-upgrade legacy Claude Code, Codex, Grok or Pi seat has no runtime, so
|
|
1393
|
+
/// `start-agent` would be refused; it is stopped/removed and added again.
|
|
1394
|
+
fn recovery_hint(
|
|
1395
|
+
agent_id: &str,
|
|
1396
|
+
provider: crate::model::enums::Provider,
|
|
1397
|
+
workspace: &Path,
|
|
1398
|
+
team: &str,
|
|
1399
|
+
) -> String {
|
|
1400
|
+
let wire = provider_wire(provider);
|
|
1401
|
+
if crate::provider::wire::is_retired_provider(wire) {
|
|
1402
|
+
return format!(
|
|
1403
|
+
"No automatic restart was performed.\n{}",
|
|
1404
|
+
crate::provider::wire::retired_provider_error(wire)
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
format!(
|
|
1408
|
+
"No automatic restart was performed.\nTo recover manually, run: {}",
|
|
1409
|
+
recovery_manual_command(agent_id, workspace, team)
|
|
1410
|
+
)
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1395
1413
|
fn recovery_manual_command(agent_id: &str, workspace: &Path, team: &str) -> String {
|
|
1396
1414
|
let workspace_str = workspace.to_string_lossy();
|
|
1397
1415
|
let shell_workspace = workspace_str.replace('\'', "'\\''");
|
|
@@ -2266,4 +2284,26 @@ mod tests {
|
|
|
2266
2284
|
current_command: None,
|
|
2267
2285
|
}
|
|
2268
2286
|
}
|
|
2287
|
+
|
|
2288
|
+
#[test]
|
|
2289
|
+
fn retired_legacy_rows_get_a_remove_and_re_add_hint_not_a_refused_start_agent() {
|
|
2290
|
+
use crate::model::enums::Provider;
|
|
2291
|
+
let workspace = std::path::Path::new("/tmp/ws");
|
|
2292
|
+
for provider in [Provider::Claude, Provider::ClaudeCode, Provider::Codex, Provider::Grok, Provider::Pi] {
|
|
2293
|
+
let hint = recovery_hint("w1", provider, workspace, "research");
|
|
2294
|
+
assert!(hint.starts_with("No automatic restart was performed.\n"), "{hint}");
|
|
2295
|
+
assert!(
|
|
2296
|
+
hint.contains("seat has no runtime in this release; stop or remove it, then add it again"),
|
|
2297
|
+
"{hint}"
|
|
2298
|
+
);
|
|
2299
|
+
assert!(!hint.contains("start-agent"), "{hint}");
|
|
2300
|
+
}
|
|
2301
|
+
assert!(recovery_hint("w1", Provider::Codex, workspace, "research").ends_with("(provider: codex)"));
|
|
2302
|
+
assert!(recovery_hint("w1", Provider::Grok, workspace, "research").ends_with("(provider: grok)"));
|
|
2303
|
+
let hint = recovery_hint("w1", Provider::Copilot, workspace, "research");
|
|
2304
|
+
assert!(
|
|
2305
|
+
hint.ends_with("To recover manually, run: team-agent start-agent w1 --workspace '/tmp/ws' --team research --force --json"),
|
|
2306
|
+
"{hint}"
|
|
2307
|
+
);
|
|
2308
|
+
}
|
|
2269
2309
|
}
|
|
@@ -3,12 +3,13 @@ use super::*;
|
|
|
3
3
|
use crate::transport::test_support::OfflineTransport;
|
|
4
4
|
|
|
5
5
|
// Removal contract for the retired abnormal-exit automatic recovery path.
|
|
6
|
-
// Abnormal exits remain visible
|
|
7
|
-
//
|
|
6
|
+
// Abnormal exits remain visible with a manual recovery hint (a pre-upgrade
|
|
7
|
+
// legacy row is told to stop/remove and add again, since start-agent refuses
|
|
8
|
+
// it), but coordinator ticks must never schedule or execute lifecycle work.
|
|
8
9
|
|
|
9
10
|
#[test]
|
|
10
11
|
fn abnormal_exit_is_reported_without_auto_recovery_intent_or_action() {
|
|
11
|
-
let case = RecoveryCase::new("reported-no-auto");
|
|
12
|
+
let case = RecoveryCase::new("reported-no-auto", "claude_code");
|
|
12
13
|
case.seed_agent("baseline-429");
|
|
13
14
|
let transport = OfflineTransport::new().with_session_present(true);
|
|
14
15
|
let coord = case.coord(transport.clone());
|
|
@@ -47,21 +48,26 @@ fn abnormal_exit_is_reported_without_auto_recovery_intent_or_action() {
|
|
|
47
48
|
transport.spawn_records()
|
|
48
49
|
);
|
|
49
50
|
|
|
51
|
+
// The claude_code row is a pre-upgrade legacy seat: start-agent would be
|
|
52
|
+
// refused, so the hint names the stop/remove + re-add recovery instead.
|
|
50
53
|
let content = case.latest_leader_notification();
|
|
51
54
|
assert!(
|
|
52
55
|
content.contains("No automatic restart was performed.")
|
|
53
|
-
&& content.contains(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
&& content.contains("
|
|
57
|
-
|
|
58
|
-
"abnormal notification must remain visible and keep the copyable manual recovery command; content={content}"
|
|
56
|
+
&& content.contains(
|
|
57
|
+
"legacy claude seat has no runtime in this release; stop or remove it, then add it again (provider: claude)"
|
|
58
|
+
)
|
|
59
|
+
&& !content.contains("start-agent"),
|
|
60
|
+
"abnormal notification must remain visible and never suggest a refused start-agent; content={content}"
|
|
59
61
|
);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
#[test]
|
|
63
65
|
fn first_turn_death_cannot_enter_auto_respawn_loop_and_manual_start_still_recovers() {
|
|
64
|
-
|
|
66
|
+
// No surviving legacy worker has both an explicit failed-turn fact and a
|
|
67
|
+
// startable runtime: a pre-upgrade codex row keeps its fault reader but
|
|
68
|
+
// has no runtime. Detection runs on that row; manual recovery re-adds the
|
|
69
|
+
// seat on a startable (fake) worker.
|
|
70
|
+
let case = RecoveryCase::new("first-turn-death-no-loop", "codex");
|
|
65
71
|
case.seed_agent("baseline-429");
|
|
66
72
|
let transport = OfflineTransport::new().with_session_present(true);
|
|
67
73
|
let coord = case.coord(transport.clone());
|
|
@@ -106,6 +112,7 @@ fn first_turn_death_cannot_enter_auto_respawn_loop_and_manual_start_still_recove
|
|
|
106
112
|
);
|
|
107
113
|
|
|
108
114
|
case.seed_healthy_coordinator();
|
|
115
|
+
case.readd_as_fake_worker();
|
|
109
116
|
let manual_transport = OfflineTransport::new().with_session_present(true);
|
|
110
117
|
let outcome = crate::lifecycle::start_agent_with_transport(
|
|
111
118
|
&case.root,
|
|
@@ -131,10 +138,11 @@ fn first_turn_death_cannot_enter_auto_respawn_loop_and_manual_start_still_recove
|
|
|
131
138
|
|
|
132
139
|
struct RecoveryCase {
|
|
133
140
|
root: std::path::PathBuf,
|
|
141
|
+
provider: &'static str,
|
|
134
142
|
}
|
|
135
143
|
|
|
136
144
|
impl RecoveryCase {
|
|
137
|
-
fn new(tag: &str) -> Self {
|
|
145
|
+
fn new(tag: &str, provider: &'static str) -> Self {
|
|
138
146
|
let base = std::env::var_os("TEAM_AGENT_TEST_TMP")
|
|
139
147
|
.map(std::path::PathBuf::from)
|
|
140
148
|
.unwrap_or_else(std::env::temp_dir);
|
|
@@ -148,7 +156,7 @@ impl RecoveryCase {
|
|
|
148
156
|
.as_nanos()
|
|
149
157
|
));
|
|
150
158
|
std::fs::create_dir_all(&root).unwrap();
|
|
151
|
-
Self { root }
|
|
159
|
+
Self { root, provider }
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
fn coord(&self, transport: OfflineTransport) -> Coordinator {
|
|
@@ -163,7 +171,8 @@ impl RecoveryCase {
|
|
|
163
171
|
|
|
164
172
|
fn seed_agent(&self, uuid: &str) {
|
|
165
173
|
let rollout = self.rollout();
|
|
166
|
-
std::fs::write(&rollout,
|
|
174
|
+
std::fs::write(&rollout, self.error_line(uuid)).unwrap();
|
|
175
|
+
let model = if self.provider == "codex" { "gpt-5.5" } else { "sonnet" };
|
|
167
176
|
let state = serde_json::json!({
|
|
168
177
|
"active_team_key": "research",
|
|
169
178
|
"team_key": "research",
|
|
@@ -179,8 +188,8 @@ impl RecoveryCase {
|
|
|
179
188
|
"fe-admin": {
|
|
180
189
|
"agent_id": "fe-admin",
|
|
181
190
|
"id": "fe-admin",
|
|
182
|
-
"provider":
|
|
183
|
-
"model":
|
|
191
|
+
"provider": self.provider,
|
|
192
|
+
"model": model,
|
|
184
193
|
"status": "running",
|
|
185
194
|
"window": "fe-admin",
|
|
186
195
|
"rollout_path": rollout,
|
|
@@ -222,6 +231,18 @@ impl RecoveryCase {
|
|
|
222
231
|
crate::state::persist::save_runtime_state(&self.root, &state).unwrap();
|
|
223
232
|
}
|
|
224
233
|
|
|
234
|
+
fn readd_as_fake_worker(&self) {
|
|
235
|
+
let mut state = self.state();
|
|
236
|
+
let agent = &mut state["agents"]["fe-admin"];
|
|
237
|
+
agent["provider"] = serde_json::json!("fake");
|
|
238
|
+
agent["model"] = serde_json::json!("fake");
|
|
239
|
+
// A fake worker has no resume; the re-added seat starts fresh.
|
|
240
|
+
if let Some(agent) = agent.as_object_mut() {
|
|
241
|
+
agent.remove("session_id");
|
|
242
|
+
}
|
|
243
|
+
crate::state::persist::save_runtime_state(&self.root, &state).unwrap();
|
|
244
|
+
}
|
|
245
|
+
|
|
225
246
|
fn seed_healthy_coordinator(&self) {
|
|
226
247
|
let workspace = WorkspacePath::new(self.root.clone());
|
|
227
248
|
let _ = crate::message_store::MessageStore::open(&self.root).unwrap();
|
|
@@ -236,10 +257,17 @@ impl RecoveryCase {
|
|
|
236
257
|
.append(true)
|
|
237
258
|
.open(self.rollout())
|
|
238
259
|
.unwrap();
|
|
239
|
-
file.write_all(
|
|
260
|
+
file.write_all(self.error_line(uuid).as_bytes())
|
|
240
261
|
.unwrap();
|
|
241
262
|
}
|
|
242
263
|
|
|
264
|
+
fn error_line(&self, uuid: &str) -> String {
|
|
265
|
+
match self.provider {
|
|
266
|
+
"codex" => codex_failed_turn_line(uuid),
|
|
267
|
+
_ => claude_api_error_line(uuid),
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
243
271
|
fn rollout(&self) -> std::path::PathBuf {
|
|
244
272
|
self.root.join("rollout-fe-admin.jsonl")
|
|
245
273
|
}
|
|
@@ -292,6 +320,16 @@ fn claude_api_error_line(uuid: &str) -> String {
|
|
|
292
320
|
)
|
|
293
321
|
}
|
|
294
322
|
|
|
323
|
+
fn codex_failed_turn_line(turn_id: &str) -> String {
|
|
324
|
+
format!(
|
|
325
|
+
"{}\n",
|
|
326
|
+
serde_json::json!({
|
|
327
|
+
"method": "turn/completed",
|
|
328
|
+
"params": {"turn": {"id": turn_id, "status": "failed"}}
|
|
329
|
+
})
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
|
|
295
333
|
fn find_event<'a>(events: &'a [serde_json::Value], name: &str) -> Option<&'a serde_json::Value> {
|
|
296
334
|
events
|
|
297
335
|
.iter()
|
|
@@ -25,13 +25,13 @@ fn slice1_stopped_or_missing_agents_do_not_probe_or_emit_capture_failures() {
|
|
|
25
25
|
"session_name": "team-energy",
|
|
26
26
|
"agents": {
|
|
27
27
|
"stopped": {
|
|
28
|
-
"provider": "
|
|
28
|
+
"provider": "copilot",
|
|
29
29
|
"status": "stopped",
|
|
30
30
|
"window": "stopped",
|
|
31
31
|
"pane_id": "%stopped"
|
|
32
32
|
},
|
|
33
33
|
"missing": {
|
|
34
|
-
"provider": "
|
|
34
|
+
"provider": "copilot",
|
|
35
35
|
"status": "running",
|
|
36
36
|
"window": "missing",
|
|
37
37
|
"pane_id": "%missing"
|
|
@@ -306,7 +306,7 @@ fn coordinator(workspace: &Path, transport: EnergyTransport) -> Coordinator {
|
|
|
306
306
|
|
|
307
307
|
fn running_agent(extra: Value) -> Value {
|
|
308
308
|
let mut agent = json!({
|
|
309
|
-
"provider": "
|
|
309
|
+
"provider": "copilot",
|
|
310
310
|
"status": "running",
|
|
311
311
|
"window": "w1",
|
|
312
312
|
"pane_id": "%1",
|
|
@@ -337,7 +337,7 @@ fn pane(pane_id: &str, window: &str) -> PaneInfo {
|
|
|
337
337
|
window_name: Some(WindowName::new(window)),
|
|
338
338
|
pane_index: Some(0),
|
|
339
339
|
tty: None,
|
|
340
|
-
current_command: Some("
|
|
340
|
+
current_command: Some("copilot".to_string()),
|
|
341
341
|
current_path: None,
|
|
342
342
|
active: true,
|
|
343
343
|
pane_pid: Some(1001),
|
|
@@ -230,55 +230,13 @@ fn spine2_sync_health_records_last_output_at() {
|
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
// P1 — capture_missing: an agent with NO session_id but a discoverable transcript under spawn_cwd gets
|
|
234
|
-
// its session_id captured + persisted (real capture_session_id); an agent that already has one is
|
|
235
|
-
// untouched. Golden sessions/capture.py:capture_missing_sessions.
|
|
236
|
-
#[test]
|
|
237
|
-
fn spine2_capture_missing_captures_session_id_for_missing_agent() {
|
|
238
|
-
use std::sync::atomic::{AtomicU64, Ordering};
|
|
239
|
-
static N: AtomicU64 = AtomicU64::new(0);
|
|
240
|
-
let tdir = std::env::temp_dir().join(format!(
|
|
241
|
-
"ta-rs-health-tx-{}-{}",
|
|
242
|
-
std::process::id(),
|
|
243
|
-
N.fetch_add(1, Ordering::Relaxed)
|
|
244
|
-
));
|
|
245
|
-
std::fs::create_dir_all(&tdir).unwrap();
|
|
246
|
-
// lane-046-capture-gap: Claude no-expected_session_id capture now requires
|
|
247
|
-
// positive_agent_id_match (TEAM_AGENT_ID=<id>) OR agent_path_match. Without
|
|
248
|
-
// a worker-identity signal, weak candidates can be leader transcripts and
|
|
249
|
-
// must not be attributed to a worker. The seeded transcript includes the
|
|
250
|
-
// TEAM_AGENT_ID marker for w1.
|
|
251
|
-
std::fs::write(
|
|
252
|
-
tdir.join("session.jsonl"),
|
|
253
|
-
r#"{"type":"user","sessionId":"sess-found","cwd":"x","message":{"content":"TEAM_AGENT_ID=w1 hi"}}"#,
|
|
254
|
-
)
|
|
255
|
-
.unwrap();
|
|
256
|
-
let agents = serde_json::json!({
|
|
257
|
-
"w1": { "provider": "claude_code", "window": "w1", "spawn_cwd": tdir.to_string_lossy() },
|
|
258
|
-
"w2": { "provider": "claude_code", "window": "w2", "session_id": "existing-sess" },
|
|
259
|
-
});
|
|
260
|
-
let (coord, dir) = seeded_health_coord(agents, "");
|
|
261
|
-
coord.tick().expect("tick");
|
|
262
|
-
assert!(
|
|
263
|
-
agent_field(&dir, "w1", "session_id").and_then(|v| v.as_str().map(str::to_string)).is_some(),
|
|
264
|
-
"capture_missing must capture+persist a session_id for an agent with a discoverable transcript; today it's a probe"
|
|
265
|
-
);
|
|
266
|
-
assert_eq!(
|
|
267
|
-
agent_field(&dir, "w2", "session_id")
|
|
268
|
-
.and_then(|v| v.as_str().map(str::to_string))
|
|
269
|
-
.as_deref(),
|
|
270
|
-
Some("existing-sess"),
|
|
271
|
-
"an agent that already has a session_id must be untouched"
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
233
|
// CONTRACT — sync_health runs BEFORE deliver_pending, but turn-level WORKING state must not make an
|
|
276
234
|
// alive worker undeliverable. Busy delivery deferral is lifecycle-only (`state.agents[id].status=="busy"`);
|
|
277
235
|
// activity/agent_health WORKING remains diagnostic turn state.
|
|
278
236
|
#[test]
|
|
279
237
|
fn spine2_sync_health_working_status_delivers_same_tick() {
|
|
280
238
|
let (coord, dir) = seeded_health_coord_with_readiness(
|
|
281
|
-
one_agent("
|
|
239
|
+
one_agent("fake"), "Working (5s · esc to interrupt)", true,
|
|
282
240
|
);
|
|
283
241
|
let store = MessageStore::open(&dir).unwrap();
|
|
284
242
|
let mid = store
|
|
@@ -325,7 +283,7 @@ fn spine2_sync_health_working_status_delivers_same_tick() {
|
|
|
325
283
|
// must be reconciled to this contract.)
|
|
326
284
|
#[test]
|
|
327
285
|
fn contract_working_worker_stays_alive_and_deliverable_in_real_tick() {
|
|
328
|
-
let (coord, dir) = seeded_health_coord(one_agent("
|
|
286
|
+
let (coord, dir) = seeded_health_coord(one_agent("fake"), "Working (5s · esc to interrupt)");
|
|
329
287
|
let store = MessageStore::open(&dir).unwrap();
|
|
330
288
|
let _mid = store
|
|
331
289
|
.create_message(Some("t"), "leader", "w1", "hi", None, true, None)
|
|
@@ -128,8 +128,8 @@ fn tick_swallows_capture_failure_and_still_delivers_to_other_agent() {
|
|
|
128
128
|
&serde_json::json!({
|
|
129
129
|
"session_name": "team-spine",
|
|
130
130
|
"agents": {
|
|
131
|
-
"w1": { "provider": "
|
|
132
|
-
"w2": { "provider": "
|
|
131
|
+
"w1": { "provider": "fake", "status": "stopped", "window": "w1" },
|
|
132
|
+
"w2": { "provider": "fake", "status": "running", "window": "w2" }
|
|
133
133
|
}
|
|
134
134
|
}),
|
|
135
135
|
)
|
|
@@ -170,7 +170,7 @@ fn slice2b_detect_stuck_no_longer_synthesized_by_framework_n35() {
|
|
|
170
170
|
let stale = (chrono::Utc::now() - chrono::Duration::seconds(1000)).to_rfc3339();
|
|
171
171
|
let (coord, dir, _inj) = takeover_coord(serde_json::json!({
|
|
172
172
|
"session_name": "team-h",
|
|
173
|
-
"agents": { "w1": { "provider": "
|
|
173
|
+
"agents": { "w1": { "provider": "copilot" } },
|
|
174
174
|
}));
|
|
175
175
|
seed_agent_health(&dir, "w1", "RUNNING", &stale, Some("team-h"));
|
|
176
176
|
let store = MessageStore::open(&dir).unwrap();
|
|
@@ -197,7 +197,7 @@ fn slice2b_detect_deadlocks_no_longer_synthesized_by_framework_n35() {
|
|
|
197
197
|
let now = chrono::Utc::now().to_rfc3339();
|
|
198
198
|
let (coord, dir, _inj) = takeover_coord(serde_json::json!({
|
|
199
199
|
"session_name": "team-h",
|
|
200
|
-
"agents": { "w1": { "provider": "
|
|
200
|
+
"agents": { "w1": { "provider": "copilot" }, "w2": { "provider": "copilot" } },
|
|
201
201
|
}));
|
|
202
202
|
seed_agent_health(&dir, "w1", "IDLE", &now, Some("team-h"));
|
|
203
203
|
let store = MessageStore::open(&dir).unwrap();
|
|
@@ -274,7 +274,7 @@ fn slice2b_takeover_unarmed_idle_worker_is_never_pinged() {
|
|
|
274
274
|
fn slice2b_unknown_persistent_no_longer_emitted_at_threshold_tick_n35() {
|
|
275
275
|
let (coord, dir, _inj) = takeover_coord(serde_json::json!({
|
|
276
276
|
"session_name": "team-h",
|
|
277
|
-
"agents": { "w1": { "provider": "
|
|
277
|
+
"agents": { "w1": { "provider": "copilot" } },
|
|
278
278
|
"coordinator": { "unknown_ticks": { "w1": 59 } }
|
|
279
279
|
}));
|
|
280
280
|
coord.tick().expect("tick");
|
|
@@ -3538,7 +3538,7 @@ mod tests {
|
|
|
3538
3538
|
std::fs::write(&path, serde_json::json!({
|
|
3539
3539
|
"active_team_key":"current", "session_name":"team-existing-workers",
|
|
3540
3540
|
"spec_path":"/fixture/spec.yml", "team_dir":"/fixture/roles",
|
|
3541
|
-
"agents":{"worker":{"agent_id":"worker","provider":"
|
|
3541
|
+
"agents":{"worker":{"agent_id":"worker","provider":"copilot","status":status}},
|
|
3542
3542
|
"tasks":[{"task_id":"existing-task"}],
|
|
3543
3543
|
}).to_string()).unwrap();
|
|
3544
3544
|
persist_exec_provider_leader_binding(&plan, &workspace, &authority, false).unwrap();
|