You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: dogfood G23-G38 first-run, background plan, and CLI error-contract repairs
Owner adjudicated the agent-proposed G23-G38 triage "Yes for all" on
2026-09-16 (docs/work-log/dogfood-findings-2026-09-15.md, "Owner decisions
(2026-09-16)"). Landed as small existing-contract repairs, one behavior
regression per finding (all observed failing pre-change):
- G23/G38 init/setup: no key prompt for `fake` (ProviderConfig.requires_api_key),
non-TTY stdin without --provider fails fast with a classified error before any
write; key-requiring providers proceed with api_key_note.
- G24 init next_steps show the workspace-write plan gate (plan -> --from-plan).
- G29 init/setup append `.teaagent/` to .gitignore in git repos (--no-gitignore
opt-out, gitignore status reported); first next step commits the scaffold so
the git sandbox stays enabled.
- G30 `fake` is requires_network=False: preflight skips DNS/loopback probes.
- G31 background worker argv forwards --from-plan/--require-plan/
--skip-plan-check (+ --allow-external-plan); --from-plan without a positional
task no longer crashes the parent.
- G26 run-list JSON arrays contain only run records; scratchpad hint is
human-output only.
- G35 MCP unknown tools/call -> JSON-RPC -32602, session keeps serving (catch
narrowed to the registry lookup). G27 mcp trust allow/deny without
TEAAGENT_MCP_TRUST_KEY -> classified error (G11 wrong-key semantics untouched).
- G32 memory auto-invalidate accepts a str root. G33 skill candidate install
not-found -> classified error. G36 automation add validates the schedule
before persisting. G37 automation show/pause/resume/delete/run accept a
unique name. G28 bare audit verify errors up front without a legacy log.
G25 release evidence prints gate progress on stderr.
- G34 held under ADR-0043 (no change). D1 still deferred.
Docs: cli/USAGE/daily-driver/audit guide updated; risk record
docs/reviews/dogfood-g23-g38-2026-09-16-risk.md; roadmap-status, backlog,
findings, and the rethink record updated; generated artifacts regenerated.
Gate: governance-gap (G26/G27/G28/G29/G31/G32/G33/G35/G36) and owner-override (G23/G24/G25/G30/G37/G38, owner "Yes for all" 2026-09-16)
Constraint: existing-contract repairs only; no sandbox/approval/policy/runner-core code; G34 consensus untouched; no owner verdict supplied
Tested: focused pytest 180 passed across new tests/test_dogfood_*_g*.py and touched families; integrated /tmp scratch journey (headless init -> committed scaffold -> offline preflight ready -> sandboxed agent run completed, porcelain clean; runs list schema; audit verify bare error; MCP -32602 then valid call); ruff/mypy clean on 19 changed files; verify_docs.sh PASS
Not-tested: live `release evidence` default-profile progress (unit-proven with stubbed runner); full pytest suite
Confidence: high
Action: G-P2-19
Roadmap-Status: updated (2026-09-16 G23-G38 implemented note; no horizon/milestone status column moved)
Copy file name to clipboardExpand all lines: docs/USAGE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ teaagent memory failures prune
85
85
-`plan` writes a reviewable artifact; `run --from-plan` binds execution to that artifact (task + content hash in the run audit log). Plans must live under `.teaagent/plans/` unless you pass `--allow-external-plan` (other paths must still be under `--root`).
86
86
-**Plan-before-write enforcement**: `workspace-write` mode requires a plan by default. Use `--skip-plan-check` to override.
87
87
88
-
**Advanced paths** (not part of the golden path): `teaagent init`, `teaagent doctor providers --wizard`, manual `providers_env.zsh`, Keychain scripts, per-provider env exports — see [Recovery recipes](#recovery-recipes) and [API Key Setup](#api-key-setup).
88
+
**Advanced paths** (not part of the golden path): `teaagent init` (non-interactive stdin requires `--provider`; skips the API-key prompt for `fake`; adds `.teaagent/` to `.gitignore` in git repos unless `--no-gitignore`; for `workspace-write` its next-steps show the `plan` → `--from-plan` gate), `teaagent doctor providers --wizard`, manual `providers_env.zsh`, Keychain scripts, per-provider env exports — see [Recovery recipes](#recovery-recipes) and [API Key Setup](#api-key-setup).
teaagent init --root . --provider gpt --no-gitignore # opt out of the .gitignore addition
294
+
```
295
+
296
+
- Non-interactive stdin (piped/headless): `init` and `setup` without `--provider` fail fast with `{"ok": false, "message": "provider is required in non-interactive mode; pass --provider <name> (choices: ...) or run in a terminal"}` and exit 1 before writing any file. They never silently select a credentialed provider.
297
+
- Providers that need no key (`fake`) are never prompted for one. For a key-requiring provider on non-TTY stdin, `init` proceeds without storing a key and reports `api_key_note` naming the env var to set.
298
+
- In a git repo, `init` (and `setup`, when it writes config) adds `.teaagent/` to `.gitignore` so the auto-enabled git sandbox stays usable; the result is reported as `gitignore: added|present|skipped|not-a-git-repo`. Existing lines are never rewritten and no git command runs; `--no-gitignore` opts out.
299
+
- For `--permission-mode workspace-write`, `next_steps` include the plan-gate path (`teaagent agent plan ...` then `teaagent agent run ... --from-plan .teaagent/plans/<plan-file>.md`); `--skip-plan-check` is not recommended.
300
+
286
301
## Model Adapters
287
302
288
303
List supported providers:
@@ -613,7 +628,7 @@ Streamable HTTP details:
613
628
-`--auth-token TOKEN` requires `Authorization: Bearer TOKEN` on every request.
614
629
-`--allowed-origin URL` may be repeated to whitelist browser Origin headers. Default: allow all.
615
630
616
-
Supported methods: `initialize`, `tools/list`, `tools/call`. Each tool is exposed with its `inputSchema` and read-only / destructive / idempotent annotations. Tool errors are returned as `result.isError = true` rather than JSON-RPC errors so the client can recover.
631
+
Supported methods: `initialize`, `tools/list`, `tools/call`. Each tool is exposed with its `inputSchema` and read-only / destructive / idempotent annotations. Tool *execution*errors are returned as `result.isError = true` rather than JSON-RPC errors so the client can recover; a `tools/call` for an unregistered tool is a JSON-RPC `-32602` (Invalid params) error frame (`tool 'X' is not registered`) and the server keeps serving.
> surfaces — see `permission-and-approval-playbook.md`; undo refuses off-branch;
17
-
> attach inherits the run's recorded provider)
14
+
> **Last reviewed:** 2026-09-16 (first-run and error-contract fixes G23–G38:
15
+
> offline-ready `fake` provider, `init`/`setup` gitignore `.teaagent/` and fail
16
+
> fast on non-interactive stdin, `--background` honors plan flags, run-list JSON
17
+
> arrays contain only runs, MCP unknown-tool calls no longer end the session)
18
18
19
19
This page is the short daily-use entry point for TeaAgent's TUI, TUI chat, and
20
20
agent mode. It is intentionally more practical than the audit corpus.
@@ -43,6 +43,9 @@ daily-driver plan is historical evidence, not an active scheduling authority.
43
43
44
44
- Approval governance now fail-closes GitHub/browser/MCP external mutations in prompt/read-only/workspace-write, consumes one-time JIT grants, and refuses blind redispatch of unmatched non-idempotent starts. Providerless acceptance is in `tests/acceptance/test_efx_durable_effect_flow.py`. Keep live credentials off until a live-credential dry-run exists; see "Known issues."
45
45
-`daily`/`preflight` warn when `GITHUB_TOKEN`/`GH_TOKEN` sit in the shell environment: external-effect tools stay fail-closed until approved, but remove ambient tokens unless authorizing live use (EFX-002).
46
+
- The `fake` provider is offline-ready: `agent preflight`/`plan`/`daily` pass with no DNS or socket call because `ProviderConfig.requires_network=False` short-circuits the connectivity and loopback-bind checks (G30).
47
+
-`init`/`setup` add `.teaagent/` to `.gitignore` in git repos (append-only; `--no-gitignore` opts out) so the auto-enabled git sandbox no longer self-disables on first run, and non-interactive `init`/`setup` fail fast with a classified error instead of crashing on stdin EOF (G23/G29/G38).
48
+
-`agent run --background` forwards `--from-plan`/`--require-plan`/`--skip-plan-check` to the worker, so a workspace-write background run with a valid plan produces a run instead of dying on `PLAN_GATE` (G31). `runs list`/`session list` JSON arrays contain only run records; the scratchpad hint is human-output only (G26).
46
49
-`teaagent chat` prints successful task answers and no longer marks successful tasks as failures.
47
50
-`teaagent chat``/cost` and `/budget` are wired to real session cost. Budget semantics are explicit: `None` means unlimited, while `0` is a real zero cap. Cost display labels whether the value is actual, estimated, or unavailable.
48
51
- Matched deny grants now hard-block in every mode (`approval check` reports
0 commit comments