phase: 146_search_tool_scope
Phase 146 final verification pass complete — all green, tree untouched by me.
**Verified (final pass — both tasks already in `complete/`):**
- Scoped grep streams `{"type":"tool","name":"grep","argument":<pattern>,"path":<source/path>}`; bare grep/read/ls frames dump byte-identical (unit matrix in `test_sse_events.py` + builder pins in `test_chat_gate.py` L1364–1448)
- Tool line `🔎 Searching for <pattern> in <source/path>` (two `<code>` spans, `.grep-scope` sibling, no new emoji); bare line byte-identical (unit Node test + E2E)
- Status label "… is searching for X in Y" scoped-only; `path` persisted additively on the saved tool record and re-rendered on `/?chat=<id>` restore; pre-phase records restore byte-identically (E2E tests 2 & 3)
**Results (exact commands):**
- `uv run pytest --cov=app --cov-report=term-missing` → **3419 passed**, `app/` coverage **99%** (>90% ✓)
- `uv run pytest tests/e2e/test_search_tool_scope.py -v --no-cov` → **3 passed** in isolation ✓
- `uv run ruff check . && uv run pyright` → clean (0 errors) ✓
**Completion criteria:** all 6 ✓ (wire shape, UI line, status label, save/restore, gates, no completed-phase behavior change — full suite green includes all prior-phase pins).
**Documentation:** README.md (incl. its phase-146 section) and AGENTS.md reviewed in full against the codebase — verified consistent, no changes needed (`.env.example` ⊆ README config tables; no stale vars; phase-100 72rem rule in AGENTS.md §5 matches shipped CSS; no-CDN/smoke-DB/gpgsign claims all confirmed).
**Notable:** none — no defects found, no live-infrastructure touched, nothing committed per harness protocol.
**Next pending phase:** `147_sync_changed_only`.
This commit is contained in:
@@ -394,6 +394,18 @@ streamed as an SSE `tool` frame. In the chat, each call shows a transient
|
||||
**calling-tool status** alongside "thinking" (the send button keeps its
|
||||
busy state — "Stop" — for the whole turn).
|
||||
|
||||
**The search line shows where it searches (phase 146).** When a `grep`
|
||||
re-searches one document (the optional `path`), the chat's tool line and
|
||||
the calling-tool status show the document the search runs in —
|
||||
`🔎 Searching for <pattern> in <source/path>` — so a whole-KB search and
|
||||
a re-search of a single document read as distinct searches instead of
|
||||
looking like the model is repeating itself. The scope rides the SSE
|
||||
`tool` frame additively (`path`, present on scoped greps only) and is
|
||||
persisted on the saved turn's tool record, so it re-renders after a
|
||||
save → restore; a bare `grep` renders exactly as before (frame, line,
|
||||
status, and saved shape all byte-identical to pre-phase — old saved
|
||||
turns restore unchanged).
|
||||
|
||||
The model may call tools as many times as needed, bounded by a round cap:
|
||||
|
||||
| Env | Default | Meaning |
|
||||
|
||||
Reference in New Issue
Block a user