Skip to content

fix(config): resolve chained _inherit_from so Harbor binds inheriting profiles - #6107

Merged
yaoyu-33 merged 3 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/nooa-sandboxed-harbor-config
Nov 15, 2026
Merged

yaoyu-33 merged 3 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/nooa-sandboxed-harbor-config

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Selecting nooa_agent/nooa_sandboxed for a Harbor taskset failed before model execution, for two reasons:

  1. Chained _inherit_from was never resolved. Harbor adds <taskset>_agent: {_inherit_from: <selected instance>}. When the selected profile itself inherits another instance (agent: {_inherit_from: nooa_agent}), the resolver copied the profile from its frozen pre-resolution snapshot, so the profile's own _inherit_from reached the generated agent unresolved and the base fields (entrypoint, model_server, ...) were lost. The resolver even carried a TODO for this. opencode_sandboxed_agent/opencode_sandboxed_search_agent breaks the same way under Harbor.
  2. NOOA's strict schema rejected Harbor's dataset metadata. Harbor injects datasets into every agent block; NOOAAgentConfig (extra="forbid") now declares it with the existing typed DatasetConfig | BenchmarkDatasetConfig, as BaseRunServerTypeConfig does.

Changes:

  • GlobalConfigDictParser._recursively_swap_keys_helper resolves a copy of each dict source (its swap, copy and _delete_key directives) before merging it, so every link of a chain applies. A cycle raises the new InheritCycleError. A sibling that an earlier move already consumed is skipped instead of being re-added (with the target listed first, the middle link used to reappear as a second instance).
  • nooa_sandboxed.yaml keeps its two-line _inherit_from: nooa_agent form, so it does not copy the base profile's fields.
  • NOOAAgentConfig.datasets, plus a Harbor binding regression for the NOOA profile.

This is a focused smoke-discovered repair; a separate issue is unnecessary.

Validation (Python 3.13.14):

  • tests/unit_tests/config/test_global_config.py: 240 passed, including new chain tests (both entry orders, _delete_key on the middle link, copy of an inheriting source, cycle). All four new tests fail on the previous resolver.
  • tests/unit_tests/config/test_environment_resources_binding.py: 11 passed.
  • benchmarks/terminal_bench_2_1/tests/test_nooa_terminal_bench_2_1.py on Linux with the pinned NOOA packages: 5 passed, 2 failed. The two test_nooa_recipe_prepares_and_routes_canonical_terminal_tasks failures (resources worker default 1 vs None) also fail on unchanged main; worker policy is outside this patch. The Harbor binding test fails on the original resolver and passes with the fix.
  • Differential check: all 967 shipped */*/configs/*.yaml and benchmarks/*/*.yaml configs resolve to identical output with the previous and the new resolver (the same 23 configs error in both), so standalone configs do not change; only chains such as Harbor's generated agent do. opencode_sandboxed_search_agent bound to Harbor now keeps its base fields.
  • A/B on Linux over the 86 test files that load configs through the resolver (benchmarks, agents, servers, tests/unit_tests), with and without this resolver commit: 3118 passed, 15 skipped, 9 failed, 26 errors on both sides, with identical failing test IDs (environmental: an older host git without git init -b, and the two worker-default failures above). The two Harbor files that errored there on git pass on macOS: test_harbor_tasks.py 353 passed, test_harbor_manifest.py 74 passed.
  • responses_api_agents/nooa_agent/tests/test_config.py on Linux with NOOA pinned at 19caab1: 35 passed.
  • pre-commit run on the changed files: passed.
  • Real-model smoke (first revision, which inlined the base profile into nooa_sandboxed.yaml and resolves to the same agent config): Qwen3-VL-8B-Instruct via vLLM, Harbor from feat(terminal_bench_4): run the mini-SWE preset on the Harbor environment server and keep the relay preset as miniswe_legacy_agent #5697 and the provider changes in fix(sandbox): support borrowed Enroot sandboxes and image digests #6105, unchanged TB4 tasks bun-sourcemap-leak and wal-recovery-ordering. Both produced separate verifier results, with 36 successful model-proxy requests and 35 retained tool calls. Both rewards were 0; both native NOOA invocations stopped with LoopDetectedError. Agent/tool and verifier artifacts were inspected, and task rootfs cleanup was empty. Not re-run after the resolver change.

This repairs configuration/startup compatibility; it does not claim benchmark accuracy, completed problem solving, or capture-quality qualification. Model-call capture was not enabled in the smoke. Runtime packaging still requires a Git checkout and the pinned NOOA installation prerequisites.

🤖 Generated with Claude Code

@yaoyu-33 yaoyu-33 added bug Something isn't working area:config Hydra configuration, schemas, composition, and compatibility needs-review PR is ready for code review and waiting on a reviewer labels Nov 13, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

yaoyu-33 and others added 2 commits November 13, 2026 08:47
The resolver copied an inherited source from the frozen pre-resolution
snapshot, so in a chain (target -> profile -> base) the profile's own
_inherit_from reached the target unresolved. Harbor hits this whenever
the selected agent profile inherits another instance: it adds a third
link, `<taskset>_agent: {_inherit_from: <profile>}`. Both
nooa_agent/nooa_sandboxed and opencode_sandboxed_search_agent lost their
base fields this way.

Resolve a copy of each dict source before merging it, report cycles
with InheritCycleError, and skip a sibling an earlier move already
consumed instead of re-adding it. Restore nooa_sandboxed.yaml to its
two-line _inherit_from form, which now binds without copying the base
profile's fields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33 yaoyu-33 changed the title fix(nooa): bind sandboxed profiles to Harbor tasksets fix(config): resolve chained _inherit_from so Harbor binds inheriting profiles Nov 13, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 55e2087

@ffrujeri ffrujeri 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.

LGTM. The new tests cover chains, copies and cycles.

NOTE: The smoke run used the first revision. Can you run one TB4 task on the head commit?

# (target -> source -> base) the source's `_inherit_from` would otherwise reach the target
# unresolved, so resolve a copy of the source first.
if isinstance(swapped_value, DictConfig):
swapped_value = self._resolve_swap_source(

@ffrujeri ffrujeri Nov 14, 2026 •

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.

NOTE: The rename map in _recursively_swap_keys follows one link only. For base -> profile -> target, an environment server that names base does not change to target. What is the plan: a fix here, or a note in troubleshooting/configuration.mdx?

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43665572774

Merged via the queue into NVIDIA-NeMo:main with commit 95d5dd5 Nov 15, 2026
121 of 124 checks passed
@yaoyu-33
yaoyu-33 deleted the codex/nooa-sandboxed-harbor-config branch November 15, 2026 02:18
adil-a added a commit that referenced this pull request Nov 24, 2026
Since #6107, an inherited source is resolved in a detached copy before
it is merged into the target. The swap pass read list elements with
v[i] and removed _delete_key keys with pop(), and both resolve the
value. In the detached copy an interpolation such as `${root_key}`
has no root, so an inline list like `run_args: [--env, A=${agent}]`
in an inherited block failed with "references 'agent', which is not
set after merging". A whole-list reference worked because a scalar
is never resolved there.

Read list elements as nodes and remove keys with del, so the pass
resolves nothing and every interpolation resolves later against the
real root.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Hydra configuration, schemas, composition, and compatibility bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants