Documentation
¶
Overview ¶
Command harness-config-check fails when a harness script runs the core-agent binary without pinning its config with -c.
The hazard it closes is #1116/D3. config.Find walks *up* from the process cwd and returns the first .agents/ it meets, so a .agents/ at the repo root — committed, or just left behind by a local run — is inherited by every unpinned invocation anywhere under the checkout. The scripts keep passing, against an agent nobody configured: a different model, a different permission mode, a tools.disable list.
The pin has to be -c, not --agents-dir. loadConfig() reads config.json by walking up from cwd BEFORE resolveAgentsDir() applies the flag, so --agents-dir moves the skills, MCP servers and sessions and leaves the model, permissions and budgets behind. cmd/core-agent's own splitTreeWarning() exists to warn about exactly that split.