Skip to content

v1.8.3 — Tool Use + Semantic Context (Phase 3)

Latest

Choose a tag to compare

@Zafer83 Zafer83 released this 19 Apr 02:32

Typed Tools + BM25 Semantic Context

Phase 3 of the multi-agent architecture. Both features are opt-in — existing Phase 1/2 behaviour is unchanged by default.


Agentic Tool Use (vertexAgent.toolUseEnabled)

When enabled, Orchestrator sub-agents enter a multi-turn loop where they call typed tools instead of generating code blocks:

Tool Description
read_file Read workspace file; path traversal blocked
write_file Write file + create dirs; DELETE keyword removes file
list_files Glob pattern match (VS Code API + pure-Node fallback)
grep Regex search across source files
git_diff Unstaged or staged diff
run_tests Whitelisted test runners only (npm/pytest/jest/cargo/…)
run_bash Strict allowlist (ls, cat, head, grep, git status/log/diff, node tests/…)

Each role gets a curated subset:

  • Coder: read, write, list, grep
  • Security Auditor: read, list, grep, git_diff
  • Test Writer: read, write, list, run_tests
  • Refactor Expert: read, write, list, grep, git_diff

Provider support: OpenAI (native), Claude (native), Gemini (functionDeclarations), Ollama (JSON-schema-in-system-prompt fallback).


Semantic Context Ranking (vertexAgent.semanticContextEnabled)

When enabled, replaces random file sampling with BM25 ranking — the workspace files most relevant to the current query are selected instead of arbitrary ones.

  • Pure JavaScript — no SQLite, no native modules, no external API calls
  • Tokeniser handles camelCase/PascalCase (getUserById → get, user, id)
  • Stop-word filtering, IDF weighting
  • Background indexing on activation + incremental updates on file save

New settings

Setting Default Description
vertexAgent.toolUseEnabled false Enable agentic tool-use loop for Orchestrator sub-agents
vertexAgent.semanticContextEnabled false Enable BM25 semantic file ranking

Tests

  • tool-registry.test.js — 85 assertions: tool completeness, schema, role subsets, allowlists, path traversal, DELETE detection
  • semantic-index.test.js — 36 assertions: tokeniser, BM25 scoring, topK, edge cases, IDF weighting

344 total unit test assertions across 10 test files — all passing.