Share reusable terminal auto-approval helpers across workbench and Agent Host
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Context
Recent terminal auto-approval changes have moved reusable logic out of the workbench layer so both workbench and Agent Host can consume it:
- https://github.com/microsoft/vscode/pull/329026 shares the default Git auto-approval rules.
- https://github.com/microsoft/vscode/pull/328882 shares the `sed` in-place parser.
There is an existing note associated with:
`src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.ts`
```ts
// Bump the layer and rename TerminalCommandhelper?
// double if we track expanding terminal thinking block.
```
## Debt
Audit `runInTerminalHelpers.ts` and related terminal auto-approval helpers for logic that should live in a lower shared terminal layer rather than workbench.
Potential work:
- Identify pure helpers that are useful to both workbench and Agent Host.
- Move shared terminal auto-approval semantics to `vs/platform/terminal/common/autoApprove` without moving workbench policy, services, localization, or UI.
- Rename ambiguous helper types/functions such as the referenced `TerminalCommandhelper` where appropriate.
- Avoid duplicate implementations as Agent Host and workbench terminal behavior converge.
- Consider how the helper boundary should support expanded terminal thinking-block tracking.
This should be an organizational cleanup unless a separately reviewed behavior change is required.
Contributor guide
Assessment
This issue has not been assessed yet.