@team-agent/installer 0.5.101 → 0.5.103

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.
Files changed (49) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/crates/team-agent/src/cli/emit.rs +2 -1
  4. package/crates/team-agent/src/cli/models.rs +92 -226
  5. package/crates/team-agent/src/cli/spec.rs +1 -1
  6. package/crates/team-agent/src/cli/tests/main_preserved.rs +0 -74
  7. package/crates/team-agent/src/compiler/tests.rs +20 -23
  8. package/crates/team-agent/src/compiler.rs +49 -65
  9. package/crates/team-agent/src/coordinator/tests/s3_bounded.rs +16 -48
  10. package/crates/team-agent/src/leader/start.rs +1 -14
  11. package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +37 -161
  12. package/crates/team-agent/src/lifecycle/launch/spawn.rs +1 -1
  13. package/crates/team-agent/src/lifecycle/restart/common.rs +1 -1
  14. package/crates/team-agent/src/lifecycle/tests/host_cotenant_death_p0_contract.rs +0 -28
  15. package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +11 -9
  16. package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +8 -401
  17. package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +2 -2
  18. package/crates/team-agent/src/lifecycle/worker_command_context.rs +22 -8
  19. package/crates/team-agent/src/mcp_server/helpers.rs +0 -16
  20. package/crates/team-agent/src/mcp_server/lifecycle_tools/mod.rs +2 -7
  21. package/crates/team-agent/src/mcp_server/lifecycle_tools/state_status.rs +1 -127
  22. package/crates/team-agent/src/mcp_server/mod.rs +7 -12
  23. package/crates/team-agent/src/mcp_server/tests/scoped.rs +1 -132
  24. package/crates/team-agent/src/mcp_server/tests/send.rs +1 -93
  25. package/crates/team-agent/src/mcp_server/tests/tools.rs +0 -61
  26. package/crates/team-agent/src/mcp_server/tests/wire.rs +6 -51
  27. package/crates/team-agent/src/mcp_server/tests.rs +4 -200
  28. package/crates/team-agent/src/mcp_server/tools.rs +5 -396
  29. package/crates/team-agent/src/mcp_server/types.rs +3 -36
  30. package/crates/team-agent/src/mcp_server/wire.rs +2 -223
  31. package/crates/team-agent/src/messaging/leader_receiver.rs +1 -1
  32. package/crates/team-agent/src/messaging/mod.rs +2 -2
  33. package/crates/team-agent/src/messaging/results.rs +11 -42
  34. package/crates/team-agent/src/messaging/scheduler.rs +2 -205
  35. package/crates/team-agent/src/messaging/tests/basic.rs +0 -31
  36. package/crates/team-agent/src/messaging/tests/main_preserved.rs +0 -73
  37. package/crates/team-agent/src/messaging/tests/runtime.rs +0 -26
  38. package/crates/team-agent/src/messaging/types.rs +0 -20
  39. package/crates/team-agent/src/model/spec.rs +14 -18
  40. package/crates/team-agent/src/provider/mod.rs +1 -0
  41. package/crates/team-agent/src/provider/model_catalog.rs +650 -0
  42. package/crates/team-agent/src/state/repository/tests.rs +1 -16
  43. package/crates/team-agent/src/state/repository.rs +1 -33
  44. package/package.json +4 -4
  45. package/skills/team-agent/SKILL.md +5 -5
  46. package/skills/team-agent/command-coverage.json +7 -0
  47. package/skills/team-agent/references/team-agent-operator.md +24 -116
  48. package/skills/team-agent/references/team-in-team.md +4 -19
  49. package/crates/team-agent/src/mcp_server/lifecycle_tools/agent_ops.rs +0 -484
@@ -161,10 +161,6 @@ impl<'a> StateRepository<'a> {
161
161
  #[cfg(test)]
162
162
  test_support::before_commit();
163
163
  let team_key = match intent {
164
- // Assignment's existing reconcile helper updates the root task
165
- // array and the explicit Team array independently (legacy parity).
166
- StateWriteIntent::McpAssignTask { .. } => None,
167
- StateWriteIntent::McpUpdateStateNote { team_key } => team_key,
168
164
  StateWriteIntent::ResultCollection { owner_team_id } => owner_team_id,
169
165
  StateWriteIntent::ForkAgent { team_key, .. } => Some(team_key),
170
166
  _ => {
@@ -517,16 +513,6 @@ pub enum StateWriteIntent<'a> {
517
513
  CoordinatorConptyShim {
518
514
  team_key: Option<&'a str>,
519
515
  },
520
- McpAssignTask {
521
- team_key: Option<&'a str>,
522
- task_id: &'a str,
523
- },
524
- McpLifecycleAgentOps {
525
- team_key: Option<&'a str>,
526
- },
527
- McpUpdateStateNote {
528
- team_key: Option<&'a str>,
529
- },
530
516
  MessagingDeliveryState {
531
517
  owner_team_id: Option<&'a str>,
532
518
  },
@@ -537,9 +523,6 @@ pub enum StateWriteIntent<'a> {
537
523
  ResultCollection {
538
524
  owner_team_id: Option<&'a str>,
539
525
  },
540
- SchedulerSuppression {
541
- owner_team_id: Option<&'a str>,
542
- },
543
526
  TaskRepair {
544
527
  team_key: Option<&'a str>,
545
528
  },
@@ -735,15 +718,6 @@ fn route_direct(
735
718
  // CoordinatorConptyShim -> root save
736
719
  // (coordinator/conpty_shim.rs:426/674).
737
720
  StateWriteIntent::CoordinatorConptyShim { .. } => helper_write_root(workspace, state),
738
- // McpAssignTask uses the reapply variant today; direct save routes
739
- // to the root helper for parity.
740
- StateWriteIntent::McpAssignTask { .. } => helper_write_root(workspace, state),
741
- // McpLifecycleAgentOps -> root save
742
- // (mcp_server/lifecycle_tools/agent_ops.rs:385).
743
- StateWriteIntent::McpLifecycleAgentOps { .. } => helper_write_root(workspace, state),
744
- // McpUpdateStateNote -> root save
745
- // (mcp_server/lifecycle_tools/state_status.rs:29/69).
746
- StateWriteIntent::McpUpdateStateNote { .. } => helper_write_root(workspace, state),
747
721
  // MessagingDeliveryState direct writes cover team-scoped, root
748
722
  // fallback, and root (messaging/delivery.rs:2356/2358/2361).
749
723
  StateWriteIntent::MessagingDeliveryState { owner_team_id } => match owner_team_id {
@@ -766,8 +740,6 @@ fn route_direct(
766
740
  Some(_) => helper_write_team_scoped(workspace, state),
767
741
  None => helper_write_root(workspace, state),
768
742
  },
769
- // SchedulerSuppression -> root save (messaging/scheduler.rs:259).
770
- StateWriteIntent::SchedulerSuppression { .. } => helper_write_root(workspace, state),
771
743
  // TaskRepair -> `save_team_scoped_state` (cli/adapters.rs:675).
772
744
  StateWriteIntent::TaskRepair { .. } => helper_write_team_scoped(workspace, state),
773
745
  // FakeE2eSeed / SelfMigration are diagnostic seams. The current
@@ -798,9 +770,6 @@ fn reapply_scope(intent: &StateWriteIntent<'_>) -> ReapplyScope {
798
770
  owner_team_id: Some(_),
799
771
  }
800
772
  | StateWriteIntent::CoordinatorTick { .. }
801
- | StateWriteIntent::McpUpdateStateNote {
802
- team_key: Some(_),
803
- }
804
773
  ) {
805
774
  ReapplyScope::Team
806
775
  } else {
@@ -817,8 +786,7 @@ fn route_reapply<F>(
817
786
  where
818
787
  F: FnOnce(&mut Value),
819
788
  {
820
- if matches!(&intent, StateWriteIntent::McpAssignTask { .. }
821
- | StateWriteIntent::McpUpdateStateNote { .. } | StateWriteIntent::ResultCollection { .. })
789
+ if matches!(&intent, StateWriteIntent::ResultCollection { .. })
822
790
  {
823
791
  return StateRepository::new(workspace).commit(intent, reapply).map(|_| ());
824
792
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-agent/installer",
3
- "version": "0.5.101",
3
+ "version": "0.5.103",
4
4
  "description": "npx installer for Team Agent",
5
5
  "keywords": [
6
6
  "codex",
@@ -20,9 +20,9 @@
20
20
  "team-agent-installer": "npm/install.mjs"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@team-agent/cli-darwin-arm64": "0.5.101",
24
- "@team-agent/cli-darwin-x64": "0.5.101",
25
- "@team-agent/cli-linux-x64": "0.5.101"
23
+ "@team-agent/cli-darwin-arm64": "0.5.103",
24
+ "@team-agent/cli-darwin-x64": "0.5.103",
25
+ "@team-agent/cli-linux-x64": "0.5.103"
26
26
  },
27
27
  "scripts": {
28
28
  "postinstall": "node npm/bincheck.mjs",
@@ -12,14 +12,14 @@ team-agent --version
12
12
  team-agent --help
13
13
  team-agent doctor --help
14
14
  ```
15
- **Launch** from a tmux-addressable pane: `team-agent claude` or `team-agent codex`, then `team-agent quick-start .team/current`. Do not start a real team from a naked terminal; workers use independent background windows on the workspace-scoped tmux server.
15
+ **Launch** from a tmux-addressable pane: `team-agent claude` or `team-agent codex`, then `team-agent quick-start .team/current`. For a plain-text team directory, use `team-agent quick-start <plain-text-team-dir>`. Do not start a real team from a naked terminal; workers use independent background windows on the workspace-scoped tmux server.
16
16
  **Operate**
17
17
  - Dispatch: `team-agent send TO MESSAGE` (positional TO; `--watch-result` is deprecated). After success, do not poll with `sleep` / `status` / `inbox` / `collect`. TO has two co-equal logical forms: an in-team short name (`team-agent send reviewer "..."`) and a fully qualified `<workspace>::<team>/<agent>`. Use the qualified form across workspaces.
18
18
  - Inspect: `team-agent status` / `status --json`; `ok: true` plus `ready: false` is not a crash.
19
19
  - Lifecycle: `restart .` resumes a stopped team; `add-agent NAME --role-file FILE` adds or `--force` recreates one worker; `shutdown --workspace .` stops. Do not shutdown the team to add a worker.
20
- - Roles: every `agents/*.md` must declare boolean `dangerously_skip_permissions`. Never rewrite user-supplied model ids or read `.env` files.
20
+ - Documents: `TEAM.md` and `agents/*.md` may be plain text/Markdown with no frontmatter; the whole team body is its objective and the whole role body is the prompt. Default worker id is the filename stem, provider `pi`, model `openai-codex/gpt-6-luna`, effort `max`, and bypass enabled. Valid optional frontmatter can override supported metadata.
21
21
  - On a structured failure `action`, run that action first, then stop. Do not guess flags. `coordinator.session_missing` is self-healing; re-check `status --json`, do not shutdown.
22
- The current user-facing agent is the leader (orchestrate only). Workers call `report_result` exactly once. Nested teams: `references/team-in-team.md`.
22
+ The current user-facing agent is the leader (orchestrate only). Worker MCP exposes exactly `send_message`, `report_result`, and optional `get_team_status`; lifecycle management stays on the authorized native CLI. Workers call `report_result` exactly once. Nested teams: `references/team-in-team.md`.
23
23
  ## Provider Capability Matrix
24
24
  See `references/team-agent-operator.md` for Claude / Codex / Copilot / Gemini / fake. `quick-start` / `restart` / `claim-leader` JSON is compact by default; pass `--detail` only for internal diagnostics.
25
25
  | Provider | Resume | Turn-state detection | Per-worker model override | Team Agent fork |
@@ -30,8 +30,8 @@ See `references/team-agent-operator.md` for Claude / Codex / Copilot / Gemini /
30
30
  Grok / `cursor_agent` have no JSONL turn-state reader (classify → Unknown). Pi `fork-agent SOURCE --as TARGET` requires a captured Pi subscription source and reports both session ids plus the target backing path; it does not mutate the source session.
31
31
  ## Provider Prep
32
32
  ### Cursor provider notes
33
- Frontmatter: `provider: cursor_agent` (not `cursor`; launcher verb `team-agent cursor`), `auth_mode: subscription`, `name:` required, plus `role:`, `tools:`, and boolean `dangerously_skip_permissions:`. Subscription needs no `profile`.
34
- `model:` is required. The flag stays on argv; same-family catalog ids can change pane chrome, while unknown ids silent-fallback without warning. Pick a catalog id; after spawn, `capture-pane` once for chrome. The role field and pane chrome do not prove the live model.
33
+ To opt into Cursor, use optional frontmatter with `provider: cursor_agent` (not `cursor`; launcher verb `team-agent cursor`) and `auth_mode: subscription`; no profile or bypass field is required. `agent_id` (legacy `name`) and `role` can be omitted, but Cursor still requires an explicit `model:`.
34
+ The model flag stays on argv; same-family catalog ids can change pane chrome, while unknown ids silent-fallback without warning. Pick a catalog id; after spawn, `capture-pane` once for chrome. Pane chrome does not prove the live model.
35
35
  One `cursor_agent` per workspace; a second seat fail-closes because `.cursor/mcp.json` is directory-scoped and overwrites `TEAM_AGENT_ID`. Several Cursor seats need separate workspace directories. Same seat, fresh context: `reset-agent --discard-session`.
36
36
  `clone-agent` copies the source role but starts fresh. Runtime role replacement: `clone-agent` → `stop-agent` → `remove-agent --confirm` (deletes `.team/dynamic-role-files/`) → write role file → `add-agent --role-file` → dispatch.
37
37
  - Restart emits `--resume <chatId>` when `store.db` / `meta.json` exist; the gate does not read chat text. Persist anything that must survive restart.
@@ -261,6 +261,13 @@
261
261
  }
262
262
  }
263
263
  },
264
+ {
265
+ "command": "team-agent quick-start <plain-text-team-dir>",
266
+ "bucket": "declared_gap",
267
+ "covered": false,
268
+ "owner": "runtime-owner:lifecycle",
269
+ "plan": "Run exact argv team-agent quick-start <plain-text-team-dir> in an isolated workspace with plain-text TEAM.md and agents/<stem>.md; bind successful compilation, objective, filename-derived id, and default provider/model/effort/bypass in the generated spec."
270
+ },
264
271
  {
265
272
  "command": "team-agent remove-agent <agent> --workspace . --confirm",
266
273
  "bucket": "declared_gap",
@@ -45,7 +45,7 @@ team-agent claude
45
45
 
46
46
  Pass provider flags after the provider name, for example `team-agent codex --dangerously-bypass-approvals-and-sandbox`. Run `team-agent quick-start` from the leader's current tmux pane. Do not start a real team from a naked terminal that Team Agent cannot address through tmux.
47
47
 
48
- **0.5.66:** leader `--dangerously-*` flags no longer inherit bypass to workers. Per-worker bypass is the role field `dangerously_skip_permissions` (see Permissions).
48
+ Leader `--dangerously-*` flags do not determine worker bypass. Worker bypass defaults to enabled in compiled role specs; no bypass field needs to be written (see Document Format and Permissions).
49
49
 
50
50
  ## Leader Role
51
51
 
@@ -55,48 +55,22 @@ When the user has been communicating in Chinese throughout the conversation, all
55
55
 
56
56
  ## Minimal Copy-Paste Team
57
57
 
58
- `dangerously_skip_permissions` is **required** on every role doc (boolean). `TEAM.md` `dangerous_auto_approve` is **not** the 0.5.66 bypass switch (see Permissions). Values under `provider_models:` below are **fill-ins for omitted role `model`**, not a validity catalog; the values are configuration fallbacks.
58
+ `TEAM.md` and `agents/*.md` are plain text/Markdown; YAML frontmatter is optional. The whole `TEAM.md` body becomes the team objective, and the whole role body becomes the worker prompt. A default role uses its filename stem as its id, provider `pi`, model `openai-codex/gpt-6-luna`, effort `max`, and bypass enabled. Valid optional frontmatter may still override supported metadata.
59
59
 
60
60
  ```bash
61
61
  mkdir -p .team/current/agents
62
- team-agent profile init codex-default --auth-mode subscription --workspace .
63
62
  cat > .team/current/TEAM.md <<'EOF'
64
- ---
65
- name: demo-team
66
- objective: One worker handles bounded tasks and reports through Team Agent MCP.
67
- dangerous_auto_approve: false
68
- fast: false
69
- provider_models:
70
- codex: gpt-5.5
71
- claude: claude-sonnet-4-6
72
- claude_code: claude-sonnet-4-6
73
- ---
74
-
75
- Team config only. This is not a worker role.
63
+ A small team for bounded implementation tasks. Workers report progress to the leader and return a concise result.
76
64
  EOF
77
65
  cat > .team/current/agents/coder.md <<'EOF'
78
- ---
79
- name: coder
80
- role: Implementation Worker
81
- provider: codex
82
- auth_mode: subscription
83
- profile: codex-default
84
- dangerously_skip_permissions: false
85
- tools:
86
- - fs_read
87
- - fs_list
88
- - fs_write
89
- - execute_bash
90
- - mcp_team
91
- - provider_builtin
92
- ---
93
-
94
- Handle one bounded task at a time. Send progress to leader only when needed. Final completion must call report_result exactly once; MCP fills task ids and result envelope fields.
66
+ # Implementation Worker
67
+
68
+ Handle one bounded task at a time. Send progress or blockers to the leader with `send_message`, and report completion exactly once with `report_result`.
95
69
  EOF
96
70
  team-agent quick-start .team/current
97
71
  ```
98
72
 
99
- YAML lists must be block style. Use `tools:\n - fs_read`; do not use `tools: [fs_read, mcp_team]`.
73
+ The MCP surface is exactly `send_message`, `report_result`, and `get_team_status`; status is optional, not a prerequisite. Agent/team lifecycle management remains on the separately authorized native CLI.
100
74
 
101
75
  Workers always run headlessly in independent windows on the per-workspace tmux server. No GUI display backend is configured in `TEAM.md`.
102
76
 
@@ -132,7 +106,7 @@ Run `claim-leader` only from the **leader** pane. From a worker pane it refuses
132
106
  | `fake` (testing only) | no | no | n/a | no |
133
107
 
134
108
  Notes:
135
- - Per-worker model override means a role-doc `model:` value wins over `TEAM.md` `provider_models.<provider>` at **compile** time; subscription defaults still fill blanks when there is no profile-deferred null.
109
+ - A plain-text/default role uses Pi with `openai-codex/gpt-6-luna` and `max` effort; valid optional role frontmatter can select a provider and override supported model settings. For provider paths using `provider_models`, an explicit role `model:` takes precedence.
136
110
  - Copilot fork copies the source session into an isolated `COPILOT_HOME` and rekeys its SQLite session references atomically. Missing or incomplete backing fails closed; it never falls back to a fresh spawn.
137
111
  - Copilot phase-1 idle/turn detection is intentionally Unknown; tick emits a single explicit `provider.classify.unsupported` event per state change (P4 dedup), never a silent default.
138
112
  - `pi` `fork-agent SOURCE --as TARGET` requires a captured Pi subscription source. It copies the complete JSONL history into a distinct target session with a new id and exact `--session <path>` resume; it does not alter the source file or fall back to a fresh session.
@@ -141,7 +115,7 @@ Notes:
141
115
 
142
116
  ### Subscription auth (Codex / Claude account login)
143
117
 
144
- Before workers can use a subscription provider, create a named subscription profile in the workspace and reference it from role docs:
118
+ To opt a worker into Codex or Claude subscription providers, create a named subscription profile in the workspace and reference it from optional role frontmatter:
145
119
 
146
120
  ```bash
147
121
  team-agent profile init codex-default --auth-mode subscription --workspace .
@@ -174,7 +148,7 @@ codex debug models
174
148
 
175
149
  That command is the Codex catalog. This skill does **not** keep a model id list. If `codex` is not on PATH, the lookup is unavailable; do not invent slugs.
176
150
 
177
- Role docs may omit `model` for non-grok subscription workers; compile then fills from `TEAM.md` `provider_models` or leaves `null` when a profile is present (see compatible_api). **Do not treat those fill-ins as a validity catalog.** **Grok roles cannot omit `model`** — the internal compiler fails closed.
151
+ A plain-text/default role compiles as provider `pi` with model `openai-codex/gpt-6-luna` and effort `max`. If valid optional frontmatter selects another provider, its established provider-specific model/profile resolution applies; Grok and Cursor roles retain their explicit model requirements. **Do not treat provider/team fill-ins as a validity catalog.**
178
152
 
179
153
  Claude: run `claude auth status`; if missing, run `claude auth login`. Team Agent stores Claude worker sessions by passing `--session-id` and resumes with `--resume`.
180
154
  Use `provider: claude` or `provider: claude_code` for Claude workers.
@@ -250,7 +224,7 @@ Observed (exit 1): `usage error: invalid --auth-mode: not-a-mode`. That is the l
250
224
 
251
225
  Team Agent loads the profile during quick-start, launch, restart, and start-agent. Compatible API workers inherit the current shell proxy/CA environment by default. Claude compatible API workers use Team Agent managed `CLAUDE_CONFIG_DIR` so user-level Claude subscription settings cannot re-inject Anthropic proxy variables into third-party API sessions. If quick-start reports an ambient proxy blocker, do not silently unset proxy for the whole team; tell the user to choose one path: fix that proxy for `BASE_URL`, put `HTTPS_PROXY=`/`HTTP_PROXY=` in the profile, or put `PROXY_MODE=direct` in the profile to bypass proxy only for that worker. Subscription workers keep their native provider settings and environment. Startup runs a redacted smoke check for compatible API profiles before worker windows are created, so a bad URL/key/model or proxy/base URL connectivity failure is reported to the leader command instead of producing idle workers.
252
226
 
253
- ## How role-doc frontmatter becomes live
227
+ ## How role documents become live
254
228
 
255
229
  ```bash
256
230
  team-agent restart --help
@@ -276,72 +250,15 @@ To apply a changed role file to an **existing** worker name, use `add-agent --fo
276
250
 
277
251
  Do **not** shutdown/restart the whole team just to add a **new** worker (that drops other workers' resumable sessions). Use `add-agent` without `--force` for a new name.
278
252
 
279
- ## Permissions (0.5.66)
280
-
281
- There is **no** `team-agent permission-modes` command.
282
-
283
- ```bash
284
- team-agent permission-modes
285
- ```
286
-
287
- Observed (exit 1): `invalid choice: 'permission-modes'`.
288
-
289
- `team-agent --help` does **not** list `permission_mode`, `TEAM_AGENT_LEADER_BYPASS`, or `dangerous_auto_approve`. Use `team-agent validate "$d" --json` with an existing spec file or team directory; it does not enumerate permission modes.
290
-
291
- ### Live control: role `dangerously_skip_permissions`
292
-
293
- Required boolean on every role doc. Missing or non-bool fails the internal compiler; this is checked again before lifecycle launch.
294
-
295
- For an existing spec file, the retained schema check is:
296
-
297
- ```bash
298
- team-agent validate "$d" --json
299
- ```
300
-
301
- With a team-directory input, `validate` internally compiles `TEAM.md` and `agents/*.md` and validates role-document completeness; with a file input, it runs schema structural validation. Neither input writes or exports a spec file. The internal compiler rejects non-bool (`dangerously_skip_permissions: bypass`) and accepts only boolean **`true`** or **`false`**.
302
-
303
- `true` is the per-worker bypass opt-in. `false` is the default you should copy unless the user explicitly wants prompts skipped.
253
+ ## Document Format and Permissions
304
254
 
305
- ### `permission_mode` (historical, not consumed)
255
+ `TEAM.md` and `agents/*.md` accept ordinary text/Markdown without required YAML frontmatter. A valid optional frontmatter map may set supported metadata; absent, malformed, unterminated, or non-object frontmatter is treated as part of the document body, not a compile error. The entire TEAM body becomes `objective`; the role body is injected as the prompt.
306
256
 
307
- A role may still contain `permission_mode`. Compile **does not** validate it and **does not** copy it into the compiled spec.
257
+ For a role with no overrides, the filename stem supplies its id, and defaults are provider `pi`, model `openai-codex/gpt-6-luna`, effort `max`, and `dangerously_skip_permissions: true`. A valid `agent_id` (or legacy `name`) may override the filename-derived id. Supported valid frontmatter overrides remain available for existing roles; no permission field needs to be written. TEAM defaults are the workspace directory name, a 2-second tick, `leader_centric` communication, and `team-<workspace-name>` session.
308
258
 
309
- Observed: `permission_mode: bypass` and `permission_mode: not-a-mode` both compiled `ok: true` (exit 0); the spec agent block had `dangerously_skip_permissions: false` and **no** `permission_mode` key.
310
-
311
- Do not set `permission_mode: bypass` expecting 0.5.66 bypass. Use `dangerously_skip_permissions: true`.
312
-
313
- ### `TEAM.md` `dangerous_auto_approve`
314
-
315
- The demo `TEAM.md` still shows `dangerous_auto_approve: false`. Compile of a team with `dangerous_auto_approve: true` produced a spec **without** that key on the agent (only `dangerously_skip_permissions`). Treat it as leftover team YAML, not the bypass switch.
316
-
317
- `dangerous_auto_approve` as a **tool sentinel** is internal (adapters). Operators do not configure it as a tools list item.
318
-
319
- ### `TEAM_AGENT_LEADER_BYPASS`
320
-
321
- Not in `team-agent --help`. Not a user-facing config key. Do not export it by hand. Worker env injection was **not** live-spawned on this gauge.
322
-
323
- ### Leader argv bypass
324
-
325
- Leader `--dangerously-*` is detected only as a **warning**, not as worker bypass (`detect_bypass_flag_in_argv` — "只做检测,不做行为决策"). Declare `dangerously_skip_permissions` per role.
326
-
327
- ### Priority — 未找到单一裁决点
328
-
329
- An external report ranked `permission_mode` > `TEAM_AGENT_LEADER_BYPASS` > `TEAM.md` `dangerous_auto_approve`. **That ranking is not in this tree.** Grep of `crates/` found **no** function that takes those three keys and picks a winner (search: `permission_mode.*TEAM_AGENT_LEADER_BYPASS` and the reverse: zero hits).
330
-
331
- What the sources actually do (reader can re-open these files):
332
-
333
- | Symbol | File | What it does |
334
- |---|---|---|
335
- | `required_dangerously_skip_permissions` | `crates/team-agent/src/compiler.rs` | Compile **requires** role `dangerously_skip_permissions` bool. This is the 0.5.66 worker bypass source. |
336
- | `resolved_tool_strings_for_command` | `crates/team-agent/src/lifecycle/worker_command_context.rs` | `true` appends tool sentinel `dangerous_auto_approve`; comment: no longer consumes team/runtime/leader `DangerousApproval`. |
337
- | `provider_bypass_flag` | `crates/team-agent/src/provider/bypass_flags.rs` | **唯一权威**: role `dangerously_skip_permissions: true` decides whether to add a provider bypass argv flag. Maps provider → flag string only. |
338
- | spec allowed key `permission_mode` | `crates/team-agent/src/model/spec.rs` | Historical; **not consumed** by compiler (comment: 0.5.66 起不再被 compiler 消费); the key is absent from the compiled agent spec. |
339
- | `apply_mcp_auto_approval_env` | `crates/team-agent/src/lifecycle/launch/worker_env.rs` | Writes `TEAM_AGENT_LEADER_BYPASS` `1`/`0` from `DangerousApproval` when source is `LeaderProcess`. Separate from compile. |
340
- | `worker_spawn_env` test | `crates/team-agent/src/layout/worker_env.rs` | **Strips** inherited `TEAM_AGENT_LEADER_BYPASS` from parent env. |
341
- | `claude_dangerous_auto_approve` (and siblings) | `crates/team-agent/src/provider/adapters/*.rs` | Adapters look for tool name `dangerous_auto_approve`, not `TEAM.md`. |
342
-
343
- **Do not copy a three-row priority table.** The live operator knob on this gauge is role `dangerously_skip_permissions`. The three names from the report still exist as strings; they are not one ranked merge.
259
+ The generated spec still carries a boolean bypass value. Missing or malformed role metadata defaults to `true`; an explicit valid boolean is preserved. Provider adapters translate that value using the provider's own mechanism. Do not copy a Codex-only bypass flag into Pi or another provider's launch command.
344
260
 
261
+ `permission_mode`, `dangerous_auto_approve`, and leader environment switches are not required document fields. Keep provider-native bypass behavior inside the adapter; do not ask users to add a bypass toggle to `TEAM.md` or a plain-text role.
345
262
  ## Ignore vs handle (status / alerts)
346
263
 
347
264
  ```bash
@@ -524,7 +441,7 @@ provider or treats a diagnostic example as a command approval.
524
441
 
525
442
  `restart` takes one workspace argument. It preserves each worker's original provider. If a verified provider session exists, the worker resumes (`codex resume <id>` or `claude --resume <id>`). Claude sessions are considered resumable only after the provider has written a project transcript for that session; a freshly opened blank Claude window is not recorded as recovered context. If the stored id is stale, the runtime first tries to repair it from verified transcript history. If a stored session cannot be verified or repaired, restart fails closed instead of silently losing context; use `team-agent restart . --allow-fresh` only when the user explicitly accepts a fresh worker context. If multiple stopped teams in the same workspace have restart context, plain `team-agent restart .` fails and lists candidates; rerun with `--team <session_name_or_team_name>`. If no prior session id exists, that worker starts fresh and the event log records `restart.fresh_spawn`. Claude resume must run from the original cwd and the same provider transcript root; Team Agent stores `spawn_cwd` and compatible-API `claude_projects_root` for that.
526
443
 
527
- `restart` `--help` does not mention rereading `agents/*.md`. See **How role-doc frontmatter becomes live**.
444
+ `restart` `--help` does not mention rereading `agents/*.md`. See **How role documents become live**.
528
445
 
529
446
  Startup trust prompts are handled by the runtime/coordinator with bounded probes; do not wait on raw worker screens or manually press Enter for routine startup trust prompts.
530
447
 
@@ -536,20 +453,9 @@ To add a new worker to a running team, write the role doc and run **one command*
536
453
 
537
454
  ```bash
538
455
  cat > .team/current/agents/reviewer.md <<'EOF'
539
- ---
540
- name: reviewer
541
- role: Code Reviewer
542
- provider: codex
543
- auth_mode: subscription
544
- profile: codex-default
545
- dangerously_skip_permissions: false
546
- tools:
547
- - fs_read
548
- - fs_list
549
- - mcp_team
550
- ---
551
-
552
- Review changed files and report findings to leader.
456
+ # Code Reviewer
457
+
458
+ Review changed files and report findings to the leader. Use `send_message` for progress and `report_result` exactly once for completion.
553
459
  EOF
554
460
  team-agent add-agent reviewer --role-file .team/current/agents/reviewer.md --workspace .
555
461
  ```
@@ -581,6 +487,8 @@ Removing a worker at runtime is the symmetric `team-agent remove-agent <agent> -
581
487
 
582
488
  ## Worker Protocol
583
489
 
490
+ The Team Agent MCP surface is exactly `send_message`, `report_result`, and optional `get_team_status`. Status is self-inspection only, never a prerequisite; lifecycle management remains on the authorized native CLI.
491
+
584
492
  Workers normally do not run nested Team Agent teams. When the user or leader explicitly asks for a child team, follow `references/team-in-team.md`; otherwise workers only provide the target and content for progress, and a short completion summary at the end:
585
493
 
586
494
  ```text
@@ -594,7 +502,7 @@ team_orchestrator.report_result(summary="short completion", status="success", te
594
502
 
595
503
  For typed orchestration traffic, both `send_message` and `report_result` accept `presentation={"sink":"leader|casefile|silent","class":"message|progress|stage_result|stage_pass|bounce|blocking|final_review|timeout","case_id":"optional-case"}`. If the object is present, `sink` and `class` are required and unknown values fail closed. `casefile` and `silent` are durable-only, not deletion. The fixed critical classes `stage_pass`, `bounce`, `blocking`, `final_review`, and `timeout` always appear on the leader screen even when another sink is requested. Routing uses the typed class, never words in the content or summary.
596
504
 
597
- Do not pass `sender`, `task_id`, `requires_ack`, `schema_version`, or `agent_id` unless doing a low-level compatibility diagnostic. The MCP runtime fills those fields and keeps delivery metadata in runtime state and event logs. If provider env loses the worker id, MCP infers it from active task/message state and falls back to an explicit `unknown` sender instead of treating the worker as leader.
505
+ Do not pass `sender`, `task_id`, `schema_version`, or `agent_id` unless doing a low-level compatibility diagnostic. The MCP runtime fills those fields and keeps delivery metadata in runtime state and event logs. If provider env loses the worker id, MCP infers it from active task/message state and falls back to an explicit `unknown` sender instead of treating the worker as leader.
598
506
 
599
507
  Message targets are team-scoped. Use `leader`, another teammate agent id, or `*` for all other team members. The runtime excludes the sender from `*` broadcasts and never scans unrelated terminal windows for recipients.
600
508
 
@@ -630,7 +538,7 @@ Examples of `action` observed on this gauge:
630
538
 
631
539
  Do not retry with changed flags. Do not inspect source code or private runtime state. Do not operate tmux directly except when the user asks for a manual diagnostic. Do not answer provider approval prompts for the user.
632
540
 
633
- If `quick-start` reports `tmux session already exists`, treat it as a team-name collision. The existing session may be an active team; do not terminate it and do not suggest `shutdown` as the normal fix. Change `name:` in `TEAM.md` so the next launch uses a different tmux session name, then run `team-agent quick-start .team/current` again.
541
+ If `quick-start` reports `tmux session already exists`, treat it as a team-name collision. The existing session may be an active team; do not terminate it and do not suggest `shutdown` as the normal fix. Choose a distinct workspace folder name or set an optional `name:` override in valid `TEAM.md` frontmatter, then retry `team-agent quick-start .team/current`.
634
542
 
635
543
  Known Team Agent control-plane MCP prompts such as `team_orchestrator.report_result` and `team_orchestrator.send_message` are handled by the coordinator. It uses session-scoped approval, verifies the prompt cleared, retries boundedly, and logs the result. Do not ask the user to approve those routine internal prompts.
636
544
 
@@ -9,7 +9,7 @@ This reference is for explicitly requested nested Team Agent teams. Use it only
9
9
  - Never edit, delete, or reuse files under the parent team's `.team/current`.
10
10
  - Never shut down a team just because `.team/current` is already occupied. In a nested setup, that is probably the parent team; shutting it down can kill the main node.
11
11
  - A child team needs its own workspace directory. The role-doc directory is not the child workspace.
12
- - MCP tools are team-scoped. A worker must not try to widen `team_orchestrator.send_message` to another team.
12
+ - The MCP surface is exactly `send_message`, `report_result`, and optional `get_team_status`; it is team-scoped. A worker must not try to widen `send_message` to another team. Lifecycle management uses the authorized native CLI.
13
13
 
14
14
  ## Child Workspace
15
15
 
@@ -34,29 +34,14 @@ Then create the child team's files inside the child workspace:
34
34
 
35
35
  ```bash
36
36
  cat > .team/current/TEAM.md <<'EOF'
37
- ---
38
- name: child-review-team
39
- objective: Run a bounded child-team task and report to the parent worker.
40
- dangerous_auto_approve: false
41
- fast: false
42
- ---
43
-
44
- Child team config only.
37
+ A bounded child team for reviewing the requested files and reporting findings.
45
38
  EOF
46
39
 
47
40
  cat > .team/current/agents/reviewer.md <<'EOF'
48
- ---
49
- name: reviewer
50
- role: Independent Reviewer
51
- provider: codex
52
- tools:
53
- - fs_read
54
- - fs_list
55
- - mcp_team
56
- ---
41
+ # Independent Reviewer
57
42
 
58
43
  Review only the files and instructions provided by the child-team leader.
59
- Report findings with team_orchestrator.report_result exactly once.
44
+ Use `send_message` for progress and report findings with `report_result` exactly once.
60
45
  EOF
61
46
 
62
47
  team-agent quick-start .team/current