Skip to content

codex_app_server does not receive Hermes SOUL/system prompt context #26035

@wewrite-a

Description

@wewrite-a

Summary

codex_app_server currently appears to bypass Hermes' assembled prompt context for the main turn. In a profile/gateway session with a custom SOUL.md, the Codex subprocess receives the raw user input, but not the Hermes system prompt, persona, injected memory/context files, or current Hermes messages list.

That makes the runtime risky for persona-sensitive gateway profiles: storage/tools may still be profile-scoped via HERMES_HOME, but the model identity/voice is generic Codex rather than the configured Hermes profile.

Repro shape

  1. Create/use a Hermes profile with a custom SOUL.md identity.

  2. Enable:

    model:
      provider: openai-codex
      openai_runtime: codex_app_server
  3. Run the profile through a gateway or CLI session.

  4. Ask an identity/role question or short health check.

Expected

The Codex app-server turn should receive enough Hermes context to preserve the profile identity and normal Hermes behavior, or Hermes should clearly document/guard that this runtime is not persona-equivalent to the default runtime.

At minimum, one of these should be true:

  • SOUL.md / assembled system prompt / memory/context files are seeded into the Codex thread.
  • The current Hermes conversation history is projected into the Codex thread.
  • The runtime is explicitly blocked or warned for gateway/persona-sensitive profiles.

Actual

The profile/gateway process is correctly scoped, and Codex can still access profile-local tools/storage through the Hermes MCP callback. However, the direct model behavior is generic Codex because the turn only sends the current user text.

This can create a split state:

  • profile storage/tools: correct profile
  • model identity/persona: generic Codex app-server context

Code path observed

  • AIAgent.run_conversation() early-returns to _run_codex_app_server_turn() when api_mode == "codex_app_server".

  • _run_codex_app_server_turn() accepts messages, but calls self._codex_session.run_turn(user_input=user_message).

  • CodexAppServerSession.run_turn() sends:

    "input": [{"type": "text", "text": user_input}]

I did not see Hermes' assembled system_prompt, SOUL.md, injected memory/context, or messages being sent into the Codex thread on this path.

Impact

This is a UX regression for long-running messaging assistants whose core value is a stable profile identity and memory behavior. Users may think the wrong profile is attached even though HERMES_HOME and storage are correct.

Workaround

Use the default Hermes runtime for persona-sensitive profiles:

/codex-runtime auto

Keep codex_app_server for code-heavy sessions or experimental profiles where Codex's native shell/apply_patch/sandbox/plugin runtime is more important than Hermes persona continuity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt builderprovider/openaiOpenAI / Codex Responses APItype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions