@team-agent/installer 0.5.119 → 0.5.121
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 +46 -1
- package/README.zh.md +46 -1
- package/crates/team-agent/src/cli/adapters.rs +11 -0
- package/crates/team-agent/src/cli/arguments.rs +401 -0
- package/crates/team-agent/src/cli/emit.rs +241 -142
- package/crates/team-agent/src/cli/intent/runtime.rs +1175 -0
- package/crates/team-agent/src/cli/intent/runtime_tests.rs +698 -0
- package/crates/team-agent/src/cli/intent/tests.rs +654 -0
- package/crates/team-agent/src/cli/intent.rs +642 -0
- package/crates/team-agent/src/cli/mod.rs +53 -6
- package/crates/team-agent/src/cli/named_address.rs +10 -1
- package/crates/team-agent/src/cli/spec.rs +22 -10
- package/crates/team-agent/src/cli/status_port/brief.rs +117 -16
- package/crates/team-agent/src/cli/tests/base.rs +6 -1
- package/crates/team-agent/src/cli/tests/parser_safety.rs +383 -0
- package/crates/team-agent/src/cli/tests/run_delegation.rs +63 -19
- package/crates/team-agent/src/cli/tests/shutdown_kill_plan.rs +56 -0
- package/crates/team-agent/src/cli/tests/verb_install_skill.rs +3 -2
- package/crates/team-agent/src/cli/tests/verb_profile.rs +3 -1
- package/crates/team-agent/src/contract_runtime/backend.rs +1 -1
- package/crates/team-agent/src/db/message_store.rs +65 -0
- package/crates/team-agent/src/lifecycle/launch/agent_state.rs +8 -0
- package/crates/team-agent/src/lifecycle/launch/cursor_mcp.rs +111 -4
- package/crates/team-agent/src/lifecycle/launch/cursor_mcp_iso.rs +244 -82
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +166 -77
- package/crates/team-agent/src/lifecycle/launch.rs +29 -0
- package/crates/team-agent/src/lifecycle/restart/common.rs +7 -1
- package/crates/team-agent/src/lifecycle/restart.rs +17 -0
- package/crates/team-agent/src/lifecycle/tests/acceptance_b_batch_red.rs +1 -3
- package/crates/team-agent/src/lifecycle/tests/behavioral_diff_264_red.rs +5 -15
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +2 -3
- package/crates/team-agent/src/lifecycle/tests/claude_profile_launch_red.rs +2 -3
- package/crates/team-agent/src/lifecycle/tests/cli_argv_routing_red.rs +10 -2
- package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +8 -1
- package/crates/team-agent/src/lifecycle/tests/clone_fork_copilot_perms_red.rs +3 -2
- package/crates/team-agent/src/lifecycle/tests/communication_mode_runtime_contract_red.rs +6 -9
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +7 -5
- package/crates/team-agent/src/lifecycle/tests/cursor_mcp_overlay.rs +64 -19
- package/crates/team-agent/src/lifecycle/tests/cursor_require_explicit_model_red.rs +5 -2
- package/crates/team-agent/src/lifecycle/tests/cursor_restart_resume_red.rs +34 -10
- package/crates/team-agent/src/lifecycle/tests/grok_effort_argv_red.rs +2 -4
- package/crates/team-agent/src/lifecycle/tests/grok_mcp_overlay_red.rs +3 -4
- package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +5 -4
- package/crates/team-agent/src/lifecycle/tests/grok_restart_resume_red.rs +2 -4
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +78 -36
- package/crates/team-agent/src/lifecycle/tests/phase_b_contracts.rs +8 -4
- package/crates/team-agent/src/lifecycle/tests/phase_golden.rs +6 -12
- package/crates/team-agent/src/lifecycle/tests/pi_fork_session_inheritance_red.rs +4 -0
- package/crates/team-agent/src/lifecycle/tests/startup_latency_contract.rs +1 -3
- package/crates/team-agent/src/lifecycle/tests/status_credential_redaction_contract.rs +7 -0
- package/crates/team-agent/src/lifecycle/tests/subprep_codex_trust_roundtrip_red.rs +47 -4
- package/crates/team-agent/src/lifecycle/tests/team_in_team_identity_scope_red.rs +1 -3
- package/crates/team-agent/src/lifecycle/tests/verify_rs031_window_consistency_red.rs +2 -1
- package/crates/team-agent/src/lifecycle/types.rs +10 -0
- package/crates/team-agent/src/mcp_server/mod.rs +2 -0
- package/crates/team-agent/src/mcp_server/readiness.rs +432 -0
- package/crates/team-agent/src/mcp_server/readiness_tests.rs +242 -0
- package/crates/team-agent/src/mcp_server/wire.rs +96 -11
- package/crates/team-agent/src/messaging/delivery.rs +62 -0
- package/crates/team-agent/src/messaging/tests/dup_inject.rs +41 -1
- package/crates/team-agent/src/provider/adapter.rs +7 -0
- package/crates/team-agent/src/tmux_backend/tests.rs +37 -0
- package/crates/team-agent/src/tmux_backend.rs +8 -1
- package/package.json +4 -4
- package/skills/team-agent/SKILL.md +71 -54
- package/skills/team-agent/command-coverage.json +283 -13
- package/skills/team-agent/docs/reference/team-agent-operator.md +220 -0
- package/skills/team-agent/references/bug-as-artifact-flow.md +1 -1
- package/skills/team-agent/references/recovery-runbook.md +61 -212
- package/skills/team-agent/references/team-agent-operator.md +181 -48
- package/skills/team-agent/references/team-in-team.md +47 -80
|
@@ -1,262 +1,111 @@
|
|
|
1
|
-
# Team Agent
|
|
1
|
+
# Team Agent recovery reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Recover the selected team through public CLI evidence, not guessed bindings or old creation habits. Check that the chosen binary exposes `start`, `stop`, `team` and `agent` help. A reused candidate version string alone does not establish feature support. If missing, ask for an authorized supporting installation; do not switch binaries or rewrite state automatically.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Authority and non-destructive order
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
| Level | Who | Scope |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| L1 | Any agent | Read-only status/doctor/inbox, evidence and current-payload handoff |
|
|
10
|
+
| L2 | Authorized Leader | Context-preserving team/agent lifecycle repair |
|
|
11
|
+
| L3 | Explicitly authorized user/operator | Claim/takeover, intentional context discard, exceptional state/coordinator surgery |
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
A worker must not run L2/L3 because it can read this reference. Explicit child-team delegation still requires original caller admission and parent protection. Follow [nested teams](team-in-team.md).
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
1. Diagnose at L1 in the exact workspace/team.
|
|
16
|
+
2. Prefer proven resume with `--session preserve`.
|
|
17
|
+
3. Stop on unknown, partial or capability refusal; do not reset, retry or adopt a replacement blindly.
|
|
18
|
+
4. Only explicit user/operator authorization can permit context loss or binding surgery. Never broadly kill shared servers or edit another workspace.
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
- `$TEAM` for the active team key when a command needs one
|
|
15
|
-
- `$AGENT_ID` for a worker id
|
|
16
|
-
- `$TASK_ID` for a task id
|
|
20
|
+
Use placeholders, not private paths: `$WORKSPACE`, `$TEAM`, `$AGENT_ID`, `$TASK_ID`.
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
## 1. L1 read-only triage
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
| --- | --- | --- | --- |
|
|
24
|
-
| L1 | Any agent, including a worker | Read-only diagnosis, file report handoff, status/log/result inspection, current-payload E23 fallback only | Low risk, but must not mutate bindings or lifecycle state |
|
|
25
|
-
| L2 | Leader only | Resume-oriented lifecycle repair such as restart of an existing team or worker | A worker running L2 must be treated as `worker.privilege_escalation_attempt` |
|
|
26
|
-
| L3 | User/operator only | Claiming/taking over leader ownership, state surgery, coordinator respawn, fresh/reset | E19/#232 class risk: wrong workspace or pane can steal ownership or destroy context |
|
|
27
|
-
|
|
28
|
-
Spine for every incident:
|
|
29
|
-
|
|
30
|
-
1. Diagnose with L1 read-only commands.
|
|
31
|
-
2. Prefer resume or repair that preserves context.
|
|
32
|
-
3. Use L3 surgery only when the user/operator explicitly approves and the coordinator/write owner is controlled.
|
|
33
|
-
4. Use fresh/reset only as the last resort.
|
|
34
|
-
|
|
35
|
-
Fresh/reset red line:
|
|
36
|
-
|
|
37
|
-
> WARNING: context will be lost. Run this only after diagnostics, resume, and repair have all failed and the user has explicitly typed approval. Do not make it the default. Each use must emit `recovery.context_reset` with source and approval timestamp.
|
|
38
|
-
|
|
39
|
-
## Symptom Index
|
|
40
|
-
|
|
41
|
-
| Symptom | Root cause family | Prescription |
|
|
42
|
-
| --- | --- | --- |
|
|
43
|
-
| Status is confusing, messages/results may be pending, or a worker says it cannot report | Need a safe read-only picture first | §1 L1 Read-Only Triage |
|
|
44
|
-
| Leader pane exists but messages say `leader_not_attached`, `rebind_required`, `team_owner_mismatch`, or leader 被抢 | Leader ownership or receiver binding drift | §2 L3 Claim Or Rebind Leader |
|
|
45
|
-
| A live team must be recovered without losing worker context | Resume/restart path needed | §3 L2 Restart With Resume First |
|
|
46
|
-
| Shutdown/restart cleanup status is ambiguous | Need residue-based truth, not a single `ok` field | §4 L1/L2 Cleanup Verification |
|
|
47
|
-
| MCP tool call fails with `Transport closed` while the worker still has the payload | Provider-owned MCP stdio child died | §5 MCP Transport-Dead Payload Handoff |
|
|
48
|
-
|
|
49
|
-
## 1. L1 Read-Only Triage
|
|
50
|
-
|
|
51
|
-
[contextual: preserved] [level: L1] Any agent may run this. It reads state only and does not mutate the team.
|
|
52
|
-
|
|
53
|
-
Diagnosis:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
team-agent status --workspace "$WORKSPACE" --json --detail
|
|
24
|
+
```sh
|
|
25
|
+
team-agent team status --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
26
|
+
team-agent doctor --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
57
27
|
team-agent inbox "$AGENT_ID" --workspace "$WORKSPACE" --team "$TEAM" -n 3 --json
|
|
58
28
|
```
|
|
59
29
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- `leader_receiver.status`
|
|
63
|
-
- `coordinator.status`
|
|
64
|
-
- agent `status`
|
|
65
|
-
- uncollected results
|
|
66
|
-
- messages stuck in `accepted`, `failed`, or `rebind_required`
|
|
67
|
-
|
|
68
|
-
Resume/repair:
|
|
69
|
-
|
|
70
|
-
- If the answer identifies an L2/L3 condition, do not run the elevated command from a worker pane. Send the evidence to the leader/user.
|
|
71
|
-
- If MCP reporting is broken, write a handoff artifact under the team's artifacts directory and tell the leader the relative path.
|
|
72
|
-
|
|
73
|
-
Last resort:
|
|
74
|
-
|
|
75
|
-
- None. This entry is read-only. Do not turn triage into fresh/reset.
|
|
76
|
-
|
|
77
|
-
RS verification record:
|
|
30
|
+
Status is the concise node projection: use `runtime_status`, `activity`, `health` and the reported attach target without inferring absent internals. An uncertain node also carries `observation_reason` and an explicitly scoped `next_action`; healthy nodes retain the compact existing fields. `--detail` is not a full historical dump. Follow doctor's actual owner/receiver/coordinator findings and recovery actions. Installed is not authenticated; unknown is not proven dead, stopped or unavailable.
|
|
78
31
|
|
|
79
|
-
|
|
80
|
-
- Mac mini LOOP/G1-G4 evidence also captured status and command outputs after restart/shutdown flows; see `g1g4-macmini-confirm-report.md`.
|
|
32
|
+
Accepted/queued messages are not replies. Keep task/result/receiver evidence separate from transport acceptance. If the worker already has a report but MCP is broken, use the payload handoff contingency below rather than guessing it was delivered.
|
|
81
33
|
|
|
82
|
-
|
|
34
|
+
## 2. L3 claim or rebind only when diagnosed
|
|
83
35
|
|
|
84
|
-
|
|
36
|
+
Use only when diagnosis identifies owner/receiver binding drift and the intended Leader pane/workspace/team are verified. Do not use this to bypass a failed creation, resume or caller check:
|
|
85
37
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
[contextual: preserved] [level: L3] User/operator only. A worker must not run this. Misuse can steal the leader binding or recreate E19/#232 style ownership damage.
|
|
89
|
-
|
|
90
|
-
Use this when L1 triage shows the leader pane is live but leader-bound delivery is blocked by ownership or receiver drift.
|
|
91
|
-
|
|
92
|
-
Diagnosis:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
team-agent status --workspace "$WORKSPACE" --json --detail
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Confirm:
|
|
99
|
-
|
|
100
|
-
- The current pane is the intended leader/operator pane.
|
|
101
|
-
- The workspace is the intended team workspace.
|
|
102
|
-
- The target team is the intended `$TEAM` when multiple teams share a workspace.
|
|
103
|
-
|
|
104
|
-
Resume/repair:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
38
|
+
```sh
|
|
107
39
|
team-agent claim-leader --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
108
40
|
```
|
|
109
41
|
|
|
110
|
-
If the previous owner is live
|
|
42
|
+
If the previous owner is live, taking ownership additionally needs explicit user approval and the public confirmation flag:
|
|
111
43
|
|
|
112
|
-
```
|
|
44
|
+
```sh
|
|
113
45
|
team-agent claim-leader --workspace "$WORKSPACE" --team "$TEAM" --confirm --json
|
|
114
46
|
```
|
|
115
47
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
team-agent status --workspace "$WORKSPACE" --json --detail
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
The receiver should be attached and new leader-bound delivery should no longer report `leader_not_attached`.
|
|
123
|
-
|
|
124
|
-
Extreme surgery:
|
|
125
|
-
|
|
126
|
-
- Do not edit binding fields by hand unless a user/operator has approved the exact state repair and the coordinator/write owner is stopped or otherwise controlled.
|
|
127
|
-
|
|
128
|
-
Last resort:
|
|
129
|
-
|
|
130
|
-
- Fresh/reset is not a leader claim repair. Do not use it here.
|
|
131
|
-
|
|
132
|
-
RS verification record:
|
|
133
|
-
|
|
134
|
-
- Dogfood T2 R2: old live team restart/claim/takeover passed from the persistent leader pane. Evidence ledger: `dogfood-execution-ledger-T2.md`, case `R2`.
|
|
135
|
-
- RS #235 bug3 Mac mini run: `claim-leader` and `takeover` claimed live panes and persisted `leader_receiver.status="attached"` with `claimed_via="claim-leader"`. Evidence root id: `7b146ce-bug3-20260606T023011Z`.
|
|
136
|
-
- G1-G4 report: help path for `claim-leader` exited 0 and did not trigger action validation. Evidence: `g1g4-macmini-confirm-report.md`, CR-063.
|
|
137
|
-
|
|
138
|
-
Python 0.2.11 compatibility note:
|
|
139
|
-
|
|
140
|
-
- Python had analogous claim/takeover verbs. Use RS commands above for RS teams.
|
|
141
|
-
|
|
142
|
-
## 3. L2 Restart With Resume First
|
|
143
|
-
|
|
144
|
-
[contextual: partial] [level: L2] Leader only. A worker must not run this. The goal is to preserve session context; resume is always before fresh.
|
|
145
|
-
|
|
146
|
-
Use this when L1 triage shows a team or worker needs lifecycle repair but the state still carries enough runtime/session context to resume.
|
|
147
|
-
|
|
148
|
-
Diagnosis:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
team-agent status --workspace "$WORKSPACE" --json --detail
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Resume/repair:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
team-agent restart "$WORKSPACE" --team "$TEAM" --json
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
A single-worker clean-context reset is not a resume operation. Only after the user explicitly approves discarding that worker's session, use:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
team-agent reset-agent "$AGENT_ID" --workspace "$WORKSPACE" --team "$TEAM" --discard-session --json
|
|
164
|
-
```
|
|
48
|
+
Recheck status/doctor and real Leader-bound delivery afterward. A command receipt alone is not actual client consumption. Do not clear CALLER/Leader identity or manually patch binding fields. State/coordinator surgery requires its own exact authorization and controlled write owner; it is not a normal recovery recipe.
|
|
165
49
|
|
|
166
|
-
|
|
50
|
+
## 3. L2 restart with strict continuation first
|
|
167
51
|
|
|
168
|
-
```
|
|
169
|
-
team-agent
|
|
170
|
-
team-agent
|
|
52
|
+
```sh
|
|
53
|
+
team-agent team restart --session preserve --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
54
|
+
team-agent agent restart "$AGENT_ID" --session preserve --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
171
55
|
```
|
|
172
56
|
|
|
173
|
-
|
|
57
|
+
Run the applicable operation, not both automatically. Single-seat restart preflights continuation/capabilities before stop and starts only after confirmed stop. Known missing capture/backing for existing context refuses before destruction. A genuinely never-used seat may still take its original first-fresh path; that is not evidence of remembered-context restoration.
|
|
174
58
|
|
|
175
|
-
|
|
59
|
+
Team restart leaves explicitly stopped and paused seats alone. To intentionally wake the selected stopped non-paused roster, use:
|
|
176
60
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Last resort:
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
# Last resort only; see red line at top of this reference.
|
|
183
|
-
team-agent restart "$WORKSPACE" --team "$TEAM" --allow-fresh --json
|
|
61
|
+
```sh
|
|
62
|
+
team-agent start --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
184
63
|
```
|
|
185
64
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
RS verification record:
|
|
189
|
-
|
|
190
|
-
- Dogfood T2 R2: restart returned restarted and status after restart showed a running team. Evidence ledger: `dogfood-execution-ledger-T2.md`.
|
|
191
|
-
- Dogfood #249: Rust restart resumed session `019e9ffd-c99c-7b60-bff3-9612ab35bcf5`, post-restart MCP delivery worked, and cleanup residue was 0. Evidence ledger: `dogfood-execution-ledger-T2.md`, case `#249`.
|
|
192
|
-
- G1-G4 Mac mini reconfirmation: restart recovered the same fake team in CR-007, after acknowledge-idle context in CR-021, and in coordinator recovery context in CR-052. Evidence: `g1g4-macmini-confirm-report.md`.
|
|
193
|
-
|
|
194
|
-
Python 0.2.11 compatibility note:
|
|
195
|
-
|
|
196
|
-
- Python restart procedures are deprecated compatibility background only. For RS teams, use the RS commands above.
|
|
197
|
-
|
|
198
|
-
## 4. L1/L2 Cleanup Verification
|
|
199
|
-
|
|
200
|
-
[contextual: partial] [level: L1 for verification, L2 for shutdown command] A worker may inspect cleanup evidence. Only the leader should run lifecycle cleanup.
|
|
65
|
+
This activation is not a repair fallback and must be authorized for the roster. It neither unpauses seats nor guesses around corrupt/spec-only/unknown state. A live no-op is not changed role-file synchronization or business readiness.
|
|
201
66
|
|
|
202
|
-
|
|
67
|
+
New restart defaults to **auto** when the option is omitted: proven resume or only the original legal fresh fallback. Auto can lose remembered context; it is not synonymous with preserve or reset. If strict continuation refuses, retain the receipt and escalate. Only if the user explicitly authorizes the possible loss may the Leader choose:
|
|
203
68
|
|
|
204
|
-
```
|
|
205
|
-
team-agent
|
|
69
|
+
```sh
|
|
70
|
+
team-agent team restart --session auto --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
206
71
|
```
|
|
207
72
|
|
|
208
|
-
|
|
73
|
+
Unsupported native fresh/resume remains a refusal; do not change provider, force legacy fallback or repeatedly retry a partial/unknown generation. Validate actual node identities/session receipts and a natural worker reply before claiming recovery.
|
|
209
74
|
|
|
210
|
-
|
|
211
|
-
- For cleanup verification, inspect whether the team session is gone and whether residual process/session lists are empty in the command output or status evidence.
|
|
75
|
+
## 4. L1 verification / L2 scoped stop
|
|
212
76
|
|
|
213
|
-
Leader
|
|
77
|
+
Only an authorized Leader stops the selected team:
|
|
214
78
|
|
|
215
|
-
```
|
|
216
|
-
team-agent
|
|
79
|
+
```sh
|
|
80
|
+
team-agent stop --workspace "$WORKSPACE" --team "$TEAM" --json
|
|
217
81
|
```
|
|
218
82
|
|
|
219
|
-
|
|
83
|
+
Verify actual typed results, not just exit0:
|
|
84
|
+
- Intended team session/panes and owned native/helper/coordinator processes have the expected terminal outcome.
|
|
85
|
+
- Returned `residuals.sessions`, `residuals.processes` and `residuals.owned_files` are empty, with no unresolved degraded/unknown verification.
|
|
86
|
+
- Where zero-removable-resource acceptance is required, independently check the frozen owned inventory, including sockets, twice. Keep predeclared native archives/evidence separate from live residuals.
|
|
87
|
+
- Shared coordinator/Leader/sibling resources remain protected. A stopped last-team coordinator can be expected, not automatically a new defect.
|
|
220
88
|
|
|
221
|
-
|
|
222
|
-
- `residuals.sessions=[]` and `residuals.processes=[]` are decisive for cleanup.
|
|
223
|
-
- A missing coordinator after a successful cleanup can be expected; do not classify it alone as a product failure.
|
|
89
|
+
Do not manually unlink unknown sockets or kill shared tmux servers to manufacture success. Preserve a failing scene and its ownership/birth evidence.
|
|
224
90
|
|
|
225
|
-
|
|
91
|
+
## 5. MCP transport-dead payload handoff
|
|
226
92
|
|
|
227
|
-
- Do not
|
|
93
|
+
If a worker already owns the current report payload and its MCP stdio transport closes before normal send/report acceptance, preserve the exact payload in a team-scoped handoff artifact and inform the Leader/user through the remaining authorized visible channel. Do not copy credentials or substitute a database write/manual answer for natural Leader consumption.
|
|
228
94
|
|
|
229
|
-
|
|
95
|
+
This L1 contingency is not a general alternate messaging system or permission for worker lifecycle repair. After an authorized restart/resume, return to the three normal MCP tools. Queued notification, server write and actual Leader receipt remain different evidence layers.
|
|
230
96
|
|
|
231
|
-
|
|
97
|
+
## 6. Intentional clean context is not incident recovery
|
|
232
98
|
|
|
233
|
-
|
|
99
|
+
Only after explicit user approval to discard that worker's association:
|
|
234
100
|
|
|
235
|
-
|
|
236
|
-
-
|
|
237
|
-
|
|
238
|
-
Python 0.2.11 compatibility note:
|
|
239
|
-
|
|
240
|
-
- Python cleanup notes may mention direct tmux commands. They are not listed here as RS recovery prescriptions.
|
|
241
|
-
|
|
242
|
-
## 5. MCP Transport-Dead Payload Handoff
|
|
243
|
-
|
|
244
|
-
[contextual: preserved] [level: L1] If the worker already has a leader-bound payload in hand and the MCP transport dies before the normal `send` or `report_result` path can accept it, preserve the payload in a file handoff artifact and ask for leader/user recovery through the visible channel that still works.
|
|
245
|
-
|
|
246
|
-
After restart/resume, use the normal MCP tool path again. Do not treat file handoff as a general message path or as permission to run arbitrary L2/L3 recovery operations.
|
|
247
|
-
|
|
248
|
-
Python 0.2.11 compatibility note:
|
|
249
|
-
|
|
250
|
-
- Python MCP stdio EOF had no durable reconnect. File handoff was the practical fallback.
|
|
101
|
+
```sh
|
|
102
|
+
team-agent agent reset "$AGENT_ID" --workspace "$WORKSPACE" --team "$TEAM" --discard-session --json
|
|
103
|
+
```
|
|
251
104
|
|
|
252
|
-
|
|
105
|
+
Warn that context will be lost. Each intentional fresh/reset must retain `recovery.context_reset` audit evidence with authorization source and timestamp; missing evidence is not permission to fabricate an event or claim approval. Preserve the actual result and do not claim every native archive was erased. Reset is never an automatic response to preserve refusal, permission prompts or partial replacement.
|
|
253
106
|
|
|
254
|
-
|
|
107
|
+
## Compatibility and validation scope
|
|
255
108
|
|
|
256
|
-
-
|
|
257
|
-
- direct live runtime-state injection
|
|
258
|
-
- raw coordinator respawn commands
|
|
259
|
-
- direct tmux-server surgery
|
|
260
|
-
- hard-coded runtime paths
|
|
109
|
+
The old bare/explicit-path `restart` keeps its preserve default; `quick-start`, `shutdown` and suffixed agent commands remain compatibility bridges for existing scripts, not these daily recovery instructions. Do not mechanically rename scripts or rewrite historical receipts as if they used the new surface.
|
|
261
110
|
|
|
262
|
-
|
|
111
|
+
The short start/stop/restart journey has isolated two-Pi lifecycle verification, including live no-op, held-seat preservation, both-seat activation and scoped cleanup. Automated fixtures cover continuation/backing/partial/native/mixed refusals. This is not a fresh all-provider same-session memory or all-platform acceptance claim. Earlier Rust resume/cleanup records retain their original scope in history; Python-only repair, roster cloning, raw state injection and direct server/coordinator surgery are not promoted into validated public recipes.
|
|
@@ -1,10 +1,114 @@
|
|
|
1
1
|
# Team Agent operator reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Canonical source: `docs/reference/team-agent-operator.md`. The two packaged mirrors under `skills/team-agent/docs/reference/` and `skills/team-agent/references/` are byte-identical; update the source and synchronize both, never maintain divergent operating instructions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<!-- command-coverage:normative-start -->
|
|
6
|
+
## Normative command inventory and compatibility accountability
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
The current daily forms below are coverage authorities, not permission to execute every command. Provider/permission choices, scope, caller, session and capability guards in this guide still apply. New forms remain honestly `declared_gap` until the strict source/assertion/negative-twin evidence exists; successful Help or a separate finite journey is not automatic promotion. Every compact-Skill command must belong to exactly one coverage bucket.
|
|
9
|
+
|
|
10
|
+
### Current documented forms
|
|
11
|
+
```text
|
|
12
|
+
team-agent --version
|
|
13
|
+
team-agent agent clone reviewer --as second-reviewer --workspace . --team project-team
|
|
14
|
+
team-agent agent fork reviewer --as continued-reviewer --workspace . --team project-team
|
|
15
|
+
team-agent agent remove reviewer --confirm --workspace . --team project-team
|
|
16
|
+
team-agent agent reset reviewer --discard-session --workspace . --team project-team
|
|
17
|
+
team-agent agent restart reviewer --session preserve --workspace . --team project-team
|
|
18
|
+
team-agent doctor --workspace . --json
|
|
19
|
+
team-agent inbox leader --workspace . --team project-team -n 3
|
|
20
|
+
team-agent models --provider NAME
|
|
21
|
+
team-agent profile init my-api --auth-mode compatible_api --workspace .
|
|
22
|
+
team-agent restart reviewer --workspace . --team project-team
|
|
23
|
+
team-agent route add pi -- --verbose
|
|
24
|
+
team-agent route clear pi
|
|
25
|
+
team-agent route disable
|
|
26
|
+
team-agent route enable
|
|
27
|
+
team-agent route set pi -- --mode rpc
|
|
28
|
+
team-agent route show pi --json
|
|
29
|
+
team-agent route status --json
|
|
30
|
+
team-agent send reviewer "Review the current change and report the main risk." --workspace . --team project-team
|
|
31
|
+
team-agent send reviewer "Review this change" --workspace . --team project-team
|
|
32
|
+
team-agent start --from ./my-team --workspace . --team project-team
|
|
33
|
+
team-agent start --from .team/current --workspace . --team project-team
|
|
34
|
+
team-agent start --help
|
|
35
|
+
team-agent start --workspace . --team project-team
|
|
36
|
+
team-agent start analyst --provider pi --bypass false --prompt "Analyze the proposed change"
|
|
37
|
+
team-agent start auditor --role-file /absolute/path/to/auditor.md
|
|
38
|
+
team-agent start reviewer --effort high --bypass false
|
|
39
|
+
team-agent start reviewer --effort high --bypass false --workspace . --team project-team
|
|
40
|
+
team-agent start reviewer --workspace . --team project-team
|
|
41
|
+
team-agent status --json
|
|
42
|
+
team-agent stop --workspace . --team project-team --json
|
|
43
|
+
team-agent stop reviewer
|
|
44
|
+
team-agent stop reviewer --workspace . --team project-team
|
|
45
|
+
team-agent team --help
|
|
46
|
+
team-agent team restart --session preserve --workspace . --team project-team
|
|
47
|
+
team-agent team restart --workspace . --team project-team
|
|
48
|
+
team-agent team restart --workspace . --team project-team --json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Retained compatibility and negative-probe forms — NOT daily recipes
|
|
52
|
+
The following old argv remain in the closed-world catalog for existing scripts and historical tests. Some intentionally invalid or removed flag combinations are negative probes, not supported operational advice. Existing covered records keep their original evidence and are not renamed to imply new-command coverage.
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
team-agent add-agent <agent> --role-file <file>
|
|
56
|
+
team-agent add-agent reviewer --role-file .team/current/agents/reviewer.md --workspace .
|
|
57
|
+
team-agent approvals
|
|
58
|
+
team-agent approvals <agent_id>
|
|
59
|
+
team-agent approvals [coder]
|
|
60
|
+
team-agent attach-leader
|
|
61
|
+
team-agent claim-leader
|
|
62
|
+
team-agent claude
|
|
63
|
+
team-agent clone-agent <source> --as <new>
|
|
64
|
+
team-agent codex
|
|
65
|
+
team-agent codex --dangerously-bypass-approvals-and-sandbox
|
|
66
|
+
team-agent doctor
|
|
67
|
+
team-agent fork-agent <source> --as <new>
|
|
68
|
+
team-agent inbox <agent_id> -n 3
|
|
69
|
+
team-agent inbox coder -n 3
|
|
70
|
+
team-agent profile doctor <name> --workspace . --json
|
|
71
|
+
team-agent profile init <name> --auth-mode subscription --workspace .
|
|
72
|
+
team-agent profile init claude-default --auth-mode subscription --workspace .
|
|
73
|
+
team-agent profile init codex-default --auth-mode subscription --workspace .
|
|
74
|
+
team-agent profile init deepseek --auth-mode compatible_api --workspace .
|
|
75
|
+
team-agent profile show <name> --workspace . --json
|
|
76
|
+
team-agent profile show deepseek --workspace . --json
|
|
77
|
+
team-agent quick-start
|
|
78
|
+
team-agent quick-start ./roles --team-id alpha
|
|
79
|
+
team-agent quick-start .team/alpha
|
|
80
|
+
team-agent quick-start .team/current
|
|
81
|
+
team-agent quick-start <dir>
|
|
82
|
+
team-agent quick-start <plain-text-team-dir>
|
|
83
|
+
team-agent remove-agent <agent> --workspace . --confirm
|
|
84
|
+
team-agent reset-agent <agent> --discard-session
|
|
85
|
+
team-agent restart
|
|
86
|
+
team-agent restart .
|
|
87
|
+
team-agent restart . --allow-fresh
|
|
88
|
+
team-agent restart . --team <session_name_or_team_name>
|
|
89
|
+
team-agent send --task task_initial "Start"
|
|
90
|
+
team-agent send --watch-result
|
|
91
|
+
team-agent send --watch-result coder "Do the bounded task"
|
|
92
|
+
team-agent send TO MESSAGE
|
|
93
|
+
team-agent send reviewer "..."
|
|
94
|
+
team-agent send reviewer "Review this change"
|
|
95
|
+
team-agent shutdown --workspace . --keep-logs
|
|
96
|
+
team-agent start-agent <agent>
|
|
97
|
+
team-agent start-agent <agent_id> --workspace .
|
|
98
|
+
team-agent start-agent coder --workspace .
|
|
99
|
+
team-agent status
|
|
100
|
+
team-agent status --detail --json
|
|
101
|
+
team-agent status coder
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The exact test binary's root Help complements this marked inventory; it does not authorize model launches or convert untested forms into covered claims.
|
|
105
|
+
<!-- command-coverage:normative-end -->
|
|
106
|
+
|
|
107
|
+
Only the authorized Leader operates team lifecycle. Check the chosen binary's `start --help` and `team --help`; an old installed CLI or a reused candidate version string is not proof of the intuitive surface. Do not silently install, switch binaries or copy credentials to make an example work.
|
|
108
|
+
|
|
109
|
+
## Configure once, use start/stop
|
|
110
|
+
|
|
111
|
+
A source directory contains `TEAM.md` and at least one role:
|
|
8
112
|
|
|
9
113
|
```text
|
|
10
114
|
my-team/
|
|
@@ -12,76 +116,105 @@ my-team/
|
|
|
12
116
|
agents/reviewer.md
|
|
13
117
|
```
|
|
14
118
|
|
|
15
|
-
`TEAM.md`
|
|
119
|
+
The body of `TEAM.md` is the team goal. Each role body contains instructions; the filename stem is the default agent ID. Record the user's provider and boolean bypass decisions for a new plan. From the native Leader tool context in the workspace:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
team-agent start --from ./my-team --workspace . --team project-team
|
|
123
|
+
team-agent start --workspace . --team project-team
|
|
124
|
+
team-agent send reviewer "Review the current change and report the main risk." --workspace . --team project-team
|
|
125
|
+
team-agent inbox leader --workspace . --team project-team -n 3
|
|
126
|
+
team-agent stop --workspace . --team project-team --json
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Creation needs complete configuration; start is not automatic template generation or state repair. Later start starts stopped non-paused members, including explicitly stopped members, and leaves verified live/drift-free instances unchanged. A no-op does not synchronize role bodies, apply new launch settings or prove tool/business readiness. A queued send is not completion; wait for a natural reply/result.
|
|
130
|
+
|
|
131
|
+
## Scope and deterministic targets
|
|
16
132
|
|
|
17
|
-
|
|
133
|
+
- Pin `--workspace PATH` and `--team KEY` when operating outside the selected team, across workspaces or when several teams exist.
|
|
134
|
+
- `start reviewer.v2` is an agent, even if that directory exists. Team sources use `--from DIR`, `team start DIR` or explicit path syntax such as `./my-team`.
|
|
135
|
+
- `restart ID` selects an agent; a same-named directory causes conservative refusal. `agent restart ID` removes the ambiguity.
|
|
136
|
+
- Explicit missing paths, unknown flags, conflicts and extra arguments refuse; do not try a guessed CWD or takeover instead.
|
|
137
|
+
- `--dry-run` on start/restart has no lifecycle effects. A proposed plan is not final lock-held admission. No eligible targets returns nonzero with the selected scope and skipped seats, not a successful start.
|
|
138
|
+
|
|
139
|
+
## User decisions and compatibility
|
|
140
|
+
|
|
141
|
+
Do not silently pick provider, model, effort or bypass. False preserves native permissions; it is not a read-only or sandbox guarantee. Use supported `models --provider NAME` discovery and retain exact model IDs.
|
|
142
|
+
|
|
143
|
+
Traditional minimal Markdown remains accepted by the original compiler. Its compatibility interpretation is **not a default for a new user plan**: provider defaults to Pi, bypass to false, and unset model/effort are left to the provider. Team Agent does not infer a role model from TEAM defaults. Legacy explicit TEAM provider_effort remains supported for non-Pi roles; do not invent an effort for unspecified roles.
|
|
144
|
+
|
|
145
|
+
Supported role metadata:
|
|
146
|
+
- `agent_id` (legacy `name`) and `role` identify the seat.
|
|
147
|
+
- `provider`, `model`, `effort`, and boolean `dangerously_skip_permissions` select intentional launch settings.
|
|
148
|
+
- `auth_mode` and `profile` refer to local provider configuration.
|
|
149
|
+
- `communication_mode` selects an admitted communication contract.
|
|
150
|
+
- Historical `tools`, `permission_mode` and `label` do not restrict worker tools or permissions.
|
|
151
|
+
|
|
152
|
+
## Add or wake with start
|
|
153
|
+
|
|
154
|
+
A RoleOnly seat can be registered from its complete role file. A genuinely absent ID needs a complete file or explicit provider/bypass choices. These Pi/false values are examples of user decisions, not defaults:
|
|
18
155
|
|
|
19
156
|
```sh
|
|
20
|
-
team-agent
|
|
21
|
-
team-agent
|
|
22
|
-
team-agent inbox reviewer -n 3
|
|
23
|
-
# The role file already records the user's provider and bypass choices.
|
|
24
|
-
team-agent add-agent analyst --role-file /absolute/path/to/analyst.md
|
|
25
|
-
team-agent shutdown --workspace .
|
|
157
|
+
team-agent start auditor --role-file /absolute/path/to/auditor.md
|
|
158
|
+
team-agent start analyst --provider pi --bypass false --prompt "Analyze the proposed change"
|
|
26
159
|
```
|
|
27
160
|
|
|
28
|
-
|
|
161
|
+
An imported external role goes into this team's `agents/ID.md`; the original stays untouched. A file already at that destination is used in place. Equal file/CLI definitions are accepted; conflicting provider/model/effort/bypass/prompt/profile values refuse before writes/startup. Omitted model, effort, profile and role body remain unchanged.
|
|
162
|
+
|
|
163
|
+
Use `agent add` when explicitly requesting strict add-only behavior. It creates and starts a new seat but refuses an occupied ID, including stopped seats. Its disaster-recovery `--force` still requires a positively dead registered old pane and no live target cohort; a live or unknown target refuses. Force is not a role-update or routine restart shortcut.
|
|
164
|
+
|
|
165
|
+
## Change a registered seat
|
|
29
166
|
|
|
30
|
-
|
|
167
|
+
```sh
|
|
168
|
+
team-agent stop reviewer --workspace . --team project-team
|
|
169
|
+
team-agent start reviewer --effort high --bypass false --workspace . --team project-team
|
|
170
|
+
```
|
|
31
171
|
|
|
32
|
-
|
|
172
|
+
Stop first before applying edited instructions or launch settings. A running seat with requested changes or known drift refuses rather than claiming a successful no-op. `--prompt` replaces permanent role instructions, not a one-time task; send one-time work with `send`. `--bypass` requires explicit true/false. Matching provider is allowed, but changing engines, even by file edits, is refused; use a new ID.
|
|
33
173
|
|
|
34
|
-
|
|
35
|
-
|---|---|
|
|
36
|
-
| `provider` | `pi` |
|
|
37
|
-
| `model` | Unset by Team Agent; leave model selection to the provider |
|
|
38
|
-
| `effort` | Unset by Team Agent; leave effort selection to the provider |
|
|
39
|
-
| `dangerously_skip_permissions` | `false`; preserve native permissions |
|
|
174
|
+
The original role/spec transaction and provider admission remain authoritative. A failure is not an applied update; never assume a partial/unknown native replacement was rolled back or is safe to retry. Inspect the exact scoped receipt, status and doctor first.
|
|
40
175
|
|
|
41
|
-
|
|
176
|
+
## Restart and session policy
|
|
42
177
|
|
|
43
|
-
|
|
178
|
+
```sh
|
|
179
|
+
team-agent restart reviewer --workspace . --team project-team
|
|
180
|
+
team-agent team restart --workspace . --team project-team
|
|
181
|
+
# Strict continuation: refuse before stop if known continuation evidence is absent.
|
|
182
|
+
team-agent agent restart reviewer --session preserve --workspace . --team project-team
|
|
183
|
+
team-agent team restart --session preserve --workspace . --team project-team
|
|
184
|
+
```
|
|
44
185
|
|
|
45
|
-
|
|
46
|
-
- `provider`, `model`, and `effort` to explicitly choose supported provider settings.
|
|
47
|
-
- `auth_mode` and `profile` to use a provider profile.
|
|
48
|
-
- `dangerously_skip_permissions: true` or `false` records the user's explicit permission choice. False preserves native permissions; it is not a read-only or sandbox guarantee.
|
|
49
|
-
- `communication_mode` to select a supported worker communication contract.
|
|
186
|
+
New agent/team restart defaults to **auto**: proven resume when possible, otherwise only the provider's existing legal fresh path. Auto is not a guarantee of saved memory, reset permission or a fallback around native capability refusal. Preserve requests strict continuation. The old bare/explicit-path restart bridge retains its original preserve default and output.
|
|
50
187
|
|
|
51
|
-
|
|
188
|
+
Single-agent restart checks scope, role/session backing and capabilities before stop; only confirmed stop allows start. On partial failure, report actual completed steps and inspect; do not blindly reset or replay. Team restart does not reactivate explicitly stopped or paused seats. Whole-team start intentionally activates the selected non-paused roster; neither command silently unpauses.
|
|
52
189
|
|
|
53
|
-
##
|
|
190
|
+
## Explicit agent operations
|
|
54
191
|
|
|
55
|
-
|
|
192
|
+
```sh
|
|
193
|
+
team-agent agent remove reviewer --confirm --workspace . --team project-team
|
|
194
|
+
# Only after explicit authorization to discard this worker's context:
|
|
195
|
+
team-agent agent reset reviewer --discard-session --workspace . --team project-team
|
|
196
|
+
team-agent agent clone reviewer --as second-reviewer --workspace . --team project-team
|
|
197
|
+
team-agent agent fork reviewer --as continued-reviewer --workspace . --team project-team
|
|
198
|
+
```
|
|
56
199
|
|
|
57
|
-
|
|
200
|
+
Remove/reset/clone/fork retain original confirmation, ownership and provider-capability gates. Clone copies configuration; fork is a new-seat continuation only where admitted. `--in-place` is unsupported. Unsupported native lifecycle is a refusal, never permission to silently use a legacy engine. Reset does not erase every native provider archive and must not be incident recovery's first response.
|
|
58
201
|
|
|
59
202
|
## Profiles and custom models
|
|
60
203
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Create a local profile, then edit its generated file on the user's machine:
|
|
204
|
+
Profiles keep authentication/endpoints outside role text. Imported roles use this team's/workspace's profiles, not the external role's original directory. Prepare a named profile locally through public commands; never discover, copy or print external credentials:
|
|
64
205
|
|
|
65
206
|
```sh
|
|
66
207
|
team-agent profile init my-api --auth-mode compatible_api --workspace .
|
|
67
208
|
```
|
|
68
209
|
|
|
69
|
-
|
|
210
|
+
A role may explicitly reference `auth_mode: compatible_api` and `profile: my-api`, with the user's chosen provider/bypass. Profile model applies only when the role has no explicit override. Subscription and custom-API capabilities differ; follow actual provider admission, not a generic promise.
|
|
70
211
|
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
provider: claude_code
|
|
74
|
-
dangerously_skip_permissions: false
|
|
75
|
-
auth_mode: compatible_api
|
|
76
|
-
profile: my-api
|
|
77
|
-
---
|
|
78
|
-
Use the configured provider to complete the assigned task.
|
|
79
|
-
```
|
|
212
|
+
## Observe and finish
|
|
80
213
|
|
|
81
|
-
|
|
214
|
+
`status` / `team status` expose the concise node projection; `--detail` does not restore historical internal dumps. Use `doctor` for diagnosis. Check actual readiness and returned recovery actions; unknown evidence is not a stopped/live proof. Stop with `stop --workspace PATH --team KEY --json` and verify scoped residual sessions, processes and owned files. Protect parent/sibling/shared resources.
|
|
82
215
|
|
|
83
|
-
|
|
216
|
+
Workers have only `send_message`, `report_result` and optional `get_team_status`. Report completion through `report_result`; do not promote a worker to lifecycle operator. See [nested teams](https://github.com/Florious95/team-agent/blob/main/skills/team-agent/references/team-in-team.md) and [recovery](https://github.com/Florious95/team-agent/blob/main/skills/team-agent/references/recovery-runbook.md).
|
|
84
217
|
|
|
85
|
-
|
|
218
|
+
## Legacy command bridges
|
|
86
219
|
|
|
87
|
-
|
|
220
|
+
Existing scripts may retain `quick-start`, `shutdown`, and `add-agent/start-agent/stop-agent/remove-agent/reset-agent/clone-agent/fork-agent`. These are compatibility interfaces, not the daily workflow. Use the short/team/agent forms above for new instructions. Do not mechanically rename scripts: legacy start refuses a live seat, new start can prove a no-op; bare/explicit-path legacy restart preserves its default. Old normal command output and failure evidence remain authoritative.
|