Repository navigation
feat: add mini-SWE-agent adapter #219
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
rapids-bot
merged 17 commits into
NVIDIA:main
from
zhongxuanwang-nv:feat/mini-swe-agent-adapter
Aug 14, 2026
Merged
Changes from 5 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d1e0272
feat: add mini-SWE-agent adapter
zhongxuanwang-nv 3d46c5c
refactor: strengthen mini-SWE-agent model typing
zhongxuanwang-nv 6444f33
refactor: keep mini-SWE-agent adapter compact
zhongxuanwang-nv df493f7
fix: keep mini-SWE-agent adapter minimal
zhongxuanwang-nv 6f56373
test: cover mini-SWE-agent lifecycle failures
zhongxuanwang-nv 5696ba5
refactor: remove mini-SWE-agent adapter duplication
zhongxuanwang-nv 645d42f
refactor: return normalized mini-SWE-agent results
zhongxuanwang-nv e1b7b80
test: use native mini-SWE-agent timeout setting
zhongxuanwang-nv b73d9fd
refactor: place mini-SWE-agent entrypoint last
zhongxuanwang-nv 57ae7cc
docs: simplify mini-SWE-agent guidance
zhongxuanwang-nv d2c9fef
fix: retain mini-SWE-agent runtime history
zhongxuanwang-nv 174d924
merge: sync mini-SWE-agent adapter with main
zhongxuanwang-nv 9d03780
refactor: delegate mini-SWE-agent continuation to native run
zhongxuanwang-nv 85ea483
refactor: localize mini-SWE-agent history bridge
zhongxuanwang-nv cdc5610
fix: retain complete mini-SWE-agent tool history
zhongxuanwang-nv 3924e7b
docs: refine mini-SWE-agent adapter guidance
zhongxuanwang-nv 99092ba
docs: correct mini-SWE-agent runtime state
zhongxuanwang-nv 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
| ../../LICENSE |
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,76 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| # NVIDIA NeMo Fabric mini-SWE-agent Adapter | ||
|
|
||
| The `nvidia.fabric.mini-swe-agent` adapter runs mini-SWE-agent's native | ||
| shell-only loop through NVIDIA NeMo Fabric. Select the harness by adapter ID; | ||
| the mini-SWE-agent Python package is an implementation detail. | ||
|
|
||
| ## Install | ||
|
|
||
| | Installation | Runtime | Adapter | Harness | | ||
| | --- | --- | --- | --- | | ||
| | `pip install "nemo-fabric[mini-swe-agent]"` | Yes | Yes | Yes | | ||
| | `pip install "nemo-fabric-adapters-mini-swe-agent[harness]"` | No | Yes | Yes | | ||
| | `pip install nemo-fabric-adapters-mini-swe-agent` | No | Yes | No | | ||
|
|
||
| The `harness` and `full` extras pin `mini-swe-agent==2.4.6`. | ||
|
|
||
| ## Configuration | ||
|
|
||
| The adapter maps `models`, `models.base_url`, `models.temperature`, | ||
| `instructions.system`, `runtime.max_turns`, and `environment.workspace` to | ||
| mini-SWE-agent. `runtime.timeout_seconds` remains the NVIDIA NeMo Fabric | ||
| invocation deadline. Use the adapter-specific `harness.settings.timeout_seconds` | ||
| to set the maximum duration of one shell command; it defaults to `180`. | ||
|
|
||
| mini-SWE-agent uses LiteLLM. The adapter sends the configured model credential | ||
| directly to LiteLLM from `models.<role>.api_key_env` or the conventional | ||
| credential variable for OpenAI, Anthropic, NVIDIA, or OpenRouter. It does not | ||
| persist the credential. The adapter does not expose MCP, skills, tool policy, | ||
| native streaming, or native telemetry. | ||
|
|
||
| ```python | ||
| import asyncio | ||
|
|
||
| from nemo_fabric import EnvironmentConfig, Fabric, FabricConfig, HarnessConfig | ||
| from nemo_fabric import InstructionConfig, InstructionsConfig, MetadataConfig | ||
| from nemo_fabric import ModelConfig, RuntimeConfig | ||
|
|
||
| config = FabricConfig( | ||
| metadata=MetadataConfig(name="mini-swe-agent"), | ||
| harness=HarnessConfig( | ||
| adapter_id="nvidia.fabric.mini-swe-agent", | ||
| resolution="preinstalled", | ||
| settings={"timeout_seconds": 180}, | ||
| ), | ||
| models={ | ||
| "default": ModelConfig( | ||
| provider="openai", | ||
| model="gpt-5-mini", | ||
| api_key_env="OPENAI_API_KEY", | ||
|
zhongxuanwang-nv marked this conversation as resolved.
Resolved
|
||
| ) | ||
| }, | ||
| instructions=InstructionsConfig( | ||
| system=InstructionConfig(content="Work carefully and verify the change.") | ||
| ), | ||
| runtime=RuntimeConfig(max_turns=50, timeout_seconds=1800), | ||
| environment=EnvironmentConfig(provider="local", workspace="/workspace"), | ||
| ) | ||
|
|
||
| async def main(): | ||
| return await Fabric().run( | ||
| config, base_dir="/workspace", input="Fix the failing test." | ||
| ) | ||
|
|
||
|
|
||
| result = asyncio.run(main()) | ||
| ``` | ||
|
|
||
| Each invocation runs a fresh mini-SWE-agent loop in the runtime's workspace. | ||
| The output includes the submitted final text, `exit_status`, and API-call | ||
| usage. A loop that ends without submitting a final output produces a failed | ||
| NVIDIA NeMo Fabric result. | ||
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,57 @@ | ||
| { | ||
| "contract_version": "fabric.adapter/v1alpha2", | ||
| "adapter_id": "nvidia.fabric.mini-swe-agent", | ||
| "harness": "mini-swe-agent", | ||
| "adapter_kind": "python", | ||
| "runner": { | ||
| "module": "nemo_fabric_adapters.mini_swe_agent.adapter" | ||
| }, | ||
| "model_schema": { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "object", | ||
| "properties": { | ||
| "provider": {"type": "string", "minLength": 1}, | ||
| "model": {"type": "string", "minLength": 1}, | ||
| "temperature": {"type": "number"}, | ||
| "api_key_env": {"type": "string", "minLength": 1}, | ||
| "base_url": {"type": "string", "minLength": 1}, | ||
| "settings": { | ||
| "type": "object", | ||
| "properties": {}, | ||
| "additionalProperties": false | ||
| } | ||
| }, | ||
| "required": ["provider", "model"], | ||
| "additionalProperties": false | ||
| }, | ||
| "settings_schema": { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "object", | ||
| "properties": { | ||
| "timeout_seconds": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "default": 180, | ||
| "description": "Maximum duration of one shell command." | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| }, | ||
| "requirements": {}, | ||
| "config": { | ||
| "input": "agent_config", | ||
| "accepts": [ | ||
| "models", | ||
| "models.base_url", | ||
| "models.temperature", | ||
| "instructions.system", | ||
| "runtime.max_turns" | ||
| ] | ||
| }, | ||
| "capabilities": { | ||
| "service": false, | ||
| "streaming": false, | ||
| "updates": false, | ||
| "cancellation": false | ||
| } | ||
| } |
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,18 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| # NVIDIA NeMo Fabric mini-SWE-agent Adapter | ||
|
zhongxuanwang-nv marked this conversation as resolved.
Resolved
|
||
|
|
||
| `nemo-fabric-adapters-mini-swe-agent` translates the NVIDIA NeMo Fabric | ||
| adapter contract into mini-SWE-agent's native shell-only execution loop. | ||
|
|
||
| Install the harness with: | ||
|
|
||
| ```bash | ||
| pip install "nemo-fabric-adapters-mini-swe-agent[harness]" | ||
| ``` | ||
|
|
||
| For configuration and behavior, see the | ||
| [mini-SWE-agent adapter README](https://github.com/NVIDIA/NeMo-Fabric/tree/main/adapters/mini-swe-agent/README.md). | ||
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,55 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| [build-system] | ||
| requires = [ | ||
| "setuptools>=77", | ||
| ] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "nemo-fabric-adapters-mini-swe-agent" | ||
| version = "0.2.0" | ||
| description = "mini-SWE-agent adapter for NeMo Fabric" | ||
| authors = [ | ||
| { name = "NVIDIA Corporation" }, | ||
| ] | ||
| keywords = ["agents", "ai", "nemo-fabric", "runtime", "tools"] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Developers", | ||
| "Programming Language :: Python :: 3", | ||
| ] | ||
| license = "Apache-2.0" | ||
| license-files = ["LICENSE"] | ||
| readme = "pypi.md" | ||
| requires-python = ">=3.11" | ||
| dependencies = [ | ||
| "nemo-fabric-adapter-contract == 0.2.0", | ||
| "nemo-fabric-adapters-common == 0.2.0", | ||
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| harness = [ | ||
| "mini-swe-agent==2.4.6", | ||
| ] | ||
| full = [ | ||
| "mini-swe-agent==2.4.6", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Repository = "https://github.com/NVIDIA/NeMo-Fabric" | ||
| Homepage = "https://github.com/NVIDIA/NeMo-Fabric" | ||
| Issues = "https://github.com/NVIDIA/NeMo-Fabric/issues" | ||
| Documentation = "https://docs.nvidia.com/nemo/fabric" | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] | ||
| include = ["nemo_fabric_adapters.mini_swe_agent*"] | ||
|
|
||
| [tool.setuptools.data-files] | ||
| "share/nemo-fabric/adapters/mini-swe-agent" = ["fabric-adapter.json"] | ||
|
|
||
| [tool.uv.sources] | ||
| nemo-fabric-adapter-contract = { path = "../../adapter-contract", editable = true } | ||
| nemo-fabric-adapters-common = { path = "../common", editable = true } |
4 changes: 4 additions & 0 deletions
4
adapters/mini-swe-agent/src/nemo_fabric_adapters/mini_swe_agent/__init__.py
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,4 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """mini-SWE-agent adapter package for NeMo Fabric.""" |
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.