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:
@@ -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(...)`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user