Skip to content

Release v6.7.8: agent investigation-efficiency guidance - #47

Merged
code-crusher merged 2 commits into
mainfrom
release/v6.7.8
Aug 21, 2026
Merged

Release v6.7.8: agent investigation-efficiency guidance#47
code-crusher merged 2 commits into
mainfrom
release/v6.7.8

Conversation

@code-crusher

Copy link
Copy Markdown
Member

Summary

Version bump to 6.7.8. This release improves the agent's investigation efficiency when answering comprehension questions.

Changes

  • Investigation efficiency section in system prompt (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.
  • Zero-result guidance in search_files executor (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.
  • Tool description improvements: read_file schema tells the model not to read file contents when investigating control flow and not to re-read regions already read; search_files schema tells it to scope path to the narrowest plausible directory and to stop after 2+ zero-result searches.
  • CHANGELOG.md updated under [Unreleased]; package-lock.json resynced to 6.7.8.

Testing

  • npm run typecheck passes

After merge: tag v6.7.8 on main to publish.

- 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)
@matterai-app

matterai-app Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary By MatterAI MatterAI logo

🔄 What Changed

Bumped CLI version to 6.7.8 and integrated agent investigation efficiency guidelines across system prompts, tool schemas (read_file, search_files), and search execution handlers to minimize redundant token usage and unproductive exploratory tool calls.

🔍 Impact of the Change

Improves LLM agent responsiveness and token economy by enforcing stricter hypotheses-driven investigation workflows, preventing circular search retries when zero matches occur, and directing focus to call sites rather than deep implementation reads.

📁 Total Files Changed

Click to Expand
File ChangeLog
Bump Version
package.json
Updated project release version to 6.7.8.
System Prompts
src/prompts/system.ts
Added investigation efficiency guidelines covering hypothesis testing and read discipline.
Search Execution
src/tools/executors/searchFiles.ts
Appended recovery guidance when search returns zero matches to prevent redundant retries.
Read Schema
src/tools/schemas/read_file.ts
Updated tool description to enforce batching and discourage prose reads for control flow.
Search Schema
src/tools/schemas/search_files.ts
Updated tool description to mandate narrow scoping and strict regex tightening on zero results.

🧪 Test Added/Recommended

Recommended

  • Add unit tests validating prompt inclusion of efficiency directives and verifying search executor response formatting on zero matches.

🔒Security Vulnerabilities

No security vulnerabilities introduced.

@matterai-app matterai-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 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 pattern
  • package-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 text Matches: 0 (e.g., searching for Matches in this very codebase), the guidance text will be incorrectly appended even though matches were found. The page object is directly available and has matches.length.

Fix: Check page.matches.length === 0 directly 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.
@matterai-app

matterai-app Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

✅ Reviewed the changes: The PR correctly replaces the fragile string-based zero-match detection with a direct data check on page.matches.length. Previous review comment is resolved; no new issues found.

@code-crusher
code-crusher merged commit c8d983f into main Aug 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant