Skip to content

Features agente mcp a2a - #207

Merged
diegosouzapw merged 30 commits into
mainfrom
features-agente-mcp-a2a
Mar 5, 2026
Merged

diegosouzapw merged 30 commits into
mainfrom
features-agente-mcp-a2a

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

No description provided.

Add stdio-based MCP server support to OmniRoute CLI, enabling AI agents
in VS Code, Cursor, Claude Desktop, and Copilot to interact with
OmniRoute tools (health, combos, quota, routing). Update help text,
gitignore vscode-extension subproject, and include MCP/A2A strategy report.
Register 8 new advanced MCP tools (simulate_route, set_budget_guard,
set_resilience_profile, test_combo, get_provider_metrics,
best_combo_for_task, explain_route, get_session_snapshot) with their
handler implementations. Add A2A smart routing skill that routes
prompts through the OmniRoute pipeline with routing explanation,
cost envelope, and resilience trace metadata.
- Add unit tests for 8 MCP advanced tool handlers (Phase 3)
- Migrate test files from JavaScript to TypeScript (.ts/.tsx)
- Restructure file paths from app/ to src/app/ across all tests
- Refactor route assertions into reusable assertRouteMethods helper
- Add tests for new API routes (compliance, audit-log, evals/[suiteId])
- Update barrel export tests to use consolidated assertion pattern
Introduce `normalizeQuotaResponse` and `normalizeCombosResponse` helpers
to handle varying API response shapes (array vs wrapped object)
consistently across MCP server and advanced tools. Add optional `meta`
field to checkQuotaOutput schema and update sourceEndpoints to reflect
current API routes.
…sion

Introduce full AI orchestration ecosystem:
- MCP Server with 16 tools, scoped auth, and audit logging
- A2A v0.3 server with JSON-RPC 2.0, SSE streaming, and task manager
- Auto-Combo engine with 6-factor scoring and self-healing
- VS Code extension with smart dispatch and budget tracking
- Harden CI pipeline: add static checks, remove continue-on-error
- Add translator schema validation tests
- Update .gitignore and CHANGELOG for release checklist
- Add type annotations to all providerModels helper functions
- Introduce LegacyProvider interface in providerRegistry
- Refactor translator system to use self-registering module pattern
  with bootstrapTranslatorRegistry() and per-file imports
- Simplify translator/index.ts by delegating to modular translators
- Remove hardcoded Gemini OAuth client secret for security
Implement Agent-to-Agent (A2A) JSON-RPC 2.0 endpoint with smart routing
and quota management skills, SSE streaming, and task lifecycle management.

- Add /a2a route with message/send, message/stream, tasks/get, tasks/cancel
- Add /.well-known/agent.json agent card endpoint
- Introduce Zod-based request validation schemas for all v1 API routes
- Extract shared getUnifiedModelsResponse to reduce duplication across
  /models, /v1/models, and /a2a model listing
- Refactor chat, embeddings, moderations, and models routes to use
  centralized validation and error handling
- Add A2A task manager, routing logger, and streaming utilities
…hemas

Eliminate `any` usage across the codebase by introducing proper generics,
typed interfaces (StatementLike, DbLike, PromptRow, etc.), and helper
conversion functions (toNumber, toString, parseVariables). Add
comprehensive Zod validation schemas for API endpoint inputs to enforce
runtime type safety alongside compile-time checks.
- Add HTTP error pages (400, 401, 403, 408, 429, 500, 502, 503)
- Add maintenance, offline, and system status pages
- Harden db/core.ts, db/apiKeys.ts, db/cliToolState.ts, db/backup.ts
- Strengthen compliance/index.ts audit logging
- Improve container.ts DI registrations
- Fix dataPaths.ts and tokenHealthCheck.ts
…d pages

- Replace all `as any` casts in MCP advancedTools with typed helpers (toRecord, toString, toNumber)
- Harden open-sse services: rateLimitManager, sessionManager, usage, roleNormalizer, signatureCache, comboMetrics
- Improve responseSanitizer and responseTranslator type safety
- Remove deprecated openai-responses request translator
- Add dashboard pages: /a2a, /mcp, /auto-combo with live data
- Improve error/loading/not-found pages with consistent design
- Add root loading.tsx and typecheck tsconfig variants
- Add check-t11-any-budget.mjs audit script
…and stream handling, and update various handlers and translators.
…mits (#198)

- Issue #199: proxy_ prefix on tool names is now automatically disabled
  when routing to non-Claude backends (Gemini, Compatible, etc.).
  Prevents tool name mismatches in OpenCode, Cursor, and other clients.

- Issue #198: Added customRpm/customTpm support per provider connection.
  Users can configure custom rate limits via connection settings,
  overriding the default auto-learned limits from response headers.
… bug

Extracted validateBody, isValidationFailure, and loginSchema from the
935-line schemas.ts barrel file into a dedicated helpers.ts module.
Updated 70 API route files to import directly from helpers.ts.

Root cause: webpack on certain environments fails to resolve exports
from the bottom of large barrel files (schemas.ts), causing
'(0, O.Jb) is not a function' errors in production builds.

Fix: Split validation helpers into a small dedicated module (helpers.ts)
so webpack can correctly resolve all exports regardless of file size.

- TypeScript compiles with 0 errors
- All API routes updated to import from helpers.ts
- schemas.ts re-exports from helpers.ts for backward compatibility
Copilot AI review requested due to automatic review settings March 5, 2026 11:13

Copilot AI 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.

Pull request overview

Introduces MCP/A2A-facing capabilities and tightens API reliability by standardizing request validation and error handling across many routes, plus adds new testing tooling and status pages.

Changes:

  • Added Zod-based request validation to many API routes via shared validateBody helpers and per-route schemas.
  • Added new endpoints/pages (agent discovery card, auto-combo API, OpenClaw auto-order integration, HTTP error pages).
  • Expanded CI/testing automation (route-validation check, docs sync check, Playwright/Vitest orchestration) and bumped package version.

Reviewed changes

Copilot reviewed 210 out of 328 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/app/api/v1/messages/count_tokens/route.ts Adds schema validation for request body
src/app/api/v1/images/generations/route.ts Adds schema validation; removes manual checks
src/app/api/v1/embeddings/route.ts Adds schema validation; removes manual checks
src/app/api/v1/chat/completions/route.ts Changes guard failure handling to 503
src/app/api/v1/audio/speech/route.ts Adds schema validation for request body
src/app/api/usage/budget/route.ts Adds schema validation; sanitizes 500 errors
src/app/api/usage/analytics/route.ts Hardens connection mapping typing/parsing
src/app/api/translator/send/route.ts Adds validation; hardens baseUrl extraction
src/app/api/translator/save/route.ts Adds validation; sanitizes 500 errors
src/app/api/translator/detect/route.ts Adds validation; sanitizes 500 errors
src/app/api/sync/cloud/route.ts Adds schema validation for sync action
src/app/api/settings/thinking-budget/route.ts Adds validation; sanitizes 500 errors
src/app/api/settings/system-prompt/route.ts Adds validation; sanitizes 500 errors
src/app/api/settings/route.ts Switches to validation helpers; sanitizes 500 errors
src/app/api/settings/require-login/route.ts Adds validation; improves JSON error shape
src/app/api/settings/model-aliases/route.ts Adds validation to PUT/POST/DELETE
src/app/api/settings/ip-filter/route.ts Adds validation; sanitizes 500 errors
src/app/api/settings/combo-defaults/route.ts Adds validation; simplifies update flow
src/app/api/settings/background-degradation/route.ts Adds validation for config + reset action
src/app/api/resilience/route.ts Adds validation; improves typing/error handling
src/app/api/rate-limits/route.ts Adds validation; hardens connection typing
src/app/api/providers/validate/route.ts Adds validation; improves JSON error shape
src/app/api/providers/test-batch/route.ts Adds validation; improves JSON error shape
src/app/api/providers/route.ts Uses validation helpers for create-provider
src/app/api/providers/[id]/test/route.ts Guards invalid provider; uses sanitized provider
src/app/api/providers/[id]/route.ts Adds validation for provider updates
src/app/api/provider-nodes/validate/route.ts Adds validation; improves JSON error shape
src/app/api/provider-nodes/route.ts Adds validation; removes manual checks
src/app/api/provider-nodes/[id]/route.ts Adds validation; hardens connection updates
src/app/api/provider-models/route.ts Adds validation; sanitizes 500 errors
src/app/api/provider-metrics/route.ts Improves typing/number parsing robustness
src/app/api/pricing/route.ts Adds validation; removes manual structure checks
src/app/api/pricing/models/route.ts Hardens types for custom model catalog merge
src/app/api/policies/route.ts Adds validation; sanitizes 500 errors
src/app/api/oauth/kiro/social-exchange/route.ts Adds validation; improves JSON error shape
src/app/api/oauth/kiro/import/route.ts Adds validation; improves JSON error shape
src/app/api/oauth/cursor/import/route.ts Adds validation; improves JSON error shape
src/app/api/monitoring/health/route.ts Sanitizes 500 error payloads
src/app/api/models/route.ts Adds validation; improves JSON error shape
src/app/api/models/availability/route.ts Adds validation; sanitizes 500 errors
src/app/api/models/alias/route.ts Adds validation for authenticated alias updates
src/app/api/keys/route.ts Uses validation helpers; hardens key masking
src/app/api/keys/[id]/route.ts Adds validation; extends payload with noLog
src/app/api/fallback/chains/route.ts Adds validation; sanitizes 500 errors
src/app/api/evals/route.ts Adds validation; improves JSON error shape
src/app/api/db-backups/route.ts Adds validation; improves JSON error shape
src/app/api/combos/test/route.ts Adds validation; improves JSON error shape
src/app/api/combos/route.ts Uses validation helpers for create-combo
src/app/api/combos/auto/route.ts Adds new auto-combo API (in-memory)
src/app/api/combos/[id]/route.ts Adds validation for combo updates
src/app/api/cloud/models/alias/route.ts Adds validation; improves JSON error shape
src/app/api/cloud/model/resolve/route.ts Adds validation; hardens resolved alias typing
src/app/api/cloud/credentials/update/route.ts Adds validation; hardens connectionId typing
src/app/api/cloud/auth/route.ts Hardens masking to handle non-string values
src/app/api/cli-tools/openclaw/auto-order/route.ts Adds OpenClaw auto-order integration endpoint
src/app/api/cli-tools/openclaw-settings/route.ts Adds validation for CLI tool config
src/app/api/cli-tools/kilo-settings/route.ts Adds validation for CLI tool config
src/app/api/cli-tools/guide-settings/[toolId]/route.ts Adds validation for guide settings save
src/app/api/cli-tools/droid-settings/route.ts Adds validation for CLI tool config
src/app/api/cli-tools/codex-settings/route.ts Adds validation for CLI tool config
src/app/api/cli-tools/codex-profiles/route.ts Adds validation for profile actions
src/app/api/cli-tools/cline-settings/route.ts Adds validation for CLI tool config
src/app/api/cli-tools/claude-settings/route.ts Adds validation for env payload
src/app/api/cli-tools/backups/route.ts Adds validation for backup mutations
src/app/api/cli-tools/antigravity-mitm/route.ts Adds validation for MITM start/stop
src/app/api/cli-tools/antigravity-mitm/alias/route.ts Adds validation for MITM alias updates
src/app/api/auth/login/route.ts Refactors validation usage; sanitizes errors
src/app/503/page.tsx Adds 503 error page
src/app/502/page.tsx Adds 502 error page
src/app/500/page.tsx Adds 500 error page
src/app/429/page.tsx Adds 429 error page
src/app/408/page.tsx Adds 408 error page
src/app/403/page.tsx Adds 403 error page
src/app/401/page.tsx Adds 401 error page
src/app/400/page.tsx Adds 400 error page
src/app/.well-known/agent.json/route.ts Adds A2A agent card discovery endpoint
src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx Fixes HeroSection prop usage
src/app/(dashboard)/dashboard/settings/loading.tsx Improves loading skeleton + a11y attrs
src/app/(dashboard)/dashboard/settings/error.tsx Improves error UI + a11y; avoids leaking prod errors
src/app/(dashboard)/dashboard/settings/components/ModelAliasesTab.tsx Improves typing and minor formatting
src/app/(dashboard)/dashboard/providers/loading.tsx Improves loading skeleton + a11y attrs
src/app/(dashboard)/dashboard/providers/error.tsx Improves error UI + a11y; avoids leaking prod errors
src/app/(dashboard)/dashboard/cli-tools/components/DefaultToolCard.tsx Safer default args for translations
src/app/(dashboard)/dashboard/analytics/loading.tsx Improves loading skeleton + a11y attrs
scripts/runtime-env.mjs Adds env color sanitization helper
scripts/run-playwright-tests.mjs Adds Playwright runner wrapper
scripts/run-next-playwright.mjs Adds Next webserver wrapper for e2e
scripts/run-ecosystem-tests.mjs Adds ecosystem test orchestration runner
scripts/check-route-validation.mjs Adds CI check for validateBody usage
scripts/check-docs-sync.mjs Adds CI check for version sync
playwright.config.ts Adjusts webServer orchestration and parallelism
package.json Bumps version; adds tooling/scripts/deps
open-sse/utils/usageTracking.ts Clarifies docs language
open-sse/utils/tlsClient.ts Improves typing + header normalization
open-sse/utils/streamHandler.ts Improves typing + safer error handling
open-sse/utils/requestLogger.ts Clarifies docs language
open-sse/utils/proxyFetch.ts Improves typing + dispatcher-safe fetch
open-sse/utils/ollamaTransform.ts Improves typing for tool-call accumulation
open-sse/utils/networkProxy.ts Tightens JSDoc return type
open-sse/utils/logger.ts Replaces any with unknown record
open-sse/utils/error.ts Tightens types; avoids retryAfter string formatting issues
open-sse/utils/comfyuiClient.ts Adds robust JSON parsing/typing checks
open-sse/utils/bypassHandler.ts Clarifies docs language
open-sse/translator/response/openai-to-claude.ts Switches to new translator registry import
open-sse/translator/response/openai-to-antigravity.ts Switches registry import; adds typings
open-sse/translator/response/openai-responses.ts Switches registry import; tightens typing
open-sse/translator/response/kiro-to-openai.ts Switches registry import; tightens typing
open-sse/translator/response/gemini-to-openai.ts Switches registry import; tightens typing
open-sse/translator/response/gemini-to-claude.ts Switches to new translator registry import
open-sse/translator/response/cursor-to-openai.ts Switches to new translator registry import
open-sse/translator/response/claude-to-openai.ts Switches registry import; adds typings
open-sse/translator/request/openai-to-kiro.ts Switches registry import; adds typings
open-sse/translator/request/openai-to-gemini.ts Switches registry import; adds typings
open-sse/translator/request/openai-to-cursor.ts Switches registry import; adds typings
open-sse/translator/request/gemini-to-openai.ts Switches registry import; adds typings
open-sse/translator/request/claude-to-openai.ts Switches registry import; normalizes tool_choice
open-sse/translator/request/claude-to-gemini.ts Switches registry import; adds typings
open-sse/translator/request/antigravity-to-openai.ts Switches registry import; adds typings
open-sse/translator/registry.ts Adds explicit translator registry module
open-sse/translator/helpers/responsesApiHelper.ts Clarifies comment for tool-call flushing
open-sse/translator/helpers/openaiHelper.ts Normalizes Claude tool_choice required mapping
open-sse/translator/helpers/geminiHelper.ts Tightens types for schema merging
open-sse/translator/bootstrap.ts Adds explicit translator bootstrap module
open-sse/services/wildcardRouter.ts Tightens docs type + wording
open-sse/services/tokenRefresh.ts Tightens types for circuit breaker + logger
open-sse/services/thinkingBudget.ts Clarifies docs language
open-sse/services/signatureCache.ts Tightens types + model-family parsing
open-sse/services/rateLimitSemaphore.ts Adds typed error.code field
open-sse/services/provider.ts Tightens buildProviderUrl option typing
open-sse/services/contextManager.ts Tightens option typing + formatting
open-sse/services/comboMetrics.ts Adds explicit metric types and signatures
open-sse/services/comboConfig.ts Tightens provider override typing
open-sse/services/combo.ts Clarifies docs/comments
open-sse/services/backgroundTaskDetector.ts Tightens types; safer message extraction
open-sse/services/autoCombo/persistence.ts Adds persistence for auto-combo learning
open-sse/services/autoCombo/modePacks.ts Adds predefined scoring weight packs
open-sse/services/autoCombo/index.ts Adds barrel exports for autoCombo module
open-sse/services/accountSelector.ts Tightens strategy state typing
open-sse/services/accountFallback.ts Safer .unref usage; tightens typing
open-sse/mcp-server/scopeEnforcement.ts Adds MCP tool scope evaluation helpers
open-sse/mcp-server/schemas/index.ts Adds MCP/A2A schema barrel export
open-sse/mcp-server/schemas/audit.ts Adds audit types + hashing/summarization
open-sse/mcp-server/index.ts Adds MCP server barrel export
open-sse/mcp-server/tests/a2aLifecycle.test.ts Adds A2A task lifecycle regression tests
open-sse/handlers/sseParser.ts Replaces any with unknown record
open-sse/handlers/responsesHandler.ts Removes as any cast at call site
open-sse/handlers/rerank.ts Tightens JSDoc return type
open-sse/handlers/moderations.ts Tightens JSDoc return type
open-sse/handlers/imageGeneration.ts Replaces any with unknown; formatting
open-sse/handlers/embeddings.ts Replaces any with unknown for upstream body
open-sse/handlers/chatCore.ts Adjusts translation flow; respects noLog flag
open-sse/handlers/audioTranscription.ts Tightens typing; safer file name handling
open-sse/handlers/audioSpeech.ts Tightens JSDoc return type; formatting
open-sse/executors/iflow.ts Tightens credential/body typing
open-sse/executors/default.ts Clarifies comment language
open-sse/executors/cursor.ts Tightens typing; safer URL/header handling
open-sse/executors/antigravity.ts Clarifies comment language
open-sse/config/registryUtils.ts Clarifies comment language
open-sse/config/providerRegistry.ts Removes hardcoded secrets; tightens typing
open-sse/config/providerModels.ts Adds TS types for registry model helpers
open-sse/config/imageRegistry.ts Clarifies comment language
open-sse/config/codexInstructions.ts Doc wording tweaks
docs/openapi.yaml Updates API version field
docs/TROUBLESHOOTING.md Updates troubleshooting guidance and storage docs
docs/RELEASE_CHECKLIST.md Adds release checklist doc
.github/workflows/ci.yml Adds new checks/typechecks to CI

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/app/api/auth/login/route.ts Resolved
Comment on lines +47 to +72
export async function POST(req: NextRequest) {
try {
const body = await req.json();
const { id, name, candidatePool, weights, modePack, budgetCap, explorationRate } = body;

if (!id || !name) {
return NextResponse.json({ error: "id and name required" }, { status: 400 });
}

const config: AutoComboConfig = {
id,
name,
type: "auto",
candidatePool: candidatePool || [],
weights: weights || DEFAULT_WEIGHTS,
modePack,
budgetCap,
explorationRate: explorationRate ?? 0.05,
};
autoCombos.set(id, config);

return NextResponse.json(config, { status: 201 });
} catch (err) {
return NextResponse.json({ error: String(err) }, { status: 500 });
}
}

Copilot AI Mar 5, 2026

Copy link

Choose a reason for hiding this comment

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

This new route uses req.json() but does not call validateBody(...), which will cause the newly added scripts/check-route-validation.mjs CI check to fail. Also, malformed JSON currently returns a 500 with String(err) (leaks error details and uses the wrong status code); it should return a structured 400 like the other validated routes. Add a request schema + validateBody (and a JSON parse 400 path) to align with the rest of the API and to satisfy the new validation guard.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment thread docs/openapi.yaml Resolved
Comment on lines +60 to 72
} catch (error) {
console.error("[SECURITY] Prompt injection guard failed:", error);
return new Response(
JSON.stringify({
error: {
message: "Security validation temporarily unavailable",
type: "security_guard_unavailable",
code: "SECURITY_002",
},
}),
{ status: 503, headers: { "Content-Type": "application/json" } }
);
}

Copilot AI Mar 5, 2026

Copy link

Choose a reason for hiding this comment

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

This newly introduced early-return response does not include the CORS headers used elsewhere in the API routes (many other handlers merge ...CORS_HEADERS). If browser clients hit this path, they may get blocked by CORS even though the server returned JSON. Include the standard CORS headers on this 503 response (or route through the shared error helper used by the other endpoints).

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@kilo-code-bot

kilo-code-bot Bot commented Mar 5, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No New Issues Found | Recommendation: Merge

Overview

This PR is primarily a documentation and localization update with no actual code changes to TypeScript/JavaScript source files.

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0

Files Changed (25 files with actual content changes)

File Type Changes
.github/workflows/ci.yml CI/CD +6/-2
.gitignore Config +5/-1
AGENTS.md Documentation +55/-1
CHANGELOG.md Documentation +172/0
README.md + 24 translations Localization Various

Key Changes

  1. CI Workflow Updates (.github/workflows/ci.yml):

    • Added new test commands: check:cycles, check:route-validation:t06, check:any-budget:t11, check:docs-sync, typecheck:core, typecheck:noimplicit:core
    • Removed continue-on-error: true from integration and security test jobs
  2. Documentation Updates:

    • Updated AGENTS.md to reflect v2.0.0 architecture (MCP Server, A2A Protocol, Auto-Combo Engine)
    • Updated CHANGELOG.md with v2.0.1 release notes
  3. Localization:

    • Updated 25 README translation files
  4. Gitignore Updates:

    • Added docs/RELEASE_CHECKLIST.md to negation pattern
    • Changed app/ to /app/
    • Added vscode-extension/ entry

Notes

  • 75+ TypeScript/JavaScript files are listed in the PR but show 0 additions, 0 deletions - these are not actually modified in this PR
  • The existing inline comments in this PR refer to issues in files that are NOT changed in this PR (e.g., accountFallback.ts, route.ts, chatCore.ts)
  • No code changes = no new bugs, security issues, or logic problems introduced
Files Reviewed (25 files with changes)
  • .github/workflows/ci.yml
  • .gitignore
  • AGENTS.md
  • CHANGELOG.md
  • README.ar.md
  • README.bg.md
  • README.da.md
  • README.de.md
  • README.es.md
  • README.fi.md
  • README.fr.md
  • README.he.md
  • README.hu.md
  • README.id.md
  • README.in.md
  • README.it.md
  • README.ja.md
  • README.ko.md
  • README.md
  • README.ms.md
  • README.nl.md
  • README.no.md
  • README.phi.md
  • README.pl.md
  • README.pt-BR.md

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces major enhancements to OmniRoute, focusing on agent integration through MCP and A2A protocols, improved code quality, and enhanced documentation. These changes transform OmniRoute into a more agent-controllable platform, offering better orchestration and management capabilities.

Highlights

  • MCP and A2A Integration: This PR introduces the Model Context Protocol (MCP) and Agent-to-Agent (A2A) protocol features, enabling enhanced agent orchestration and control over OmniRoute.
  • VS Code Extension Enhancement: The PR includes updates to support VS Code extension features, providing better integration with IDE environments.
  • Documentation and Testing: Comprehensive documentation updates and new tests have been added to cover the new MCP and A2A functionalities, ensuring reliability and ease of use.
  • Code Quality and Type Safety: Significant improvements in code quality and type safety, including the elimination of any types and the addition of Zod validation schemas, enhance the robustness and maintainability of the codebase.
  • CLI Tooling: The introduction of a new CLI tool (mcp-server.mjs) and enhancements to the existing omniroute CLI provide better support for agent integrations and server management.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Updated to exclude new directories and files related to VS Code extension and other build artifacts.
  • CHANGELOG.md
    • Added detailed release notes for version 2.0.0, including MCP Server, A2A Protocol, Auto-Combo Engine, VS Code extension features, and code quality improvements.
  • README.md
    • Updated to reflect the new MCP and A2A agent orchestration features, and added a new command-line option for starting the MCP server.
  • bin/mcp-server.mjs
    • Added a new CLI tool for starting the MCP server, facilitating IDE integration.
  • bin/omniroute.mjs
    • Enhanced the OmniRoute CLI with a new --mcp flag to start the MCP server.
  • docs/ARCHITECTURE.md
    • Updated the architecture documentation to reflect changes in the persistence layer (SQLite migration) and new API endpoints.
  • docs/RELEASE_CHECKLIST.md
    • Added a new release checklist to ensure thorough validation before new releases.
  • docs/TROUBLESHOOTING.md
    • Updated troubleshooting documentation to reflect changes in configuration and storage.
  • docs/openapi.yaml
    • Updated the OpenAPI specification to version 1.8.1.
  • omniroute_switchboard_mcp_a2a_expanded_report_2026-03-03.md
    • Added a new report detailing the integration of OmniRoute with the Omni VS Code Extension and MCP/A2A protocols.
  • open-sse/config/codexInstructions.ts
    • Updated instructions for Codex, clarifying approval requirements in sandboxed environments.
  • open-sse/config/imageRegistry.ts
    • Updated comments for clarity.
  • open-sse/config/providerModels.ts
    • Added TypeScript types and modularized the translator registry.
  • open-sse/config/providerRegistry.ts
    • Removed hardcoded client secrets and updated comments for clarity.
  • open-sse/config/registryUtils.ts
    • Updated comments for clarity.
  • open-sse/executors/antigravity.ts
    • Updated comments for clarity.
  • open-sse/executors/base.ts
    • Added types and documentation, improved signal handling, and enhanced error handling.
  • open-sse/executors/cursor.ts
    • Improved type safety and added null check for chatPath.
  • open-sse/executors/default.ts
    • Updated comments for clarity.
  • open-sse/executors/iflow.ts
    • Added types and documentation.
  • open-sse/executors/kiro.ts
    • Added types and documentation, improved error handling, and enhanced stream processing.
  • open-sse/handlers/audioSpeech.ts
    • Improved type safety and added null check for token.
  • open-sse/handlers/audioTranscription.ts
    • Improved type safety and added null check for file name.
  • open-sse/handlers/chatCore.ts
    • Added logic to disable tool name prefix for non-Claude backends, improved type safety, and enhanced logging.
  • open-sse/handlers/embeddings.ts
    • Improved type safety.
  • open-sse/handlers/imageGeneration.ts
    • Improved error handling and type safety.
  • open-sse/handlers/moderations.ts
    • Improved type safety.
  • open-sse/handlers/rerank.ts
    • Improved type safety.
  • open-sse/handlers/responseSanitizer.ts
    • Improved type safety and added null checks.
  • open-sse/handlers/responseTranslator.ts
    • Improved type safety and added null checks.
  • open-sse/handlers/sseParser.ts
    • Improved type safety.
  • open-sse/mcp-server/README.md
    • Added a new README file detailing the MCP server, its architecture, tool reference, and client examples.
  • open-sse/mcp-server/tests/a2aLifecycle.test.ts
    • Added new unit tests for A2A task lifecycle regressions.
  • open-sse/mcp-server/tests/advancedTools.test.ts
    • Added new unit tests for MCP advanced tools.
  • open-sse/mcp-server/tests/essentialTools.test.ts
    • Added new unit tests for MCP essential tools.
  • open-sse/mcp-server/audit.ts
    • Added a new audit logger with SHA-256 input hashing and output summarization.
  • open-sse/mcp-server/index.ts
    • Added a barrel export for the MCP server.
  • open-sse/mcp-server/schemas/a2a.ts
    • Added schemas for A2A protocol types.
  • open-sse/mcp-server/schemas/audit.ts
    • Added schemas for audit log entries.
  • open-sse/mcp-server/schemas/index.ts
    • Added a barrel export for MCP server schemas.
  • open-sse/mcp-server/schemas/tools.ts
    • Added Zod schemas for all 16 MCP tools, including input/output validation and scope declarations.
  • open-sse/mcp-server/scopeEnforcement.ts
    • Added scope enforcement logic for MCP tools.
  • open-sse/mcp-server/server.ts
    • Implemented the MCP server with stdio transport and registered all essential and advanced tools.
  • open-sse/services/accountFallback.ts
    • Improved type safety and added null checks.
  • open-sse/services/accountSelector.ts
    • Improved type safety.
  • open-sse/services/autoCombo/tests/autoCombo.test.ts
    • Added unit tests for the Auto-Combo Engine.
  • open-sse/services/autoCombo/engine.ts
    • Implemented the Auto-Combo Engine with scoring, bandit exploration, budget cap, and self-healing.
  • open-sse/services/autoCombo/index.ts
    • Added a barrel export for the Auto-Combo Engine.
  • open-sse/services/autoCombo/modePacks.ts
    • Added mode packs for different optimization profiles.
  • open-sse/services/autoCombo/persistence.ts
    • Implemented persistence for Auto-Combo adaptation state.
  • open-sse/services/autoCombo/scoring.ts
    • Implemented scoring functions for Auto-Combo provider selection.
  • open-sse/services/autoCombo/selfHealing.ts
    • Implemented self-healing mechanisms for Auto-Combo.
  • open-sse/services/autoCombo/taskFitness.ts
    • Implemented task fitness lookup table for Auto-Combo.
  • open-sse/services/backgroundTaskDetector.ts
    • Improved type safety.
  • open-sse/services/rateLimitManager.ts
    • Improved type safety and added custom rate limiting support.
  • open-sse/services/roleNormalizer.ts
    • Improved type safety.
  • open-sse/services/sessionManager.ts
    • Improved type safety.
  • open-sse/services/signatureCache.ts
    • Improved type safety.
  • open-sse/services/thinkingBudget.ts
    • Improved type safety.
  • open-sse/translator/bootstrap.ts
    • Added explicit translator bootstrap module.
  • open-sse/translator/helpers/geminiHelper.ts
    • Improved type safety.
  • open-sse/translator/helpers/openaiHelper.ts
    • Fixed a typo and added logic to disable tool name prefix when routing Claude-format requests to non-Claude backends.
  • open-sse/translator/index.ts
    • Added explicit translator bootstrap and improved type safety.
  • open-sse/translator/registry.ts
    • Added translator registry.
  • open-sse/translator/request/antigravity-to-openai.ts
    • Improved type safety.
  • open-sse/translator/request/claude-to-gemini.ts
    • Improved type safety.
  • open-sse/translator/request/claude-to-openai.ts
    • Improved type safety and added logic to disable tool name prefix when routing Claude-format requests to non-Claude backends.
  • open-sse/translator/request/gemini-to-openai.ts
    • Improved type safety.
  • open-sse/translator/request/openai-responses.ts
    • Improved type safety.
  • open-sse/translator/request/openai-to-claude.ts
    • Improved type safety.
  • open-sse/translator/request/openai-to-cursor.ts
    • Improved type safety.
  • open-sse/translator/request/openai-to-kiro.ts
    • Improved type safety.
  • open-sse/translator/response/claude-to-openai.ts
    • Improved type safety.
  • open-sse/translator/response/gemini-to-openai.ts
    • Improved type safety.
  • open-sse/translator/response/kiro-to-openai.ts
    • Improved type safety.
  • open-sse/translator/response/openai-responses.ts
    • Improved type safety.
  • open-sse/translator/response/openai-to-antigravity.ts
    • Improved type safety.
  • src/app/(dashboard)/dashboard/a2a/page.tsx
    • Added a new dashboard page for A2A server.
  • src/app/(dashboard)/dashboard/auto-combo/page.tsx
    • Added a new dashboard page for Auto-Combo Engine.
  • src/app/(dashboard)/dashboard/mcp/page.tsx
    • Added a new dashboard page for MCP server.
  • src/app/400/page.tsx
    • Added a custom error page for HTTP 400 status codes.
  • src/app/401/page.tsx
    • Added a custom error page for HTTP 401 status codes.
  • src/app/403/page.tsx
    • Added a custom error page for HTTP 403 status codes.
  • src/app/408/page.tsx
    • Added a custom error page for HTTP 408 status codes.
  • src/app/429/page.tsx
    • Added a custom error page for HTTP 429 status codes.
  • src/app/500/page.tsx
    • Added a custom error page for HTTP 500 status codes.
  • src/app/502/page.tsx
    • Added a custom error page for HTTP 502 status codes.
  • src/app/503/page.tsx
    • Added a custom error page for HTTP 503 status codes.
  • src/app/a2a/route.ts
    • Implemented the A2A JSON-RPC 2.0 router with methods for message sending, task management, and streaming.
  • src/app/api/cli-tools/antigravity-mitm/alias/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/antigravity-mitm/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/backups/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/claude-settings/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/codex-profiles/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/codex-settings/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/droid-settings/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/guide-settings/[toolId]/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/kilo-settings/route.ts
    • Added validation for request body.
  • src/app/api/cli-tools/openclaw-settings/route.ts
    • Added validation for request body.
  • src/app/api/cloud/auth/route.ts
    • Improved type safety and added null checks.
  • src/app/api/cloud/credentials/update/route.ts
    • Added validation for request body.
  • src/app/api/cloud/models/alias/route.ts
    • Added validation for request body.
  • src/app/api/combos/[id]/route.ts
    • Added validation for request body.
  • src/app/api/combos/auto/route.ts
    • Added a new API endpoint for managing auto-combos.
  • src/app/api/combos/route.ts
    • Added validation for request body.
  • src/app/api/models/alias/route.ts
    • Added validation for request body.
  • src/app/api/models/route.ts
    • Delegates to the same unified catalog builder used by /api/v1/models (src/app/api/v1/models/catalog.ts) to avoid semantic drift.
  • src/app/api/monitoring/health/route.ts
    • Improved error handling.
  • src/app/api/oauth/[provider]/[action]/route.ts
    • Added validation for request body.
  • src/app/api/policies/route.ts
    • Added validation for request body.
  • src/app/api/pricing/models/route.ts
    • Delegates to the same unified catalog builder used by /api/v1/models (src/app/api/v1/models/catalog.ts) to avoid semantic drift.
  • src/app/api/pricing/route.ts
    • Added validation for request body.
  • src/app/api/provider-metrics/route.ts
    • Delegates to the same unified catalog builder used by /api/v1/models (src/app/api/v1/models/catalog.ts) to avoid semantic drift.
  • src/app/api/provider-nodes/[id]/route.ts
    • Added validation for request body.
  • src/app/api/provider-nodes/route.ts
    • Added validation for request body.
  • src/app/api/providers/[id]/models/route.ts
    • Delegates to the same unified catalog builder used by /api/v1/models (src/app/api/v1/models/catalog.ts) to avoid semantic drift.
  • src/app/api/providers/[id]/route.ts
    • Added validation for request body.
  • src/app/api/providers/route.ts
    • Added validation for request body.
  • src/app/api/providers/test-batch/route.ts
    • Added validation for request body.
  • src/app/api/providers/validate/route.ts
    • Added validation for request body.
  • src/app/api/rate-limits/route.ts
    • Added validation for request body.
  • src/app/api/settings/background-degradation/route.ts
    • Added validation for request body.
  • src/app/api/settings/proxy/route.ts
    • Added validation for request body.
  • src/app/api/settings/proxy/test/route.ts
    • Added validation for request body.
  • src/app/api/settings/require-login/route.ts
    • Added validation for request body.
  • src/app/api/settings/route.ts
    • Added validation for request body.
  • src/app/api/settings/system-prompt/route.ts
    • Added validation for request body.
  • src/app/api/telemetry/route.ts
    • Added telemetry API.
  • src/app/api/translator/detect/route.ts
    • Added validation for request body.
  • src/app/api/translator/save/route.ts
    • Added validation for request body.
  • src/app/api/translator/send/route.ts
    • Added validation for request body.
  • src/lib/a2a/routingLogger.ts
    • Added A2A routing logger.
  • src/lib/a2a/skills/quotaManagement.ts
    • Added A2A quota management skill.
  • src/lib/a2a/skills/smartRouting.ts
    • Added A2A smart routing skill.
  • src/lib/a2a/streaming.ts
    • Added A2A streaming logic.
  • src/lib/a2a/taskExecution.ts
    • Added A2A task execution logic.
  • src/lib/a2a/taskManager.ts
    • Added A2A task manager.
  • src/lib/db/migrations/002_mcp_a2a_tables.sql
    • Added database migrations for MCP and A2A tables.
  • src/lib/oauth/services/budgetGuard.ts
    • Added budget guard service.
  • src/lib/oauth/services/healthMonitor.ts
    • Added health monitor service.
  • src/lib/oauth/services/humanCheckpoint.ts
    • Added human checkpoint service.
  • src/lib/oauth/services/modePackSelector.ts
    • Added mode pack selector service.
  • src/lib/oauth/services/policyEngine.ts
    • Added policy engine service.
  • src/lib/oauth/services/preflightDialog.ts
    • Added preflight dialog service.
  • src/shared/components/ErrorPageScaffold.tsx
    • Added a new component for custom error pages.
  • src/shared/components/Loading.tsx
    • Added new loading components.
  • src/shared/constants/mcpScopes.ts
    • Added constants for MCP scopes.
  • src/shared/contracts/quota.ts
    • Added shared API contracts for quota.
  • src/shared/validation/helpers.ts
    • Added validation helpers.
  • src/shared/validation/schemas.ts
    • Added validation schemas.
  • src/vscode-extension/src/services/a2aClient.ts
    • Added A2A client service.
  • src/vscode-extension/src/services/budgetGuard.ts
    • Added budget guard service.
  • src/vscode-extension/src/services/healthMonitor.ts
    • Added health monitor service.
  • src/vscode-extension/src/services/humanCheckpoint.ts
    • Added human checkpoint service.
  • src/vscode-extension/src/services/mcpClient.ts
    • Added MCP client service.
  • src/vscode-extension/src/services/modePackSelector.ts
    • Added mode pack selector service.
  • src/vscode-extension/src/services/policyEngine.ts
    • Added policy engine service.
  • src/vscode-extension/src/services/preflightDialog.ts
    • Added preflight dialog service.
  • tests/ecosystem.test.ts
    • Added ecosystem tests.
  • tests/t06-schema-hardening.test.mjs
    • Added schema hardening tests.
  • tests/t07-no-log-key-config.test.mjs
    • Added security tests for no-log key configuration.
  • tests/t08-mcp-scope-enforcement.test.mjs
    • Added security tests for MCP scope enforcement.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces significant new features, including the MCP server, A2A protocol support, and an Auto-Combo engine, which represents a major step forward for the project. The extensive refactoring to improve type safety across the codebase by eliminating any types and introducing Zod for validation is a commendable effort that will greatly improve maintainability and robustness.

I've identified a couple of issues: a potential memory leak in the mergeAbortSignals helper and an unsafe type guard in the new MCP server. These are detailed in the specific comments.

Overall, this is a very impressive and well-executed set of changes.

Note: Security Review did not run due to the size of the PR.

Comment on lines +44 to +61
function mergeAbortSignals(primary: AbortSignal, secondary: AbortSignal): AbortSignal {
const controller = new AbortController();

const abortBoth = () => {
if (!controller.signal.aborted) {
controller.abort();
}
};

if (primary.aborted || secondary.aborted) {
abortBoth();
return controller.signal;
}

primary.addEventListener("abort", abortBoth, { once: true });
secondary.addEventListener("abort", abortBoth, { once: true });
return controller.signal;
}

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.

high

This mergeAbortSignals implementation has a memory leak. The event listeners added to primary and secondary signals are not removed if the fetch operation completes successfully without any of the signals being aborted. The { once: true } option only removes a listener after it has been invoked. If a listener is never invoked, it's never removed.

A better implementation would be to ensure listeners are removed when one of them fires. Here is a safer implementation that cleans up both listeners when one of them aborts, preventing a leak if one signal fires but the other doesn't.

function mergeAbortSignals(primary: AbortSignal, secondary: AbortSignal): AbortSignal {
  const controller = new AbortController();

  const onAbort = () => {
    controller.abort();
    // Clean up listeners to prevent memory leaks
    primary.removeEventListener("abort", onAbort);
    secondary.removeEventListener("abort", onAbort);
  };

  if (primary.aborted || secondary.aborted) {
    onAbort();
    return controller.signal;
  }

  primary.addEventListener("abort", onAbort);
  secondary.addEventListener("abort", onAbort);

  return controller.signal;
}

Comment thread open-sse/mcp-server/server.ts Resolved
diegosouzapw and others added 4 commits March 5, 2026 08:41
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

Copilot AI commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@diegosouzapw I've opened a new pull request, #208, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@diegosouzapw I've opened a new pull request, #209, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@diegosouzapw I've opened a new pull request, #210, to work on those changes. Once the pull request is ready, I'll request review from you.

… strategy guides and advanced settings, and introduce E2E tests for the combos flow.
…tion (#208, #209)

- Added CORS_HEADERS spread to 400/503 responses in chat/completions route
- Added createAutoComboSchema with Zod validation to /api/combos/auto
- Isolated JSON parsing errors with structured 400 response
- Prevented String(err) leakage on 500 errors
- Renamed sidebar 'Endpoint' to 'Endpoints', removed standalone MCP/A2A entries
- Created tabbed layout with SegmentedControl: Endpoint Proxy | MCP | A2A | API Endpoints
- Added inline ServiceToggle (online/offline status) for MCP and A2A tabs
- Created ApiEndpointsTab placeholder with Coming Soon badge
- Updated i18n in en.json and pt.json with new endpoints namespace
… Endpoints consolidation

- Rewrote AGENTS.md with v2.0.0 architecture (MCP, A2A, Auto-Combo, Endpoints tabs)
- Updated CHANGELOG unreleased section with Endpoints consolidation details
- Updated README references from Endpoint to Endpoints (screenshots, playbook, quickstart)
- Applied endpoints sidebar/header/namespace i18n to all 28 remaining language files
- Added mcpEnabled/a2aEnabled boolean fields to updateSettingsSchema
- Rewrote ServiceToggle as clickable on/off switch with status indicator
- Toggle persists state via PATCH /api/settings
- Both services default to disabled (OFF)
- Created settingsSchemas.ts with updateSettingsSchema to avoid webpack
  tree-shaking the schema from the 908-line schemas.ts barrel file
- Updated settings/route.ts import to use new dedicated file
- Fixed focusRingColor lint error in ServiceToggle
- Created httpTransport.ts with singleton MCP server and WebStandard
  Streamable HTTP transport running inside Next.js process
- Added /api/mcp/sse route (GET+POST) for SSE transport
- Added /api/mcp/stream route (GET+POST+DELETE) for Streamable HTTP
- Added mcpTransport enum to settingsSchemas (stdio|sse|streamable-http)
- Updated /api/mcp/status to report HTTP transport state
- Added TransportSelector UI with mode buttons and connection URL display
- Routes guard against disabled MCP or wrong transport mode
…P), service toggles, endpoints consolidation

- MCP multi-transport: stdio, SSE (/api/mcp/sse), Streamable HTTP (/api/mcp/stream)
- Service enable/disable toggles with settings persistence (default: OFF)
- Consolidated Endpoints page with tabbed navigation
- Transport selector UI with connection URLs and Copy button
- Webpack barrel-file fix for settingsSchemas
@diegosouzapw
diegosouzapw merged commit 61a9022 into main Mar 5, 2026
2 of 3 checks passed
@diegosouzapw
diegosouzapw deleted the features-agente-mcp-a2a branch March 15, 2026 23:12

This branch had an error being deployed

1 failed deployment
NPM_TOKEN — 61a9022c Deployed Mar 5, 2026 by diegosouzapw
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.

4 participants