From 4e09fdeafb68f67d68416f19c61cb2dfb5b30102 Mon Sep 17 00:00:00 2001 From: kingwl Date: Fri, 10 Jul 2026 09:30:05 +0800 Subject: [PATCH] =?UTF-8?q?docs(agents):=20an=20Agent=20efficiency=20secti?= =?UTF-8?q?on=20=E2=80=94=20one-round=20gate=20runs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repeated full-repo gate executions in agent sessions traced to one habit: piping a long command through a filter, losing the failure detail, and re-running the whole gate to recover it — paying both the gate again and an extra agent round-trip. The rule lands the full output in a temp file, prints the summary, and auto-expands capped failure context on non-zero exit in the SAME invocation. Fits the existing 1802-word ceiling after condensing (1800). --- AGENTS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 2cfc9b880f..e9d2f10124 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -78,6 +78,12 @@ pnpm exec vitest run --config vitest.e2e.config.ts packages/ui/stdio-agent/tests `test:coverage`, not `test`, is the gating run ([why](docs/testing.md)); a sign-off counts only for commands actually run. +## Agent efficiency + +Habits that cut agent round-trips, each earned by measured session waste. + +- **One-round gate runs**: any command beyond a few seconds lands its FULL output in a temp file, prints a short summary, and on non-zero exit auto-expands capped failure context (`grep -B3 -A15 -E 'FAIL|ERROR' "$out" | head -60`) in the SAME invocation — never re-run a gate to recover detail a filter discarded. + ## Secrets / .env Real-API tests and demos read `DEEPSEEK_API_KEY` (and optional `DEEPSEEK_BASE_URL`) from the environment or a gitignored root `.env` loaded via `process.loadEnvFile()`. cordis.yml references env vars with the `!!js` tag (never `!js`). Never commit credentials. CI has no secrets, so e2e suites self-skip without a key — a CI accommodation, not a cost signal; the with-key policy is in [docs/testing.md](docs/testing.md).