You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hermes already has a strong subagent abstraction through delegate_task, but today subagents are tied to Hermes' own provider/client loop or ACP-style child processes. That misses a useful option for OpenAI Codex users: running delegated workers inside the native Codex app-server harness.
The Codex harness is valuable because it is not just another HTTP model provider. It owns Codex session state, tool/runtime semantics, approval/sandbox behavior, streaming item events, and ChatGPT/Codex auth. Some users, myself included, prefer leaf subagents that are consistent in that harness, often with very low or no explicit reasoning effort, while the parent Hermes agent keeps orchestration and product-level workflow control.
The blocker is that Codex does not currently ship an official ACP server in the shape Hermes expects for subagents. Codex does expose codex app-server, so Hermes can support this use case by speaking that app-server protocol directly for delegated leaf workers.
This is related to, but intentionally narrower than, the draft full-runtime work in #24182. That PR explores routing entire Hermes OpenAI turns through Codex app-server. This request is specifically for delegation backend support:
Keep Hermes as the top-level agent and orchestration/control plane.
Add a codex-app-server delegation provider for subagents.
Let leaf workers run inside Codex's native harness.
Keep nested/orchestrator delegation safe and predictable by default.
delegation.provider: codex-app-server is treated as a special delegation backend, not a normal runtime provider.
Leaf subagents are constructed as Codex app-server children and launched through:
codex app-server --listen stdio://
The child client speaks Codex app-server JSON-RPC over stdio and maps app-server lifecycle/events into the delegate_task result shape.
delegation.reasoning_effort maps into Codex turn effort, including none for users who want fast/consistent harness workers without extra reasoning.
codex as a bare command is normalized to codex app-server --listen stdio://, because that is the actual protocol server Hermes needs.
Hermes doctor / install checks surface whether the Codex CLI is present and usable for this backend.
Nested/orchestrator behavior is backend-aware:
Codex app-server leaf workers use the native Codex harness.
Codex app-server orchestrator workers default back to Hermes-native AIAgent control plane, so recursive work uses real Hermes delegate_task aggregation.
Codex-native nested spawning remains experimental behind an explicit flag:
delegation:
codex_native_orchestrators: true
The last point matters because during dogfooding we hit the exact mismatch: a Codex app-server child exposed Codex-native collaboration tools such as spawn_agent, but not Hermes delegate_task. That made nested/orchestrator tests return only one child marker instead of aggregating all workers. Fresh-process tests passed once orchestrators defaulted back to Hermes as the reliable control plane while Codex remained the leaf backend.
Alternatives Considered
Use ACP/Copilot ACP only. This does not cover Codex's native app-server harness and depends on an ACP interface Codex itself does not officially provide in the required shape.
Treat codex-app-server as a normal runtime provider. That is leaky: it has no HTTP base_url/api_key provider semantics and needs subprocess lifecycle + protocol handling.
Make Codex-native orchestrators the default. Dogfooding showed this is not yet reliable because the child harness exposes Codex-native spawn/wait tools, not Hermes delegate_task. The safer default is Hermes-native orchestrators + Codex-native leaves.
Feature Type
Configuration option / Developer experience / Other: subagent delegation backend for the Codex native harness.
Suggested Labels
type/feature
tool/delegate
comp/agent
provider/openai
innovation
Scope
Large: new client module plus delegation routing, install/doctor wiring, config example updates, and focused tests.
Contribution
I'd like to implement this myself and submit a PR
I already have a working branch and am dogfooding it locally. Targeted tests are green, and a fresh Hermes process passed a nested delegation acceptance smoke test.
Existing long-running sessions can remain stale until the Hermes process reloads changed Python modules, which is expected for this kind of live patch.
Problem or Use Case
Hermes already has a strong subagent abstraction through
delegate_task, but today subagents are tied to Hermes' own provider/client loop or ACP-style child processes. That misses a useful option for OpenAI Codex users: running delegated workers inside the native Codex app-server harness.The Codex harness is valuable because it is not just another HTTP model provider. It owns Codex session state, tool/runtime semantics, approval/sandbox behavior, streaming item events, and ChatGPT/Codex auth. Some users, myself included, prefer leaf subagents that are consistent in that harness, often with very low or no explicit reasoning effort, while the parent Hermes agent keeps orchestration and product-level workflow control.
The blocker is that Codex does not currently ship an official ACP server in the shape Hermes expects for subagents. Codex does expose
codex app-server, so Hermes can support this use case by speaking that app-server protocol directly for delegated leaf workers.This is related to, but intentionally narrower than, the draft full-runtime work in #24182. That PR explores routing entire Hermes OpenAI turns through Codex app-server. This request is specifically for delegation backend support:
codex-app-serverdelegation provider for subagents.Proposed Solution
Add an opt-in delegation backend:
Expected behavior:
delegation.provider: codex-app-serveris treated as a special delegation backend, not a normal runtime provider.Leaf subagents are constructed as Codex app-server children and launched through:
The child client speaks Codex app-server JSON-RPC over stdio and maps app-server lifecycle/events into the
delegate_taskresult shape.delegation.reasoning_effortmaps into Codex turn effort, includingnonefor users who want fast/consistent harness workers without extra reasoning.codexas a bare command is normalized tocodex app-server --listen stdio://, because that is the actual protocol server Hermes needs.Hermes
doctor/ install checks surface whether the Codex CLI is present and usable for this backend.Nested/orchestrator behavior is backend-aware:
Codex app-server leaf workers use the native Codex harness.
Codex app-server orchestrator workers default back to Hermes-native
AIAgentcontrol plane, so recursive work uses real Hermesdelegate_taskaggregation.Codex-native nested spawning remains experimental behind an explicit flag:
The last point matters because during dogfooding we hit the exact mismatch: a Codex app-server child exposed Codex-native collaboration tools such as
spawn_agent, but not Hermesdelegate_task. That made nested/orchestrator tests return only one child marker instead of aggregating all workers. Fresh-process tests passed once orchestrators defaulted back to Hermes as the reliable control plane while Codex remained the leaf backend.Alternatives Considered
codex-app-serveras a normal runtime provider. That is leaky: it has no HTTPbase_url/api_keyprovider semantics and needs subprocess lifecycle + protocol handling.delegate_task. The safer default is Hermes-native orchestrators + Codex-native leaves.Feature Type
Configuration option / Developer experience / Other: subagent delegation backend for the Codex native harness.
Suggested Labels
type/featuretool/delegatecomp/agentprovider/openaiinnovationScope
Large: new client module plus delegation routing, install/doctor wiring, config example updates, and focused tests.
Contribution
I already have a working branch and am dogfooding it locally. Targeted tests are green, and a fresh Hermes process passed a nested delegation acceptance smoke test.
Current implementation status
Branch on my fork:
mxdhavgautam:feat/codex-app-server-subagentsMain implementation files:
agent/codex_app_server_client.pytools/delegate_tool.pyhermes_cli/doctor.pyscripts/install.shcli-config.yaml.exampleTest files:
tests/agent/test_codex_app_server_client.pytests/tools/test_delegate.pytests/hermes_cli/test_doctor.pyValidation run on the branch:
Additional hygiene checks:
Live dogfood notes:
Environment used for dogfooding:
Debug Report
N/A for the feature request. The PR includes targeted unit coverage and local dogfood results instead of a
hermes debug sharereport.