refactor(coding-agent): removed head/tail params and bash-normalize module

- Deleted `bash-normalize.ts` and its tests; output truncation is handled by the streaming tail buffer and artifact spillover.
- Removed `head`/`tail` schema fields from `bashSchema` and `BashToolInput`.
- Updated system prompt and bash tool prompt to forbid `| head`/`| tail` pipes and other anti-patterns, directing the agent to use dedicated tools instead.
This commit is contained in:
can1357
2026-05-10 15:26:22 +02:00
parent 4e0ca3c0e6
commit f19d206fa5
8 changed files with 29 additions and 307 deletions
+1 -4
View File
@@ -803,10 +803,8 @@ This subsystem is split into two layers:
#### Bash tool (`src/tools/bash.ts`)
- Adapter class: `BashTool implements AgentTool<typeof bashSchema, BashToolDetails>`.
- Defines tool contract (`bashSchema`: `command`, `timeout`, `cwd`, `head`, `tail`) and prompt text import (`../prompts/tools/bash.md`).
- Defines tool contract (`bashSchema`: `command`, `timeout`, `cwd`, `pty`, optional `async`) and prompt text import (`../prompts/tools/bash.md`).
- Pre-execution adaptation:
- strips inline shell truncation patterns (`normalizeBashCommand`)
- applies explicit/derived head-tail params
- optional command interception (`checkBashInterception`) based on settings
- expands internal URLs (`expandInternalUrls`)
- resolves/validates working directory (`resolveToCwd`, `fs.promises.stat`).
@@ -815,7 +813,6 @@ This subsystem is split into two layers:
- non-PTY path: `executeBash(...)`.
- Streaming to UI is adapter-owned: updates `onUpdate` using `createTailBuffer(...)` while backend runs.
- Post-execution shaping is adapter-owned:
- applies `applyHeadTail(...)`
- converts backend cancellation/timeout/exit status into `ToolAbortError` / `ToolError`
- returns `toolResult(...).text(...).truncationFromSummary(...)`.