hermes - 💡(How to fix) Fix [Bug] delegate_task ignores parent runtime base_url/api_key when delegation.base_url is configured [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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'

Root Cause

Likely root cause

Fix Action

Fixed

Code Example

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'

---

effective_base_url = override_base_url or parent_agent.base_url
effective_api_key = override_api_key or parent_api_key
RAW_BUFFERClick to expand / collapse

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

  1. Invert the precedence: parent runtime > delegation config (closest to test intent).
  2. 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.
  3. 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug] delegate_task ignores parent runtime base_url/api_key when delegation.base_url is configured [1 pull requests]