Skip to content
Closed
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
4 changes: 2 additions & 2 deletions adapters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ build, and packaging conventions.
| [Pi](typescript/pi/README.md) | `nvidia.fabric.pi` | `nemo-fabric-adapters-pi` | Node.js 22.19+ |
| [Qwen Code](typescript/qwen/README.md) | `nvidia.fabric.qwen` | `nemo-fabric-adapters-qwen` | Node.js 22.19+ |

OpenCode, Qwen Code, and Kilo Code require HTTPS for remote model endpoints by default. To use a trusted Docker or Kubernetes HTTP gateway, configure `harness.settings.insecure_http_model_hosts` as described in their adapter READMEs. Kilo Code also supports its existing private IPv4 opt-in.
OpenCode, Qwen Code, and Kilo Code require HTTPS for remote model endpoints by default. To use a trusted Docker or Kubernetes HTTP gateway, configure `harness.settings.insecure_http_model_hosts` as described in their adapter READMEs. Kilo Code also supports its existing private IPv4 opt-in. Relay-enabled Codex, Claude, and Pi also support this setting with NeMo Relay CLI 0.11.x. Their remote HTTP path is credential-free: Relay strips credential headers before forwarding. HTTPS remains the default, and model content is unencrypted when HTTP is explicitly enabled.

Shared TypeScript lifecycle utilities live under
[`typescript/common`](typescript/common/README.md).
Expand Down Expand Up @@ -209,7 +209,7 @@ Agent Trajectory Interchange Format (ATIF).
| [Cline](typescript/cline/README.md) | Local `ClineCore` and interactive Cline session | Not supported | Starts on the first prompt, then calls `send()` with the retained session ID | Stops the session, disposes the core, and removes runtime-scoped plugin and data directories | Not implemented |
| [Factory Droid](typescript/droid/README.md) | TypeScript SDK `DroidSession` | Not supported | Calls `stream()` for each ordered prompt on the retained session | Closes the session and its caller-installed CLI subprocess | Not implemented |
| [OpenCode](typescript/opencode/README.md) | Embedded OpenCode host and session | Not supported | Reuses the session and calls `prompt()`, `wait()`, and `context()` for ordered text input | Removes the session and closes the host | Not implemented |
| [Pi](typescript/pi/README.md) | In-memory Pi `AgentSession` | Runtime-owned Relay 0.9 or 0.10 CLI gateway and explicit Pi extension | Reuses the session and calls `prompt()` for ordered text input; with `streaming=True`, routes per-invocation model-turn ATOF for successful redirects through the embedded collector; startup `model_redirect` marks remain in configured Relay ATOF artifacts and are not included in `invoke_stream()`; `relay_artifacts` does not include local ATIF | Aborts work, emits extension shutdown so local ATIF finalizes on disk, disposes the session, and then stops the gateway | Not implemented |
| [Pi](typescript/pi/README.md) | In-memory Pi `AgentSession` | Runtime-owned Relay 0.9, 0.10, or 0.11 CLI gateway and explicit Pi extension | Reuses the session and calls `prompt()` for ordered text input; with `streaming=True`, routes per-invocation model-turn ATOF for successful redirects through the embedded collector; startup `model_redirect` marks remain in configured Relay ATOF artifacts and are not included in `invoke_stream()`; `relay_artifacts` does not include local ATIF | Aborts work, emits extension shutdown so local ATIF finalizes on disk, disposes the session, and then stops the gateway | Not implemented |
| [Qwen Code](typescript/qwen/README.md) | SDK query and bundled Qwen CLI child process | Not supported | Reuses one live SDK query across ordered text turns | Closes the query and removes isolated temporary settings | Not implemented |
| [Remote Agent](python/remote-agent/README.md) | `httpx.AsyncClient` and user/assistant transcript | Remote Relay publishes to a shared ATOF collector | Registers the request ID, maps it into body metadata, sends one HTTP request, and retains the completed transcript | Closes the HTTP client | Implemented over HTTP(S) |

Expand Down
27 changes: 26 additions & 1 deletion adapters/python/claude/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Harbor; a Relay trajectory's totals are recorded separately and never fill them.

## Relay Observability

Relay requires a NeMo Relay CLI in the `>=0.9,<0.11` range on `PATH`. The
Relay requires a NeMo Relay CLI in the `>=0.9,<0.12` range on `PATH`. The
Claude adapter does not provide a separate `relay` extra; its `harness` and
`full` extras install the compatible CLI through `nemo-relay-cli-bin`. The root
`nemo-fabric[relay]` extra installs only the Relay Python package.
Expand Down Expand Up @@ -182,6 +182,31 @@ The NeMo Fabric result includes `relay_runtime.gateway_config_path`,
startup failures return a stable adapter error and retain the gateway log for
diagnosis.

### Credential-free HTTP model gateways

For Relay-enabled runs, NeMo Relay CLI 0.11.x supports explicit trust for
HTTP model hosts. Set `harness.settings.insecure_http_model_hosts` to the exact
hostnames or IP addresses of your private inference gateways:

```python
config.harness.settings["insecure_http_model_hosts"] = ["inference.internal", "10.0.0.10"]
```

Entries contain no scheme, port, path, or wildcard. Matching ignores DNS case
and a trailing dot, permits any port or path on that host, and does not infer
trust from DNS resolution. The adapter passes this list to Relay's runtime
`[upstream]` configuration. An explicit empty list clears inherited HTTP trust;
omitting the setting preserves Relay's existing configuration behavior. System
Relay configuration takes precedence and can enforce an empty list.

This path is for unauthenticated model endpoints: Relay strips authorization,
API-key, cookie, and other credential headers before remote HTTP forwarding,
including model credentials supplied to the harness. Relay rejects conflicting
upstream authorization configuration. Prompts and responses still travel over
plaintext HTTP. HTTPS remains the default. This setting affects Relay-enabled
Codex, Claude, and Pi model forwarding; MCP policy is unchanged. Older Relay CLIs
reject the setting with an upgrade message.

## Typed Configuration

Build the agent configuration with the typed SDK models before invoking
Expand Down
19 changes: 19 additions & 0 deletions adapters/python/claude/claude.fabric-adapter.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"insecure_http_model_hosts": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 253,
"anyOf": [
{
"pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*\\.?$"
},
{
"pattern": "^[0-9A-Fa-f:.]*:[0-9A-Fa-f:.]*$",
"format": "ipv6"
}
]
},
"uniqueItems": true,
"description": "Hosts trusted for credential-free HTTP model forwarding through NeMo Relay >=0.11.0; no schemes, ports, paths, wildcards, brackets, or zone identifiers."
},
"setting_sources": {
"type": "array",
"items": {
Expand Down
4 changes: 2 additions & 2 deletions adapters/python/claude/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ dependencies = [
[project.optional-dependencies]
harness = [
"claude-agent-sdk==0.2.165",
"nemo-relay-cli-bin>=0.9,<0.11",
"nemo-relay-cli-bin>=0.9,<0.12",
]
full = [
"claude-agent-sdk==0.2.165",
"nemo-relay-cli-bin>=0.9,<0.11",
"nemo-relay-cli-bin>=0.9,<0.12",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
from nemo_fabric_adapters.common import lifecycle
from nemo_fabric_adapters.common import relay_artifacts
from nemo_fabric_adapters.common import relay_gateway
from nemo_fabric_adapters.common.relay_http import (
RelayHttpModelError,
relay_http_model_config,
)
from nemo_fabric_adapters.common import relay_hooks
from nemo_fabric_adapters.common import utils as common_utils

Expand Down Expand Up @@ -515,6 +519,8 @@ def prepare_claude_relay(
model: AgentModelConfig,
runtime_context: RuntimeContext,
base_dir: str,
*,
settings: dict[str, Any] | None = None,
) -> ClaudeRelaySettings | None:
"""Generate Relay gateway and Claude hook configuration."""

Expand All @@ -533,7 +539,8 @@ def prepare_claude_relay(
) from error

try:
relay_gateway.relay_cli_contract(executable)
contract = relay_gateway.relay_cli_contract(executable)
http_config = relay_http_model_config(settings or {}, contract)
plugin_config = common_utils.load_relay_plugin_config(
{
"agent_name": agent_name,
Expand All @@ -543,9 +550,13 @@ def prepare_claude_relay(
}
)
config_path, plugin_config_path = common_utils.write_relay_configs(
relay_config={"agents": {"claude": {"command": "claude"}}},
relay_config={"agents": {"claude": {"command": "claude"}}, **http_config},
plugin_config=plugin_config,
)
except RelayHttpModelError as error:
raise AdapterRelayError(
"claude_relay_invalid_http_model_hosts", str(error)
) from error
except (
OSError,
RuntimeError,
Expand Down Expand Up @@ -1082,7 +1093,11 @@ async def start(self, payload: dict[str, Any]) -> None:
model = _selected_model_config(agent_config)
fabric_runtime_id = runtime_context.runtime_id
relay = prepare_claude_relay(
common_utils.agent_name(payload), model, runtime_context, base_dir
common_utils.agent_name(payload),
model,
runtime_context,
base_dir,
settings=_settings(agent_config),
)
self._relay = relay
self._gateway_process = _start_relay_gateway(
Expand Down Expand Up @@ -1282,7 +1297,9 @@ def _invocation_cost(
):
total = None
self._cost_total = total
reset = any(isinstance(message, ConversationResetMessage) for message in messages)
reset = any(
isinstance(message, ConversationResetMessage) for message in messages
)
if total is None or previous is None or reset or total < previous:
return None
# Drop float subtraction noise such as 0.19999999999999998. A tenth of a
Expand Down
4 changes: 2 additions & 2 deletions adapters/python/claude/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion adapters/python/codex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ while clearing unrelated parent-process secrets.

## Relay Integration

Relay requires a NeMo Relay CLI in the `>=0.9,<0.11` range on `PATH`. The
Relay requires a NeMo Relay CLI in the `>=0.9,<0.12` range on `PATH`. The
Codex adapter does not provide a separate `relay` extra; its `harness` and
`full` extras install the compatible CLI through `nemo-relay-cli-bin`. The root
`nemo-fabric[relay]` extra installs only the Relay Python package.
Expand All @@ -159,6 +159,31 @@ NeMo Fabric routes the selected Responses-compatible provider through the
gateway and passes its explicit `base_url` to Relay as the upstream endpoint.


### Credential-free HTTP model gateways

For Relay-enabled runs, NeMo Relay CLI 0.11.x supports explicit trust for
HTTP model hosts. Set `harness.settings.insecure_http_model_hosts` to the exact
hostnames or IP addresses of your private inference gateways:

```python
config.harness.settings["insecure_http_model_hosts"] = ["inference.internal", "10.0.0.10"]
```

Entries contain no scheme, port, path, or wildcard. Matching ignores DNS case
and a trailing dot, permits any port or path on that host, and does not infer
trust from DNS resolution. The adapter passes this list to Relay's runtime
`[upstream]` configuration. An explicit empty list clears inherited HTTP trust;
omitting the setting preserves Relay's existing configuration behavior. System
Relay configuration takes precedence and can enforce an empty list.

This path is for unauthenticated model endpoints: Relay strips authorization,
API-key, cookie, and other credential headers before remote HTTP forwarding,
including model credentials supplied to the harness. Relay rejects conflicting
upstream authorization configuration. Prompts and responses still travel over
plaintext HTTP. HTTPS remains the default. This setting affects Relay-enabled
Codex, Claude, and Pi model forwarding; MCP policy is unchanged. Older Relay CLIs
reject the setting with an upgrade message.

## Testing

Run the unit and opt-in real SDK tests separately:
Expand Down
19 changes: 19 additions & 0 deletions adapters/python/codex/codex.fabric-adapter.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"insecure_http_model_hosts": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 253,
"anyOf": [
{
"pattern": "^[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*\\.?$"
},
{
"pattern": "^[0-9A-Fa-f:.]*:[0-9A-Fa-f:.]*$",
"format": "ipv6"
}
]
},
"uniqueItems": true,
"description": "Hosts trusted for credential-free HTTP model forwarding through NeMo Relay >=0.11.0; no schemes, ports, paths, wildcards, brackets, or zone identifiers."
},
"sandbox": {
"type": "string",
"enum": ["read-only", "workspace-write", "danger-full-access"],
Expand Down
4 changes: 2 additions & 2 deletions adapters/python/codex/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ dependencies = [
[project.optional-dependencies]
harness = [
"openai-codex==0.154.0",
"nemo-relay-cli-bin>=0.9,<0.11",
"nemo-relay-cli-bin>=0.9,<0.12",
]
full = [
"openai-codex==0.154.0",
"nemo-relay-cli-bin>=0.9,<0.11",
"nemo-relay-cli-bin>=0.9,<0.12",
]

[project.urls]
Expand Down
13 changes: 11 additions & 2 deletions adapters/python/codex/src/nemo_fabric_adapters/codex/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
from nemo_fabric_adapter_contract.models import RuntimeContext
from nemo_fabric_adapters.common import instructions as common_instructions
import nemo_fabric_adapters.common.relay_gateway as relay_gateway
from nemo_fabric_adapters.common.relay_http import (
RelayHttpModelError,
relay_http_model_config,
)
import nemo_fabric_adapters.common.relay_hooks as relay_hooks
import nemo_fabric_adapters.common.relay_artifacts as relay_artifacts
import nemo_fabric_adapters.common.utils as common_utils
Expand Down Expand Up @@ -790,7 +794,8 @@ def prepare_codex_relay(
) from error

try:
relay_gateway.relay_cli_contract(executable)
contract = relay_gateway.relay_cli_contract(executable)
http_config = relay_http_model_config(_settings(config), contract)
plugin_config = common_utils.load_relay_plugin_config(
{
"agent_name": agent_name,
Expand All @@ -801,9 +806,13 @@ def prepare_codex_relay(
)
config_path, plugin_config_path = common_utils.write_relay_configs(
# Codex execution remains SDK-owned; Relay runs only as a gateway.
relay_config={},
relay_config=http_config,
plugin_config=plugin_config,
)
except RelayHttpModelError as error:
raise AdapterRelayError(
"codex_relay_invalid_http_model_hosts", str(error)
) from error
except (OSError, RuntimeError, ValueError, json.JSONDecodeError) as error:
raise AdapterRelayError(
"codex_relay_configuration_failed",
Expand Down
4 changes: 2 additions & 2 deletions adapters/python/codex/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pathlib import Path
from typing import Any

from nemo_fabric_adapters.common.relay_version import is_supported_relay_version
from nemo_fabric_adapters.common.relay_version import RELAY_MINIMUM_VERSION


RELAY_HEALTH_TIMEOUT_SECONDS = 10.0
Expand Down Expand Up @@ -97,11 +97,11 @@ def relay_cli_contract(executable: Path) -> RelayCliContract:
raise RelayGatewayError("NeMo Relay CLI version could not be determined")
major, minor, patch = (int(value) for value in match.groups()[:3])
version = (major, minor, patch)
if match.group(4) is not None or not is_supported_relay_version(version):
if match.group(4) is not None or not RELAY_MINIMUM_VERSION <= version < (0, 12, 0):
raise RelayGatewayError(
"unsupported NeMo Relay CLI version "
f"{'.'.join(str(value) for value in version)}; "
"NeMo Fabric requires >=0.9.0,<0.11.0"
"NeMo Fabric requires >=0.9.0,<0.12.0"
)
return RelayCliContract(version=version)

Expand Down
Loading
Loading