-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(hermes): add managed tool gateway broker #3742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b33d5e3
feat(hermes): add managed tool gateway broker
ericksoa 6dd143d
fix(hermes): reap browser CDP tunnel processes
ericksoa ac5378f
fix(hermes): reap invalid browser CDP tunnels
ericksoa bc88f70
Merge branch 'main' into ns322/hermes-managed-tool-gateway-clean
ericksoa a114998
Merge branch 'main' into aerickson/pr-3556-hermes-resume-fix
ericksoa a9b00c4
fix(onboard): resolve sandbox before Hermes resume inference
ericksoa e2be564
fix(hermes): address managed tool gateway feedback
ericksoa 91f356e
Merge remote-tracking branch 'origin/main' into aerickson/pr-3556-her…
ericksoa 26d2ec4
Merge origin/main into aerickson/pr-3556-hermes-resume-fix
ericksoa 8891633
test: refresh E2E parity inventory
ericksoa d75c8c4
Merge origin/main into aerickson/pr-3556-hermes-resume-fix
ericksoa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { existsSync, readFileSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { fileURLToPath } from "node:url"; | ||
|
|
||
| export type ManagedToolGatewayEntry = { | ||
| service: string; | ||
| config: Record<string, unknown>; | ||
| envKey: string; | ||
| envValue: string; | ||
| }; | ||
|
|
||
| export type ManagedToolGatewayMatrix = Record<string, ManagedToolGatewayEntry>; | ||
|
|
||
| export function loadManagedToolGatewayMatrix(): ManagedToolGatewayMatrix { | ||
| const scriptDir = dirname(fileURLToPath(import.meta.url)); | ||
| const candidates = [ | ||
| process.env.NEMOCLAW_HERMES_TOOL_GATEWAY_MATRIX_PATH, | ||
| join(scriptDir, "hermes-managed-tool-gateway-matrix.json"), | ||
| join(scriptDir, "../hermes-managed-tool-gateway-matrix.json"), | ||
| join(scriptDir, "../host/managed-tool-gateway-matrix.json"), | ||
| "/opt/nemoclaw-hermes-config/managed-tool-gateway-matrix.json", | ||
| ].filter((candidate): candidate is string => Boolean(candidate)); | ||
|
|
||
| for (const candidate of candidates) { | ||
| if (!existsSync(candidate)) continue; | ||
| return JSON.parse(readFileSync(candidate, "utf8")) as ManagedToolGatewayMatrix; | ||
| } | ||
|
|
||
| throw new Error("Hermes managed tool gateway matrix not found"); | ||
| } | ||
|
|
||
| export function applyManagedToolConfig( | ||
| config: Record<string, unknown>, | ||
| entryConfig: Record<string, unknown>, | ||
| ): void { | ||
| for (const [section, sectionValue] of Object.entries(entryConfig)) { | ||
| if ( | ||
| sectionValue && | ||
| typeof sectionValue === "object" && | ||
| !Array.isArray(sectionValue) && | ||
| config[section] && | ||
| typeof config[section] === "object" && | ||
| !Array.isArray(config[section]) | ||
| ) { | ||
| config[section] = { | ||
| ...(config[section] as Record<string, unknown>), | ||
| ...(sectionValue as Record<string, unknown>), | ||
| }; | ||
| } else { | ||
| config[section] = sectionValue; | ||
| } | ||
| } | ||
| } |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| { | ||
| "nous-web": { | ||
| "service": "firecrawl", | ||
| "description": "Nous Portal managed web search and crawl gateway", | ||
| "config": { | ||
| "web": { | ||
| "backend": "firecrawl", | ||
| "use_gateway": true | ||
| } | ||
| }, | ||
| "envKey": "FIRECRAWL_GATEWAY_URL", | ||
| "envValue": "http://host.openshell.internal:11436/firecrawl", | ||
| "brokerPath": "/firecrawl", | ||
| "upstream": "https://firecrawl-gateway.nousresearch.com", | ||
| "sandboxAuthHeaders": ["Authorization: Bearer", "x-firecrawl-api-key", "x-api-key"], | ||
| "upstreamAuthHeader": "Authorization: Bearer", | ||
| "policyPreset": "nous-web", | ||
| "tools": ["web_search", "web_extract"] | ||
| }, | ||
| "nous-audio": { | ||
| "service": "openai-audio", | ||
| "description": "Nous Portal managed audio generation and transcription gateway", | ||
| "config": { | ||
| "tts": { | ||
| "provider": "openai", | ||
| "use_gateway": true | ||
| }, | ||
| "stt": { | ||
| "provider": "openai", | ||
| "use_gateway": true | ||
| } | ||
| }, | ||
| "envKey": "OPENAI_AUDIO_GATEWAY_URL", | ||
| "envValue": "http://host.openshell.internal:11436/openai-audio", | ||
| "brokerPath": "/openai-audio", | ||
| "upstream": "https://openai-audio-gateway.nousresearch.com", | ||
| "sandboxAuthHeaders": ["Authorization: Bearer", "openai-api-key", "x-api-key"], | ||
| "upstreamAuthHeader": "Authorization: Bearer", | ||
| "policyPreset": "nous-audio", | ||
| "tools": ["text_to_speech", "transcribe_audio"] | ||
| }, | ||
| "nous-browser": { | ||
| "service": "browser-use", | ||
| "description": "Nous Portal managed browser automation gateway", | ||
| "config": { | ||
| "browser": { | ||
| "cloud_provider": "browser-use", | ||
| "use_gateway": true | ||
| } | ||
| }, | ||
| "envKey": "BROWSER_USE_GATEWAY_URL", | ||
| "envValue": "http://host.openshell.internal:11436/browser-use", | ||
| "brokerPath": "/browser-use", | ||
| "upstream": "https://browser-use-gateway.nousresearch.com", | ||
| "sandboxAuthHeaders": ["X-Browser-Use-API-Key", "x-api-key"], | ||
| "upstreamAuthHeader": "X-Browser-Use-API-Key", | ||
| "policyPreset": "nous-browser", | ||
| "tools": [ | ||
| "browser_navigate", | ||
| "browser_snapshot", | ||
| "browser_click", | ||
| "browser_type", | ||
| "browser_scroll", | ||
| "browser_back", | ||
| "browser_press" | ||
| ], | ||
| "transportExceptions": [ | ||
| "*.cdp1.browser-use.com", | ||
| "*.cdp2.browser-use.com", | ||
| "*.cdp3.browser-use.com", | ||
| "*.cdp4.browser-use.com", | ||
| "*.cdp5.browser-use.com", | ||
| "*.cdp6.browser-use.com", | ||
| "*.cdp7.browser-use.com", | ||
| "*.cdp8.browser-use.com", | ||
| "*.cdp9.browser-use.com", | ||
| "*.cdp10.browser-use.com" | ||
| ] | ||
| }, | ||
| "nous-image": { | ||
| "service": "fal-queue", | ||
| "description": "Nous Portal managed image generation gateway", | ||
| "config": { | ||
| "image_gen": { | ||
| "use_gateway": true | ||
| } | ||
| }, | ||
| "envKey": "FAL_QUEUE_GATEWAY_URL", | ||
| "envValue": "http://host.openshell.internal:11436/fal-queue", | ||
| "brokerPath": "/fal-queue", | ||
| "upstream": "https://fal-queue-gateway.nousresearch.com", | ||
| "sandboxAuthHeaders": ["Authorization: Key", "x-fal-key", "x-api-key"], | ||
| "upstreamAuthHeader": "Authorization: Key", | ||
| "policyPreset": "nous-image", | ||
| "tools": ["image_generate"] | ||
| }, | ||
| "nous-code": { | ||
| "service": "modal", | ||
| "description": "Nous Portal managed sandboxed code execution gateway", | ||
| "config": { | ||
| "terminal": { | ||
| "backend": "modal", | ||
| "modal_mode": "managed", | ||
| "timeout": 180 | ||
| } | ||
| }, | ||
| "envKey": "MODAL_GATEWAY_URL", | ||
| "envValue": "http://host.openshell.internal:11436/modal", | ||
| "brokerPath": "/modal", | ||
| "upstream": "https://modal-gateway.nousresearch.com", | ||
| "sandboxAuthHeaders": ["Authorization: Bearer", "x-api-key"], | ||
| "upstreamAuthHeader": "Authorization: Bearer", | ||
| "policyPreset": "nous-code", | ||
| "tools": ["terminal"] | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.