@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
|
@@ -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)
|