cd /news/ai-agents/codex-autonomous-luna-subagent-per-t… · home topics ai-agents article
[ARTICLE · art-136180] src=gist.github.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Codex: autonomous Luna subagent, per-task reasoning effort, and completion callbacks

A developer has published a configuration pattern for OpenAI's Codex that adds an autonomous "Luna" subagent, per-task reasoning effort selection, and completion callbacks. The setup, defined in a Codex AGENTS.md section and a companion luna_worker.toml file, lets primary agents delegate bounded, self-contained jobs to Luna with reasoning_effort chosen per spawn from low to max. It also specifies callback delivery via send_message_to_thread with a job_id and the parent's runtime CODEX_THREAD_ID so an idle parent can be woken on completion.

by read2 min views3 publishedSep 21, 2026

Add the following section to ~/.codex/AGENTS.md and save the companion luna_worker.toml as ~/.codex/agents/luna_worker.toml.

  • Primary agents: proactively delegate bounded, self-contained jobs to luna_worker when Luna can complete and verify them independently and delegation saves work or supervision. Suitable jobs include authorized releases through established procedures, focused web research, long-running scripts, batch processing, and straightforward implementation. Handle small operations directly by default, unless there are long waits, useful independent parallel work, or an explicit user request to delegate.
  • Delegate preparation, execution, and verification as one complete job. Build a concise brief from available context and file references; avoid extra parent tool calls solely to prepare the delegation when that information is sufficient. Leave input inspection, artifact preparation, and routine validation to Luna, except where the parent needs them to establish scope or authorization.
  • Choose reasoning_effort explicitly at each spawn:low for known procedures and script supervision,medium for focused research and simple changes, andhigh ormax for harder reasoning still suitable for Luna. Useagent_type="luna_worker" ; its model is fixed to Luna while effort is chosen per assignment.
  • Prefer fork_turns="none" with a sufficient brief: objective, working directory, relevant context/files, authorized actions, owned files if editing, and completion checks. Children must preserve concurrent work and must not delegate further.
  • For unattended delivery in the Codex app, first confirm send_message_to_thread is available. Include a uniquejob_id ,delivery="callback" , andreply_thread_id obtained from the primary task's actual runtimeCODEX_THREAD_ID . Never guess this ID or substitute a child ID. For ordinary collected results, usedelivery="return" and collect the final answer in the active turn.
  • After dispatching a callback job, continue useful independent work or end the turn with a brief handoff and pending status. Do not poll or stay in a waiting loop. Luna must send one explicit completion, failure, or blocking-decision callback to the supplied task; native child completion alone is insufficient to wake an idle parent.
  • On callback, reconcile the result with the original job and current state, verify the supplied evidence as needed, and report the outcome without repeating valid checks. Close finished children with interrupt_agent . Do not turn completion messages into new delegation loops.
── more in #ai-agents 4 stories · sorted by recency
github.com · · #ai-agents
Pipper
── more on @codex 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/codex-autonomous-lun…] indexed:0 read:2min 2026-09-21 ·