Bounded terminal-execution subagent for build and test runs
Coding-agent teams should route build, test, install, and diagnostic commands through a bounded terminal-execution subagent when raw logs are consuming the main agent’s context. The concrete build is small: the main agent sends a natural-language request, the subagent runs one synchronous terminal command per turn with timeouts, and it returns a structured summary containing command status, warnings, failing tests, and likely next actions.
Terminus-4B gives a practical template for this interface. In the reported Serilog example, the main-agent run fell from 2.46M tokens and 40 turns to 740k tokens and 32 turns while the subagent ran 9 commands internally. The summary sent back to the main agent was about 200 tokens and still included the dotnet build result, 769 passing unit tests, and one failing approval test with a likely fix. A team can test this on its own issue queue by replaying recent agent runs and comparing main-agent tokens, number of direct terminal calls, and patch success with and without the subagent.