codex - 💡(How to fix) Fix Feature request: persistent daemon agent for workspace context and main-agent coordination [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
openai/codex#18929Fetched 2026-04-22 07:50:45
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1cross-referenced ×1unlabeled ×1

Root Cause

In longer coding sessions, the main agent is often focused on the immediate task and loses track of operational context that evolves in parallel.

What I want is a durable “background brain” for the workspace, rather than forcing the main agent to repeatedly rediscover or remember everything itself.

RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

Codex App / CLI

What feature would you like to see?

I’d like Codex to support a persistent background daemon agent that runs alongside the main agent within a workspace.

The key idea is not just background scanning, but a first-class agent that stays alive during the session and can coordinate with the main agent through both pull and push communication.

Core concept

A workspace-scoped daemon agent should be able to:

  • run continuously in the background
  • observe workspace state over time
  • maintain structured context that should not be forgotten mid-session
  • communicate with the main agent in two ways:
    • pull: the main agent can query the daemon for current state or recommendations
    • push: the daemon can proactively notify the main agent when important changes happen

Why this matters

In longer coding sessions, the main agent is often focused on the immediate task and loses track of operational context that evolves in parallel.

What I want is a durable “background brain” for the workspace, rather than forcing the main agent to repeatedly rediscover or remember everything itself.

One concrete use case: multi-repo workspace intelligence

A strong example is a project folder that contains multiple child Git repositories.

In that setup, the daemon agent could maintain per-repo context such as:

  • current branch
  • whether the branch has already been merged upstream
  • dirty/clean state
  • ahead/behind status
  • detected language / stack
  • canonical lint / test / build entrypoints
  • environment hints such as “use uv run”, “use make test”, “use pnpm”, etc.

This would help prevent common failures like:

  • only discovering at commit time that the current branch was already merged and a new branch should be created
  • forgetting repo-specific execution conventions, especially Python environments that require uv
  • repeatedly re-explaining how a given sub-repo should be linted or tested

Important clarification

The Git/repository example above is just one business scenario for the daemon agent.

The feature request is broader: I’m asking for a persistent background agent architecture with structured main-agent coordination, not only for Git status reporting.

Proposed UX

Possible surfaces could include:

  • automatic startup of a daemon agent when entering a workspace
  • a command for the main agent to query daemon state
  • background notifications from the daemon to the main thread when something important changes
  • a compact status panel showing what the daemon currently knows

Acceptance criteria

  • Codex can run a persistent daemon agent for the active workspace
  • the daemon can keep state across the session instead of acting like a one-shot tool call
  • the main agent can pull structured information from the daemon on demand
  • the daemon can push important events back to the main agent proactively
  • multi-repo Git tracking is possible as one implementation/use case, but the daemon mechanism is general-purpose

Additional information

This feels related to existing requests around event surfaces, sub-repo awareness, and durable workspace context, but the missing primitive is a true background daemon agent that can collaborate with the main agent throughout the session.

extent analysis

TL;DR

Implement a persistent background daemon agent in Codex that can run alongside the main agent, maintaining state and communicating through pull and push methods.

Guidance

  • To achieve the proposed architecture, consider designing a daemon agent that utilizes inter-process communication (IPC) mechanisms, such as sockets or message queues, to enable coordination with the main agent.
  • Develop a data structure to maintain the daemon's state, ensuring it can be persisted across the session and updated in real-time as the workspace changes.
  • Implement a query mechanism for the main agent to pull information from the daemon, and a notification system for the daemon to push important events to the main agent.
  • Focus on creating a modular and extensible daemon agent that can be applied to various use cases, including but not limited to multi-repo Git tracking.

Example

import socket

# Daemon agent initialization
daemon_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
daemon_socket.bind('/tmp/codex_daemon.sock')

# Main agent query example
def query_daemon(state_query):
    client_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    client_socket.connect('/tmp/codex_daemon.sock')
    client_socket.sendall(state_query.encode())
    response = client_socket.recv(1024).decode()
    client_socket.close()
    return response

Notes

The implementation details of the daemon agent and its communication with the main agent will depend on the specific requirements and constraints of the Codex architecture. This guidance provides a high-level overview of the necessary components and interactions.

Recommendation

Apply workaround: Design and implement a custom daemon agent that meets the specified requirements, as the existing Codex architecture may not support this feature natively. This approach allows for a tailored solution that addresses the specific needs of the workspace and main agent coordination.

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

codex - 💡(How to fix) Fix Feature request: persistent daemon agent for workspace context and main-agent coordination [1 comments, 2 participants]