Release v6.7.8: agent investigation-efficiency guidance - #47
Conversation
- Version bump 6.7.7 -> 6.7.8 (package.json, package-lock.json) - Investigation efficiency guidance in system prompt (classify comprehension vs implementation, form hypothesis before searching, read call sites not internals, stop when answerable) - Zero-result guidance in search_files executor (tighten/simplify regex, widen path scope, stop after 2+ failed attempts) - Tool description improvements: read_file (no prose reads for control flow, no region re-reads) and search_files (narrowest path scope, stop after 2+ zero-result searches)
There was a problem hiding this comment.
🧪 PR Review is completed: Release v6.7.8 adds agent investigation-efficiency guidance to system prompts and tool schemas, plus no-match guidance in searchFiles executor. One logic issue found: the zero-match detection uses fragile string matching instead of checking the data directly.
Skipped files
CHANGELOG.md: Skipped file patternpackage-lock.json: Skipped file pattern
⬇️ Low Priority Suggestions (1)
src/tools/executors/searchFiles.ts (1 suggestion)
Location:
src/tools/executors/searchFiles.ts(Lines 90-90)🟡 Logic Error
Issue: The zero-match detection uses
output.includes("Matches: 0")which performs a substring search across the entire formatted output. If a search returns matches but one of the matched lines contains the literal textMatches: 0(e.g., searching forMatchesin this very codebase), the guidance text will be incorrectly appended even though matches were found. Thepageobject is directly available and hasmatches.length.Fix: Check
page.matches.length === 0directly instead of string-matching the formatted output.Impact: Eliminates false positives where match guidance is shown when matches actually exist, preventing confusing output for the AI agent.
- if (output.includes("Matches: 0")) { + if (page.matches.length === 0) {
…lt guidance
Code review found that output.includes('Matches: 0') could false-positive
when matched file content contains that literal text. The page object is
directly available in the executor, so check page.matches.length === 0.
|
✅ Reviewed the changes: The PR correctly replaces the fragile string-based zero-match detection with a direct data check on |
Summary
Version bump to 6.7.8. This release improves the agent's investigation efficiency when answering comprehension questions.
Changes
src/prompts/system.ts): directs the agent to classify comprehension vs implementation questions, form a one-line hypothesis before searching, read the call site rather than the implementation, never read prose/content for control-flow questions, and stop exploring once it can answer.search_filesexecutor (src/tools/executors/searchFiles.ts): appends actionable guidance when a search returns 0 matches — tighten/simplify the regex, widen path scope, try a different glob, stop after 2+ failed attempts.read_fileschema tells the model not to read file contents when investigating control flow and not to re-read regions already read;search_filesschema tells it to scopepathto the narrowest plausible directory and to stop after 2+ zero-result searches.[Unreleased]; package-lock.json resynced to 6.7.8.Testing
npm run typecheckpassesAfter merge: tag
v6.7.8on main to publish.