feat(coding-agent): added opt-in task prewalk and tightened --tools and xdev behavior

- Added a `task.prewalk` option (default `false`), removed default task `prewalk` flags, and updated prewalk resolution so bunded generic task execution only prewalks when explicitly enabled.
- Enforced strict `--tools` validation in CLI parsing, making unknown tool names fail fast with `CliUsageError` instead of being silently filtered.
- Migrated legacy discovery settings (`tools.discoveryMode`, `tools.essentialOverride`, MCP discovery keys) into updated `tools.xdev` handling with preserved explicit override behavior.
- Hardened xdev/ACP execution flow by capping `docsAll` payloads with overflow listing and remapping `xd://` dispatches/approval gating for correct execute/read behavior and reduced duplicate prompts.
This commit is contained in:
can1357
2026-07-15 18:39:36 +02:00
parent 4da1bbf9ea
commit 9afedb591e
22 changed files with 368 additions and 54 deletions
+6 -3
View File
@@ -2309,12 +2309,15 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
// Per-agent prewalk: the agent definition's `prewalk` frontmatter or the
// `task.agentPrewalk` settings override hands the subagent off to a
// fast/cheap target at its first edit/write — the same mechanism as the
// session-level --prewalk. Resolution failures skip prewalk instead of
// failing the spawn.
// session-level --prewalk. The bundled generic `task` agent has no
// frontmatter default; the `task.prewalk` toggle (default off) arms it.
// Resolution failures skip prewalk instead of failing the spawn.
let prewalk: Prewalk | undefined;
const genericTaskPrewalk =
agent.source === "bundled" && agent.name === "task" && settings.get("task.prewalk") ? true : undefined;
const prewalkPattern = resolveAgentPrewalkPattern({
settingsOverride: settings.get("task.agentPrewalk")[agent.name],
agentPrewalk: agent.prewalk,
agentPrewalk: agent.prewalk ?? genericTaskPrewalk,
});
if (prewalkPattern) {
const resolvedPrewalk = resolveModelOverride([prewalkPattern], modelRegistry, settings);