Symptom
When a parent agent runs with runtime credentials that differ from the static delegation: config (e.g., the parent was instantiated against OpenAI Codex but delegation.base_url points to a local librarian endpoint), delegate_task hands the child the config default, not the parent's runtime base_url/api_key/provider. The child silently routes to the wrong endpoint.
Reproduction
tests/tools/test_delegate.py::TestDelegateTask::test_child_inherits_runtime_credentials fails on the current main branch:
parent.base_url = "https://chatgpt.com/backend-api/codex"
parent.provider = "openai-codex"
parent.api_mode = "codex_responses"
delegate_task(goal=..., parent_agent=parent)
# expected: child gets parent.base_url
# actual: child gets delegation.base_url ("http://127.0.0.1:8091/v1")
AssertionError: 'http://127.0.0.1:8091/v1' != 'https://chatgpt.com/backend-api/codex'
Likely root cause
tools/delegate_tool.py:1018:
effective_base_url = override_base_url or parent_agent.base_url
effective_api_key = override_api_key or parent_api_key
override_base_url is populated from delegation.base_url in config. When that config key is set, it always wins over the parent's runtime value — there's no way to express "use the configured delegation endpoint only when the parent itself is using the static config."
Suggested approaches
- Invert the precedence: parent runtime > delegation config (closest to test intent).
- Add a "runtime credential override detected" check: if
parent_agent.base_url differs from the system-default config base_url, treat that as an explicit override and inherit it.
- New
delegation.inherit_parent_credentials: bool knob — opt in to runtime inheritance.
Impact
P2 — affects anyone using delegation while their parent agent runs on anything other than the static-config provider. Silent: the child runs to completion against the wrong endpoint, no error.
Environment
- Discovered against current
~/.hermes/hermes-agent checkout, Python 3.11.15
- One of two failures in a 23076-test pytest run
Symptom
When a parent agent runs with runtime credentials that differ from the static
delegation:config (e.g., the parent was instantiated against OpenAI Codex butdelegation.base_urlpoints to a local librarian endpoint),delegate_taskhands the child the config default, not the parent's runtime base_url/api_key/provider. The child silently routes to the wrong endpoint.Reproduction
tests/tools/test_delegate.py::TestDelegateTask::test_child_inherits_runtime_credentialsfails on the current main branch:Likely root cause
tools/delegate_tool.py:1018:override_base_urlis populated fromdelegation.base_urlin config. When that config key is set, it always wins over the parent's runtime value — there's no way to express "use the configured delegation endpoint only when the parent itself is using the static config."Suggested approaches
parent_agent.base_urldiffers from the system-default config base_url, treat that as an explicit override and inherit it.delegation.inherit_parent_credentials: boolknob — opt in to runtime inheritance.Impact
P2 — affects anyone using delegation while their parent agent runs on anything other than the static-config provider. Silent: the child runs to completion against the wrong endpoint, no error.
Environment
~/.hermes/hermes-agentcheckout, Python 3.11.15