@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
|
@@ -12,7 +12,6 @@ fn _hermetic_boundary_marker(_: &hermetic_guard::HermeticTestEnv) {}
|
|
|
12
12
|
|
|
13
13
|
use std::collections::{BTreeMap, BTreeSet};
|
|
14
14
|
use std::fs;
|
|
15
|
-
use std::io::Write;
|
|
16
15
|
use std::os::unix::fs::PermissionsExt;
|
|
17
16
|
use std::path::{Path, PathBuf};
|
|
18
17
|
use std::sync::{Arc, Mutex};
|
|
@@ -30,7 +29,7 @@ use team_agent::message_store::MessageStore;
|
|
|
30
29
|
use team_agent::model::enums::{PaneLiveness, Provider};
|
|
31
30
|
use team_agent::model::ids::AgentId;
|
|
32
31
|
use team_agent::model::paths::{runtime_dir, runtime_spec_path};
|
|
33
|
-
use team_agent::provider::{get_adapter,
|
|
32
|
+
use team_agent::provider::{get_adapter, ProviderAdapter};
|
|
34
33
|
use team_agent::state::persist::{load_runtime_state, save_runtime_state};
|
|
35
34
|
use team_agent::transport::{
|
|
36
35
|
AttachOutcome, BackendKind, CaptureRange, CapturedText, InjectPayload, InjectReport,
|
|
@@ -458,60 +457,16 @@ fn start_agent_list_targets_failure_refuses_before_spawn() {
|
|
|
458
457
|
}
|
|
459
458
|
|
|
460
459
|
#[test]
|
|
461
|
-
|
|
462
|
-
fn codex_capture_rejects_old_rollout_with_new_mtime_and_uses_typed_claim_keys() {
|
|
463
|
-
let env = hermetic_guard::HermeticTestEnv::enter("p0-capture");
|
|
464
|
-
let spawn_cwd = env.workspace("spawn-cwd");
|
|
465
|
-
let rollout = write_old_codex_rollout(env.home(), &spawn_cwd);
|
|
466
|
-
fs::OpenOptions::new()
|
|
467
|
-
.append(true)
|
|
468
|
-
.open(&rollout)
|
|
469
|
-
.unwrap()
|
|
470
|
-
.write_all(b"{\"type\":\"event\",\"payload\":{\"append\":\"after spawn\"}}\n")
|
|
471
|
-
.unwrap();
|
|
472
|
-
|
|
473
|
-
let context = CaptureSessionContext {
|
|
474
|
-
agent_id: "developer".to_string(),
|
|
475
|
-
spawn_cwd: spawn_cwd.clone(),
|
|
476
|
-
pane_id: Some("%42".to_string()),
|
|
477
|
-
pane_pid: Some(4242),
|
|
478
|
-
spawned_at: Some("2026-01-02T00:00:00+00:00".to_string()),
|
|
479
|
-
expected_session_id: None,
|
|
480
|
-
provider_projects_root: None,
|
|
481
|
-
};
|
|
482
|
-
let candidates = get_adapter(Provider::Codex)
|
|
483
|
-
.capture_session_candidates(&context, 0)
|
|
484
|
-
.expect("scan codex candidates");
|
|
485
|
-
|
|
460
|
+
fn session_capture_claim_keys_are_typed_not_bare_strings() {
|
|
486
461
|
let capture_src = include_str!(concat!(
|
|
487
462
|
env!("CARGO_MANIFEST_DIR"),
|
|
488
463
|
"/src/provider/session/capture.rs"
|
|
489
464
|
));
|
|
490
|
-
let mut failures = Vec::new();
|
|
491
|
-
if candidates.iter().any(|candidate| {
|
|
492
|
-
candidate
|
|
493
|
-
.captured
|
|
494
|
-
.rollout_path
|
|
495
|
-
.as_ref()
|
|
496
|
-
.is_some_and(|path| path.as_path() == rollout)
|
|
497
|
-
}) {
|
|
498
|
-
failures.push(format!(
|
|
499
|
-
"old rollout was accepted as a fresh candidate: filename/created_at predate spawn, only mutable mtime is new; candidates={candidates:?}"
|
|
500
|
-
));
|
|
501
|
-
}
|
|
502
|
-
if !capture_src.contains("SessionAttributionKey")
|
|
503
|
-
|| capture_src.contains("format!(\"session:{}\"")
|
|
504
|
-
|| capture_src.contains("format!(\"rollout:{}\"")
|
|
505
|
-
{
|
|
506
|
-
failures.push(
|
|
507
|
-
"claimed/captured keys must be typed by provider+team_key+agent_id(+session/rollout), not bare session:/rollout: strings".to_string(),
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
465
|
assert!(
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
466
|
+
capture_src.contains("SessionAttributionKey")
|
|
467
|
+
&& !capture_src.contains("format!(\"session:{}\"")
|
|
468
|
+
&& !capture_src.contains("format!(\"rollout:{}\""),
|
|
469
|
+
"P0 capture contract: claimed/captured keys must be typed by provider+team_key+agent_id(+session/rollout), not bare session:/rollout: strings"
|
|
515
470
|
);
|
|
516
471
|
}
|
|
517
472
|
|
|
@@ -548,7 +503,7 @@ fn abnormal_shell_pane_with_live_delivery_is_not_dead_and_dedupe_ignores_size()
|
|
|
548
503
|
"agents": {
|
|
549
504
|
"architect": {
|
|
550
505
|
"status": "running",
|
|
551
|
-
"provider": "
|
|
506
|
+
"provider": "copilot",
|
|
552
507
|
"agent_id": "architect",
|
|
553
508
|
"window": "architect",
|
|
554
509
|
"pane_id": "%old-architect",
|
|
@@ -618,10 +573,10 @@ fn abnormal_shell_pane_with_live_delivery_is_not_dead_and_dedupe_ignores_size()
|
|
|
618
573
|
|
|
619
574
|
#[test]
|
|
620
575
|
#[serial(env)]
|
|
621
|
-
fn
|
|
576
|
+
fn status_model_uses_effective_copilot_source_not_stale_claude_state() {
|
|
622
577
|
let (_env, workspace) = team_case_with_model("p0-status", &[("developer", "gpt-5.6-sol")]);
|
|
623
578
|
let mut state = load_runtime_state(&workspace).unwrap();
|
|
624
|
-
state["agents"]["developer"]["provider"] = json!("
|
|
579
|
+
state["agents"]["developer"]["provider"] = json!("copilot");
|
|
625
580
|
state["agents"]["developer"]["model"] = json!("claude-opus-4-7");
|
|
626
581
|
save_runtime_state(&workspace, &state).unwrap();
|
|
627
582
|
|
|
@@ -633,7 +588,7 @@ fn status_model_uses_effective_codex_source_not_stale_claude_state() {
|
|
|
633
588
|
let model_source = agent.get("model_source").and_then(Value::as_str);
|
|
634
589
|
assert!(
|
|
635
590
|
model == Some("gpt-5.6-sol") || model_stale || model_source == Some("role"),
|
|
636
|
-
"P0 provider/model projection:
|
|
591
|
+
"P0 provider/model projection: Copilot seat must not render stale Claude model as truth; agent={agent} status={status}"
|
|
637
592
|
);
|
|
638
593
|
}
|
|
639
594
|
|
|
@@ -653,6 +608,7 @@ fn team_case_with_model(
|
|
|
653
608
|
write_team_docs(&workspace, workers);
|
|
654
609
|
write_runtime_spec(&workspace);
|
|
655
610
|
seed_state(&workspace, workers);
|
|
611
|
+
seed_copilot_session_store(env.home(), workers);
|
|
656
612
|
seed_healthy_coordinator(&workspace);
|
|
657
613
|
(env, workspace)
|
|
658
614
|
}
|
|
@@ -661,7 +617,7 @@ fn write_team_docs(workspace: &Path, workers: &[(&str, &str)]) {
|
|
|
661
617
|
fs::create_dir_all(workspace.join("agents")).unwrap();
|
|
662
618
|
fs::write(workspace.join("TEAM.md"), "---\nname: current\nobjective: P0 host co-tenant contract.\nprovider: codex\n---\n").unwrap();
|
|
663
619
|
for (worker, model) in workers {
|
|
664
|
-
let role = format!("---\nname: {worker}\nrole: {worker}\nprovider:
|
|
620
|
+
let role = format!("---\nname: {worker}\nrole: {worker}\nprovider: copilot\nmodel: {model}\nauth_mode: subscription\ndangerously_skip_permissions: false\ntools:\n - mcp_team\n---\n\n{worker}.\n");
|
|
665
621
|
fs::write(workspace.join("agents").join(format!("{worker}.md")), role).unwrap();
|
|
666
622
|
}
|
|
667
623
|
}
|
|
@@ -679,7 +635,7 @@ fn seed_state(workspace: &Path, workers: &[(&str, &str)]) {
|
|
|
679
635
|
let agents = workers
|
|
680
636
|
.iter()
|
|
681
637
|
.map(|(worker, model)| ((*worker).to_string(), json!({
|
|
682
|
-
"status": "running", "provider": "
|
|
638
|
+
"status": "running", "provider": "copilot", "agent_id": worker, "role": worker,
|
|
683
639
|
"model": model, "auth_mode": "subscription", "tools": ["mcp_team"],
|
|
684
640
|
"window": worker, "pane_id": format!("%old-{worker}"), "pane_pid": 10_000,
|
|
685
641
|
"owner_team_id": TEAM,
|
|
@@ -708,16 +664,23 @@ fn seed_healthy_coordinator(workspace: &Path) {
|
|
|
708
664
|
fs::write(coordinator_pid_path(&workspace), pid.to_string()).unwrap();
|
|
709
665
|
}
|
|
710
666
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
let
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
667
|
+
/// Copilot resume backing is the `sessions` row in the hermetic
|
|
668
|
+
/// `$HOME/.copilot/session-store.db`.
|
|
669
|
+
fn seed_copilot_session_store(home: &Path, workers: &[(&str, &str)]) {
|
|
670
|
+
let db = home.join(".copilot").join("session-store.db");
|
|
671
|
+
fs::create_dir_all(db.parent().unwrap()).unwrap();
|
|
672
|
+
let conn = rusqlite::Connection::open(db).unwrap();
|
|
673
|
+
conn.execute_batch(
|
|
674
|
+
"create table if not exists sessions (id text primary key, cwd text, created_at text);",
|
|
675
|
+
)
|
|
676
|
+
.unwrap();
|
|
677
|
+
for (worker, _) in workers {
|
|
678
|
+
conn.execute(
|
|
679
|
+
"insert or replace into sessions(id, cwd, created_at) values (?1, ?2, '2026-01-01T00:00:00Z')",
|
|
680
|
+
rusqlite::params![format!("sess-{worker}"), home.to_string_lossy()],
|
|
681
|
+
)
|
|
682
|
+
.unwrap();
|
|
683
|
+
}
|
|
721
684
|
}
|
|
722
685
|
|
|
723
686
|
#[derive(Clone)]
|
|
@@ -1,45 +1,17 @@
|
|
|
1
|
-
//! Issue #238 lifecycle-side contracts for
|
|
2
|
-
//!
|
|
1
|
+
//! Issue #238 lifecycle-side contracts for effort admission and Pi leader
|
|
2
|
+
//! argument admission. This module deliberately calls the same
|
|
3
3
|
//! lifecycle helpers used by spawn/restart instead of duplicating resolution.
|
|
4
4
|
|
|
5
5
|
#![allow(clippy::expect_used, clippy::panic, clippy::unwrap_used)]
|
|
6
6
|
|
|
7
|
-
use crate::lifecycle::launch::{
|
|
8
|
-
provider_effort_for_spawn, provider_effort_for_spawn_json, provider_effort_from_raw,
|
|
9
|
-
};
|
|
10
7
|
use crate::lifecycle::launch::pi_mcp::parse_pi_leader_args;
|
|
8
|
+
use crate::lifecycle::launch::provider_effort_from_raw;
|
|
11
9
|
use crate::model::enums::{Provider, ProviderEffort};
|
|
12
|
-
use crate::model::yaml::Value as Yaml;
|
|
13
|
-
use serde_json::json;
|
|
14
10
|
|
|
15
11
|
fn args(items: &[&str]) -> Vec<String> {
|
|
16
12
|
items.iter().map(|item| (*item).to_string()).collect()
|
|
17
13
|
}
|
|
18
14
|
|
|
19
|
-
#[test]
|
|
20
|
-
fn r6_spawn_and_persisted_recovery_preserve_codex_effort_literals() {
|
|
21
|
-
for raw in ["max", "ultra"] {
|
|
22
|
-
let yaml_agent = Yaml::Map(vec![(
|
|
23
|
-
"effort".to_string(),
|
|
24
|
-
Yaml::Str(raw.to_string()),
|
|
25
|
-
)]);
|
|
26
|
-
let json_agent = json!({"effort": raw});
|
|
27
|
-
|
|
28
|
-
let direct = provider_effort_from_raw(Some(raw), Provider::Codex)
|
|
29
|
-
.expect("direct lifecycle resolution")
|
|
30
|
-
.expect("Codex effort");
|
|
31
|
-
let spawned = provider_effort_for_spawn(&yaml_agent, Provider::Codex)
|
|
32
|
-
.expect("YAML spawn resolution")
|
|
33
|
-
.expect("spawned Codex effort");
|
|
34
|
-
let recovered = provider_effort_for_spawn_json(&json_agent, Provider::Codex)
|
|
35
|
-
.expect("JSON recovery resolution")
|
|
36
|
-
.expect("recovered Codex effort");
|
|
37
|
-
assert_eq!(direct.as_str(), raw);
|
|
38
|
-
assert_eq!(spawned.as_str(), raw);
|
|
39
|
-
assert_eq!(recovered.as_str(), raw);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
15
|
#[test]
|
|
44
16
|
fn r6_unsupported_ultra_is_not_silently_dropped_on_legacy_provider() {
|
|
45
17
|
let error = provider_effort_from_raw(Some("ultra"), Provider::Fake)
|