Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions adapters/python/hermes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ The descriptor validates the following `harness.settings` fields:
| `terminal_timeout` | positive number | `60` | Limits a Hermes terminal tool operation in seconds; it does not enable a TUI. |
| `interfaces.api`, `interfaces.dashboard`, `interfaces.terminal` | object | None | Serve Hermes's API or shared dashboard/terminal TUI backend, with an exact `port` and optional `enabled`. Dashboard and terminal ports must match when both are enabled; API requires a distinct port; see [Hermes invocation paths](../../../docs/integrations/harness/hermes/hermes.mdx). |
| `startup_timeout_seconds` | number, greater than 0 and at most 75 | `60` | Time from the start of the runtime for every enabled interface to pass its health check. |
| `auxiliary.title_generation.enabled` | boolean | Hermes native default; `false` with Relay | Native automatic session-title generation. An explicit value wins over the Relay default. |
| `auxiliary.background_review.enabled` | boolean | Hermes native default | Native automatic background memory and skill review after turns. Explicit native `/refine` remains available. |
| `tools.tool_search.enabled` | `auto`, `on`, `off`, or boolean | Hermes native default | Native tool search; `true` and `false` are aliases for `on` and `off`. `off` presents the selected tool schemas directly. |

For example:

Expand All @@ -147,6 +150,12 @@ harness = HarnessConfig(
)
```

### Native Harness Controls

The `auxiliary` and `tools` settings use Hermes's native `config.yaml` structure. The adapter writes only the fields you set, before any SDK agent or native interface starts, so all four execution paths read them. Omitting a field keeps the current behavior. For title generation, an explicit value always wins; when it is omitted, a Relay-enabled runtime keeps writing `false` and other runtimes keep Hermes's default. `harness.settings.tools` is Hermes's native tools section and is separate from NeMo Fabric's normalized top-level `tools.enabled` and `tools.blocked`.

These controls reduce automatic background model calls. They do not stop context compaction calls and do not correlate concurrent sessions; refer to the [Hermes guide](../../../docs/integrations/harness/hermes/hermes.mdx#native-harness-controls).

## Configuration Mapping and Ownership

Managed native processes use the adapter's launcher to apply explicit instructions and behavioral settings before constructing agents. Explicit enabled tools, including an empty list, override native selection; a nonempty blocked list overrides native exclusions. Unspecified tool policies can differ between SDK and native paths.
Expand Down
59 changes: 59 additions & 0 deletions adapters/python/hermes/hermes.fabric-adapter.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,65 @@
},
"additionalProperties": false,
"description": "Embedded SDK execution, enabled by default. Runtime management remains available when disabled."
},
"auxiliary": {
"type": "object",
"properties": {
"title_generation": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether Hermes generates session titles automatically. When omitted, Relay-enabled runtimes disable it and other runtimes keep Hermes's default."
}
},
"additionalProperties": false,
"description": "Hermes's native auxiliary.title_generation section."
},
"background_review": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether Hermes starts automatic background memory and skill reviews after turns. Explicit native /refine remains available. When omitted, Hermes's default applies."
}
},
"additionalProperties": false,
"description": "Hermes's native auxiliary.background_review section."
}
},
"additionalProperties": false,
"description": "Native Hermes auxiliary-task controls written to config.yaml for every execution path. Only authored fields are written."
},
"tools": {
"type": "object",
"properties": {
"tool_search": {
"type": "object",
"properties": {
"enabled": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": [
"auto",
"on",
"off"
]
}
],
"description": "Hermes tool search: auto, on, or off; true and false are native aliases for on and off. off presents the selected tool schemas directly. When omitted, Hermes's default applies."
}
},
"additionalProperties": false,
"description": "Hermes's native tools.tool_search section."
}
},
"additionalProperties": false,
"description": "Native Hermes tools section written to config.yaml. Distinct from NeMo Fabric's normalized top-level tools.enabled and tools.blocked. Only authored fields are written."
}
},
"required": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,6 @@ def _invoke_hermes_turn(
conversation_history=conversation_history,
task_id=task_id,
sync_honcho=False,
dont_review=True,
)
result = agent.run_conversation(
user_message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,25 @@ def _interface_model(model_config: AgentModelConfig) -> dict[str, Any]:
)


def _native_auxiliary(
settings: dict[str, Any], *, relay_enabled: bool
) -> dict[str, Any]:
"""Return the authored auxiliary-task switches for native config.yaml.

An explicit title-generation value wins. When it is omitted, Relay-enabled
runtimes keep title generation off because Hermes makes an extra model call
for titles, which skews Relay telemetry.
"""
authored = settings.get("auxiliary", {})
auxiliary: dict[str, Any] = {}
for task in ("title_generation", "background_review"):
if "enabled" in authored.get(task, {}):
auxiliary[task] = {"enabled": authored[task]["enabled"]}
if relay_enabled and "title_generation" not in auxiliary:
auxiliary["title_generation"] = {"enabled": False}
return auxiliary


def build_hermes_config(
agent_config: AgentConfig,
*,
Expand Down Expand Up @@ -168,9 +187,13 @@ def build_hermes_config(
config["agent"]["cron_drain_timeout"] = GATEWAY_DRAIN_TIMEOUT_SECONDS
config["agent"]["restart_drain_timeout"] = 0

if relay_enabled:
# Hermes makes an extra model call for titles, which skews Relay telemetry.
config["auxiliary"] = {"title_generation": {"enabled": False}}
auxiliary = _native_auxiliary(settings, relay_enabled=relay_enabled)
if auxiliary:
config["auxiliary"] = auxiliary
tool_search = settings.get("tools", {}).get("tool_search", {})
if "enabled" in tool_search:
# Hermes reads booleans as aliases for on/off, so pass values through.
config["tools"] = {"tool_search": {"enabled": tool_search["enabled"]}}

skill_dirs = (
[str(path) for path in agent_config.skills.paths]
Expand Down
13 changes: 11 additions & 2 deletions adapters/python/openclaw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ The following settings are specific to the OpenClaw adapter:
| `shutdown_timeout_seconds` | `5` | Graceful shutdown timeout. |
| `connect_timeout_seconds` | `10` | Local HTTP connection timeout. |
| `read_timeout_seconds` | None | Local HTTP response timeout. When unset, the invocation timeout bounds the response. |
| `agents.defaults.heartbeat.every` | OpenClaw native default | Recurring heartbeat interval with units, such as `30m`; `0m` disables the recurring cadence but not event-driven turns. |
| `agents.defaults.compaction.memoryFlush.enabled` | OpenClaw native default | Pre-compaction memory flush turn. Compaction itself still runs. |
| `tools.exec.notifyOnExit` | OpenClaw native default | System event and heartbeat when a backgrounded `exec` process exits. |
| `tools.toolSearch` | OpenClaw native default | Tool search for large tool catalogs. |
| `tools.codeMode` | OpenClaw native default | Code Mode, which can take precedence over tool search and exposes only `exec` and `wait`; do not combine it with blocking `exec`. |
| `plugins.entries.memory-core.config.dreaming.enabled` | OpenClaw native default | Scheduled dreaming in the `memory-core` plugin. |

The `agents`, `tools`, and `plugins` settings use OpenClaw's native structure. The adapter merges only the fields you set into the generated `openclaw.json` for managed runtimes and prepared services, beside the generated `agents.defaults`, `tools.allow`, `tools.deny`, and adapter-owned plugin entries, without replacing generated keys. Omitting a field preserves the current behavior. `harness.settings.tools` is separate from the normalized top-level `tools.enabled` and `tools.blocked` selectors. Attached Gateways reject these settings. These controls do not stop context compaction or correlate concurrent sessions, and they do not add NeMo Relay support; refer to [Native Gateway Controls](../../../docs/integrations/harness/openclaw/openclaw.mdx#native-gateway-controls).

OpenClaw's [derived-port mapping](https://docs.openclaw.ai/gateway/multiple-gateways#port-mapping-derived) uses `base_port + 2` for browser control and allocates browser CDP ports from `base_port + 11` through `base_port + 110`. Set `port_range` when the consumer reserves a port range before configuring NeMo Fabric; the adapter selects a base whose complete derived footprint fits inside that range. The adapter verifies only that `base_port` and `base_port + 2` are available before startup. OpenClaw allocates the CDP ports on demand instead of reserving the complete range, so the adapter cannot guarantee that those ports will still be available when OpenClaw needs them. Keep the configured range reserved for the lifetime of the runtime when using OpenClaw browser features.

Expand Down Expand Up @@ -294,8 +302,9 @@ async with await fabric.attach_service(config, reference) as service:
The attached configuration can contain request-level model sampling and a
system instruction. Remove deployment-owned model endpoints, API-key
references, tools, MCP servers, skills, the OpenClaw command, channel
configuration, port range, and startup or shutdown timeouts because NeMo Fabric
cannot verify or apply those fields to an existing Gateway. Connection and read
configuration, port range, startup or shutdown timeouts, and the native
`agents`, `tools`, and `plugins` harness settings because NeMo Fabric cannot
verify or apply those fields to an existing Gateway. Connection and read
timeouts and `agent_id` remain valid client-side settings. Releasing an
attachment closes only NeMo Fabric-owned clients and private connection material; it
does not stop the Gateway.
Expand Down
100 changes: 100 additions & 0 deletions adapters/python/openclaw/openclaw.fabric-adapter.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,106 @@
"type": "number",
"exclusiveMinimum": 0,
"description": "Timeout between response bytes from the local OpenClaw Gateway. When unset, the invocation timeout bounds the response."
},
"agents": {
"type": "object",
"properties": {
"defaults": {
"type": "object",
"properties": {
"heartbeat": {
"type": "object",
"properties": {
"every": {
"type": "string",
"pattern": "^(?:[0-9]+(?:\\.[0-9]+)?(?:ms|s|m|h|d))+$",
"description": "Native recurring heartbeat interval, such as 30m or 1h30m. Units are required; 0m disables the recurring cadence but not event-driven turns."
}
},
"additionalProperties": false
},
"compaction": {
"type": "object",
"properties": {
"memoryFlush": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether OpenClaw runs its pre-compaction memory flush turn. This does not stop compaction itself."
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"description": "Native OpenClaw agents.defaults controls for NeMo Fabric-owned Gateways. Only authored fields are written; attached Gateways reject them."
},
"tools": {
"type": "object",
"properties": {
"exec": {
"type": "object",
"properties": {
"notifyOnExit": {
"type": "boolean",
"description": "Whether OpenClaw emits a system event and heartbeat when a backgrounded exec process exits."
}
},
"additionalProperties": false
},
"toolSearch": {
"type": "boolean",
"description": "Whether OpenClaw compacts large tool catalogs behind search tools."
},
"codeMode": {
"type": "boolean",
"description": "Whether OpenClaw Code Mode is enabled. Code Mode can take precedence over tool search."
}
},
"additionalProperties": false,
"description": "Native OpenClaw tools controls for NeMo Fabric-owned Gateways, merged with the allow and deny lists generated from NeMo Fabric's normalized top-level tools. Only authored fields are written; attached Gateways reject them."
},
"plugins": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"properties": {
"memory-core": {
"type": "object",
"properties": {
"config": {
"type": "object",
"properties": {
"dreaming": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether the memory-core plugin runs scheduled dreaming."
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"description": "Native OpenClaw plugin controls for NeMo Fabric-owned Gateways. Only authored fields are written; attached Gateways reject them."
}
},
"dependentSchemas": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
# OpenClaw's tools.effective notice for an MCP server whose last connection or
# tool listing failed in the session.
MCP_SERVER_DIAGNOSTIC_PREFIX = "mcp-server-diagnostic:"
# Harness settings written into the Gateway's native openclaw.json.
NATIVE_SETTING_SECTIONS = ("agents", "tools", "plugins")


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -130,6 +132,7 @@ def _validate_attach_config(config: contract.AgentConfig) -> None:
"port_range",
"startup_timeout_seconds",
"shutdown_timeout_seconds",
*NATIVE_SETTING_SECTIONS,
):
if name in settings:
unsupported.append(f"harness.settings.{name}")
Expand Down Expand Up @@ -532,6 +535,33 @@ def _unavailable_mcp_servers(
return list(entries.values())


def _merge_native_settings(
target: dict[str, Any], key: str, authored: Any, *, field: str
) -> None:
"""Write authored native leaves without replacing generated configuration.

The descriptor's closed schema keeps these sections apart from the keys the
adapter generates; a collision is refused rather than overwritten.
"""
existing = target.get(key)
if not isinstance(authored, dict) or (
existing is not None and not isinstance(existing, dict)
):
if key in target:
raise lifecycle.LifecycleError(
"openclaw_invalid_configuration",
"OpenClaw native setting conflicts with NeMo Fabric-generated configuration",
metadata={"field": field},
)
target[key] = authored
return
section = {} if existing is None else existing
for name, value in authored.items():
_merge_native_settings(section, name, value, field=f"{field}.{name}")
if section:
target[key] = section


def _openclaw_config(
config: contract.AgentConfig,
context: contract.RuntimeContext,
Expand Down Expand Up @@ -647,6 +677,15 @@ def _openclaw_config(
mcp = _mcp_config(config)
if mcp:
result["mcp"] = {"servers": mcp}
settings = config.harness.settings if config.harness else {}
for section in NATIVE_SETTING_SECTIONS:
if section in settings:
_merge_native_settings(
result,
section,
settings[section],
field=f"harness.settings.{section}",
)
provider: dict[str, Any] = {}
if model.base_url is not None:
provider.update(
Expand Down
Loading
Loading