Unify agent entry point with natural language routing#25
Open
cpetersen wants to merge 2 commits intoagent-loopfrom
Open
Unify agent entry point with natural language routing#25cpetersen wants to merge 2 commits intoagent-loopfrom
cpetersen wants to merge 2 commits intoagent-loopfrom
Conversation
…ting The Agent now decides whether to search documents or write code based on the user's natural language input. No more choosing between /query and /code. SearchDocs tool: - Wraps RAG retrieval pipeline (steps 1-5) as a RubyLLM::Tool - Returns retrieved context + sources (not LLM-generated answer) to avoid double-LLM problem — the Agent synthesizes its own answer - New retrieve_context public method on QueryProcessor (DRY extraction) Unified default handler: - Interactive mode routes all input through cached Agent + Orchestrator - Agent system prompt guides LLM: questions → search_docs, tasks → coding tools - Profile switching clears cached agent/orchestrator - /query and /code still work as explicit alternatives 392 specs, 0 failures (5 new) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Small local models (Qwen3-8B) get overwhelmed when 9 tools with long
descriptions are registered — they output only <think> blocks without
making any tool calls. With 4 tools and short descriptions, they work
reliably.
Lite tools (for red_candle provider):
- LiteReadFile, LiteWriteFile, LiteBashExec, LiteTaskComplete
- Minimal descriptions ("Write a file", "Run a bash command")
- Same functionality, fewer tokens in the tool schema
Agent auto-selects tool set based on provider:
- red_candle → LITE (4 tools, short descriptions)
- anthropic/openai/etc → ALL (9 tools, full descriptions)
Tested: Qwen3-8B successfully writes files, runs bash, and calls
task_complete through the full Agent → Orchestrator loop.
392 specs, 0 failures
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Eliminates the split between
/query(RAG) and/code(agent) — all input now goes through a single Agent that decides whether to search documents or write code based on natural language.SearchDocs Tool
RubyLLM::Toolretrieve_contextpublic method on QueryProcessor (DRY extraction of steps 1-5)Unified Default Handler
search_docswrite_file+bash_exec/queryand/codestill work as explicit alternativesLite Tool Set for Local Models
<think>blocksLiteReadFile,LiteWriteFile,LiteBashExec,LiteTaskComplete)red_candle→ LITE (4 tools), cloud providers → ALL (9 tools)Other
/no_thinkadded to Agent system promptTest plan
/queryand/codestill work as explicit commands🤖 Generated with Claude Code