feat(augment): multi-agent improvements, limit removal, and routing fix#2600
Conversation
Review Summary by QodoMulti-agent orchestration, agent routing continuity fix, and comprehensive test coverage with limit removals
WalkthroughsDescription• **Multi-agent orchestration improvements**: ADK-based orchestrator with HITL approval mirroring, tool resolver, conversation state management, and agent handoffs • **Agent routing continuity fix**: Uses createContinuationState() to save active agent per turn and resumeState to route follow-up messages directly to the active agent instead of always restarting from the router (upgraded ADK to v0.1.12) • **Removal of artificial limits**: Eliminates all hard-coded truncation constants (MAX_TOOL_OUTPUT_CHARS, MAX_MCP_PROXY_RESPONSE_BYTES, MAX_RESPONSE_CHAIN_DEPTH, MAX_CONTINUATION_ITERATIONS, MAX_MESSAGE_CONTENT_LENGTH, etc.) • **Comprehensive test coverage**: 162 test suites with 2644 passing tests covering admin routes, multi-agent orchestration, tool execution, configuration merging, message processing, and all HTTP endpoints • **New HTTP client**: ResponsesApiClient with streaming, retry logic, and TLS verification support • **Configuration enhancements**: ConfigLoader with validation, defaults, and support for complex nested configs including multi-agent setups • **Code quality improvements**: McpAuthService double-map-lookup fix, simplified sorting in TfIdfEmbedder • **ESLint configuration**: Added workspace-level ESLint setup for consistent linting Diagramflowchart LR
A["ADK Orchestrator<br/>with resumeState"] -- "saves active agent" --> B["Continuation State"]
B -- "routes to active agent" --> C["Follow-up Messages"]
D["Remove Limits<br/>MAX_TOOL_OUTPUT_CHARS<br/>MAX_MCP_PROXY_RESPONSE_BYTES<br/>etc."] --> E["Unrestricted Output"]
F["ResponsesApiClient<br/>Streaming & Retry"] --> G["Tool Execution"]
H["ConfigLoader<br/>with Validation"] --> I["Multi-agent Config"]
J["162 Test Suites<br/>2644 Tests"] --> K["Comprehensive Coverage"]
File Changes1. workspaces/augment/plugins/augment-backend/src/routes/adminRoutes.test.ts
|
Code Review by Qodo
1. RBAC flag ignored
|
Follow-up to redhat-developer#2555. Adds multi-agent orchestration improvements, removes artificial limits, and fixes multi-turn agent routing. Multi-agent orchestration: - ADK-based orchestrator with HITL approval mirroring, tool resolver, conversation state management, and agent handoffs - VectorStoreFacade lazy init and single-flight improvements - ResponsesApiService previous_response_id fix Limit removals (per design decision): - Remove MAX_TOOL_OUTPUT_CHARS, MAX_MCP_PROXY_RESPONSE_BYTES, MAX_RESPONSE_CHAIN_DEPTH, MAX_CONTINUATION_ITERATIONS, MAX_MESSAGE_CONTENT_LENGTH, and all truncation logic - Remove maxToolOutputChars and maxResponseChars config - Keep MAX_AUTO_REAPPROVALS (Llama Stack bug workaround), auth constants, timeouts, and cache limits Routing fix: - Upgrade @augment-adk/augment-adk from 0.1.11 to 0.1.12 - Restore createContinuationState and resumeState so follow-up messages resume from the active agent instead of restarting from the router Frontend enhancements: - ToggleSwitch component, selectMenuProps helper - Vector store UI and admin panel improvements Code quality: - McpAuthService double-map-lookup fix - TfIdfEmbedder sort simplification Documentation: - CONFIG_REFERENCE.md, TROUBLESHOOTING.md Tests: - Comprehensive coverage (162 suites, 2644 tests passing) - 6 resumeState continuity tests
066e242 to
d42b83b
Compare
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
- Use localeCompare for string sorts (TfIdfEmbedder, BackendToolExecutor.test) - Fix Promise-in-boolean conditionals with !== undefined (McpAuthService, VectorStoreFacade) - Remove unnecessary non-null assertions (AdkOrchestrator, VectorStoreFacade) - Reduce cognitive complexity by extracting helpers: - AdkOrchestrator: resolveAgentContinuity(), mirrorPendingApprovals() - chatRoutes: resolveConversationId() - BackendToolExecutor: processDiscoveryResults(), preserveFailedServerTools(), etc. - Move makeMultiAgentSnapshot to outer describe scope (AdkOrchestrator.test) - Mark ToggleSwitch props as readonly
| const defaultAgent = snapshot.agents.get(snapshot.defaultAgentKey); | ||
| if (!defaultAgent) { | ||
| throw new Error( | ||
| `[AdkOrchestrator] Default agent "${snapshot.defaultAgentKey}" not found`, | ||
| ); | ||
| } | ||
|
|
||
| const deps = await buildDepsForAgent(defaultAgent); | ||
| const model = new BackstageModelAdapter(this.chatService, deps.client); | ||
| const adkConfig = toAdkEffectiveConfig(deps.config); | ||
| const adkAgents = this.snapshotToAdkAgents(snapshot); | ||
| const adkMcpServers = deps.mcpServers.map(toAdkMcpServerConfig); | ||
| const functionTools = await this.discoverBackendTools(deps); | ||
|
|
||
| const toolResolver = this.buildToolResolver(functionTools, deps); |
There was a problem hiding this comment.
3. Deps built for default agent 🐞 Bug ✓ Correctness
AdkOrchestrator.buildRunOptions always calls buildDepsForAgent(defaultAgent), so when resuming from a non-default active agent the per-agent dependencies/config (if any) will not be built for the actual starting agent.
Agent Prompt
### Issue description
When resuming from a continuation state, the orchestrator chooses the correct `currentAgentKey` for routing, but still builds `ChatDeps` using the default agent.
### Issue Context
`BuildDepsForAgent` is intended to produce per-agent dependencies. Using the default agent can be wrong when the run is resumed from a different agent.
### Fix Focus Areas
- workspaces/augment/plugins/augment-backend/src/providers/llamastack/adk-adapters/AdkOrchestrator.ts[101-132]
- workspaces/augment/plugins/augment-backend/src/providers/llamastack/adk-adapters/AdkOrchestrator.ts[257-296]
### Suggested fix
In `buildRunOptions`, select the agent to pass into `buildDepsForAgent` based on:
- `resumeState?.currentAgentKey` (if present and exists in snapshot), otherwise
- `snapshot.defaultAgentKey`.
This aligns deps building with actual run entry agent.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
- Remove maxResponseChars from MCPServerConfig in report.api.md to match the source type (field was removed in limit-removal changes) - Move makeMultiAgentSnapshot to module scope (outside describe block) to satisfy SonarCloud's "no functions in nested scope" rule
…spots Replace http:// with https:// in test fixture data (mock baseUrl and serverUrl values) to clear SonarCloud security hotspot warnings about clear-text protocol usage.
|



Summary
Follow-up to #2555 (augment workspace). Adds multi-agent orchestration improvements, removes artificial limits, and fixes multi-turn agent routing.
resumeState/createContinuationStateso follow-up messages resume from the active agent instead of always restarting from the routerKey changes
Agent routing continuity (fixes router-always-called-first issue)
AdkOrchestrator.ts: UsescreateContinuationState()to save which agent handled each conversation turn, passesresumeStateto ADKrun()/runStream()so the next message goes directly to the active agent@augment-adk/augment-adkfrom 0.1.11 to 0.1.12Limit removals (per design decision)
MAX_AUTO_REAPPROVALS(Llama Stack bug workaround), auth constants, timeouts, and cache limitsTest plan
tsc --noEmitpasses