Enhance agent orchestrator with real tool execution and persistence#3
Merged
Merged
Conversation
Major enhancements across the entire agent system: **Agent Loop & Tools:** - Fix tool numbering collision (duplicate ###6 entries) - Add parallel tool call support (JSON array format) - Add patch_file tool for surgical find/replace edits - Enhance search_code with 25+ file extensions, context lines, exclusions - Enable shell mode for run_command (pipes, redirects, && chains) - Add configurable timeout for run_command (up to 5 minutes) - Add in-memory file cache with 30s TTL - Add automatic retry with exponential backoff for transient failures **Agent Orchestrator:** - Replace stub/placeholder swarm execution with real agent execution - Agents now actually run tool calls (search_code, run_command, etc.) - Add inter-phase context passing between sequential phases - Add relevance-scored agent matching for task routing - Track toolsUsed and filesChanged per agent result **MCP Bridge:** - Implement real HTTP transport (MCP_SERVER_URL env) - Implement real stdio transport (MCP_SERVER_CMD env) - Add MCP_ENABLED env toggle - Add graceful shutdown for stdio processes **Persistence Layer (NEW):** - Add file-based JSON persistence in .grok-data/ directory - Wire into RAG system, Knowledge Graph, ML Learning, Precision System - All learning data survives server restarts - Auto-save with configurable interval, flush on process exit **Agent Memory:** - Fix server-side support (was localStorage-only, silent no-op on server) - Server-side now uses file persistence layer - Client-side still uses localStorage as before **New Specialized Agents:** - Refactoring Agent: code smells, DRY violations, complexity reduction - Architecture Agent: dependency graphs, module boundaries, design patterns - Debugging Agent: systematic error tracing, root cause analysis - Database Agent: schema design, query optimization, N+1 detection **Cleanup:** - Consolidate duplicate agent definitions (agents/*.ts re-export from canonical source) - Fix hardcoded date in BASE_2026_PROMPT (now dynamic via getBase2026Prompt()) - Add web_search and web_browse to ToolName type union https://claude.ai/code/session_01EgmjHaEN3MdD47o3BgynKV
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
This PR significantly enhances the agent orchestration system by implementing real tool execution for specialized agents, adding a persistence layer for learning systems, and introducing new specialized agents for refactoring, architecture, and debugging tasks.
Key Changes
Agent Orchestrator Enhancements
executeAgent()function that runs agents with configurable iterations and tool call limitspriorContextsupport to pass results between agent phasesonProgressandonToolCallcallbacks for monitoring agent executioncreateOrchestrationPlan()with relevance scoring for better agent matchingPersistence Layer (New)
src/lib/persistence.tsLearning Systems Integration
New Specialized Agents
Tool Executor Improvements
MCP Bridge Enhancements
Agent Loop Updates
patch_file,web_search, andweb_browseto available toolsCode Organization
security.ts,testing.ts,documentation.ts,performance.tsnow re-export from canonicalspecialized-agents.tssourceImplementation Details
AGENT_WORKSPACEboundariesTesting Recommendations
https://claude.ai/code/session_01EgmjHaEN3MdD47o3BgynKV