# CLI-041: diagnose, init, web-fetch, web-search test coverage

## Status: done

## Objective

Add unit test files for 4 source files currently at 0% coverage, and push agent-cli
overall coverage from 28% to ≥50%.

## Plan

1. Verify diagnose-command.test.ts has 5+ tests (already exists with 7 tests)
2. Create init-command.test.ts (TC-02)
3. Create packages/agent-tools/src/**tests**/web-fetch-tool.test.ts (TC-03)
4. Create packages/agent-tools/src/**tests**/web-search-tool.test.ts (TC-04)
5. Run coverage to verify TC-05 (≥50%)

## Affected Files

- `packages/agent-cli/src/__tests__/diagnose-command.test.ts` (exists, 7 tests)
- `packages/agent-cli/src/__tests__/init-command.test.ts` (new)
- `packages/agent-tools/src/__tests__/web-fetch-tool.test.ts` (new)
- `packages/agent-tools/src/__tests__/web-search-tool.test.ts` (new)

## Evidence

- GATE-IMPLEMENT PASS — 2026-05-25
- GATE-VERIFY PASS — 2026-05-25: agent-tools 150/150 pass; agent-cli 114 pass / 1 skipped; coverage 73.47% (target ≥50%); fixed test helpers to omit undefined optional args
- GATE-COMPLETE PASS — 2026-05-25: spec archived to done/, all TC-01–TC-05 checkboxes ticked
