Repository navigation
Bidirectional Grok Bot ↔ Codex messaging (app-server + gbot) #24
Description
Summary
Enable direct bidirectional communication between Grok Bot agents (via gbot) and Codex tasks/threads, so each side can wake the other the way Codex tasks already message each other ("Sent by ChatGPT from another task").
Motivation
Grok Bot and Codex often work the same repos / machines. Today they cannot coordinate without the human copying context. We want:
- Codex → Grok: Codex agent calls out to a Grok Bot / group with a short status or ask.
- Grok → Codex: Grok Bot injects a follow-up into an existing Codex thread (or starts one), ideally with clear provenance.
Direction of travel (recommended)
- Codex → Grok (ship first): Codex skill / MCP / plugin wrapping
gbot send <bot|group> …(and optionallygbot threadfor readback). Auth via existinggbotgateway / Grok Bot app session /CURSOR_ACCESS_TOKEN. - Grok → Codex: Small bridge client using documented Codex app-server JSON-RPC (
initialize→thread/list|resume→turn/start). Prefer daemon-managed sessions until Desktop re-attaches to the shared control socket. - Do not scrape Desktop’s ephemeral
CODEX_APP_TOOLS_PIPE_PATH(/tmp/codex-browser-use/*.sock) for product code — that path powers the built-insend_message_to_threadbanner but is proprietary and fragile.
Upstream blockers (Desktop live threads)
ChatGPT Desktop currently injects codex_app MCP and runs a private stdio app-server, so ~/.codex/app-server-control/app-server-control.sock is often absent and external clients cannot attach to open Desktop tasks.
Track / pile onto:
- [macOS][regression]
codex_appMCP override makesCODEX_APP_SERVER_USE_LOCAL_DAEMON=1unreachable openai/codex#41014 —codex_appMCP makesCODEX_APP_SERVER_USE_LOCAL_DAEMON=1unreachable - [macOS] Desktop 26.820.60940 ignores local App Server daemon openai/codex#41112 — Desktop ignores local App Server daemon
Until fixed, Grok→Codex should target daemon / TUI / codex agents sessions, not today’s Desktop stdio process.
Related local code
gbot send/gbot threadalready exist in this repo- agent-bundle already has a UDS+WS app-server client pattern (
codex-app-server.ts) that can be reused or vendored carefully
Acceptance criteria
- Codex can message a named Grok Bot/group via a documented skill or MCP tool — shipped in feat(plugin): add the grok-bot Agent Bundle plugin (#25) #27 (
gbot_send/gbot_thread+ skill); Codex skill/MCP: message Grok Bot viagbot send#25 closed - Grok Bot (or
gbot) can list Codex threads on a reachable app-server andturn/starta message — shipped in feat(codex): add gbot codex status, list-threads, and send #28 (gbot codex status|list-threads|send);gbot codex/ bridge: inject messages into Codex threads via app-server #26 closed - Docs cover auth, which Codex process you attach to, and Desktop vs daemon limitations — README sections for plugin install and
gbot codex - No dependency on scraping
CODEX_APP_TOOLS_PIPE_PATH— control-socket / daemon only; Desktop private stdio still blocked upstream (#41014, #41112)
Status (2026-09-15): Child issues done, including #37/#38/#39 via #46. Epic stays open for ChatGPT Desktop attach (upstream) and optional Mac Studio smoke of the plugin. Follow-ups #32/#33 and #46 landed the hardening slices.
References
- https://learn.chatgpt.com/docs/app-server
- Research notes from Grok Bot General (2026-09-15): Desktop private stdio vs shared control socket;
send_message_to_threadis Desktop MCP, not public RPC
Activity
ScriptedAlchemy commentedon Sep 15, 2026
GPT-6 Pro implementation review (chatgpt.com, 2026-09-14)
Full write-up saved from the review session; key updates to the epic:
Keep / strengthen
CODEX_APP_TOOLS_PIPE_PATH.Correct assumptions
gbot codexfirst; later a narrow authenticated remote MCP.codex queue/thread/queue/addbefore inventing our own queue.Suggested acceptance tweaks for this epic
Source: chatgpt.com chat “Implementation Review…”, model 6 Pro.
ScriptedAlchemy commentedon Sep 15, 2026
Checked acceptance against
main@ab70a00:gbot codexLeaving this epic open for Desktop + Mac smoke. Release still gated on product calls for history default (#18) and Version Packages (#29).
ScriptedAlchemy commentedon Sep 15, 2026
Post-land GPT-6 Pro review (#27/#28)
Review chat: https://chatgpt.com/c/6aa89f23-6920-83ea-b98a-a1f155a1ae3f
Verdict: Keep the architecture; do not treat it as production-ready unattended Codex↔Grok yet. Skill-first / thin MCP importing modules is correct. Remaining risk is delivery semantics, transport failure handling, and reliable reply retrieval.
PR #32 is merged (400-char truncation etc.) — do not re-file those.
Follow-up issues filed
gbot_threadwithout losing complete reply retrievalRemaining checklist on this epic
Must-fix before daily unattended use: #34, #35, #36 (and #37 for attributable routes). Treat
turnIdas acknowledged submission, not completed work.Slice 0 (#24): gbot_thread summary plus cursor by default (#45)
feat: collapse grok-bot-cli into one root Agent Bundle project (#50)
ScriptedAlchemy commentedon Sep 16, 2026
Status update (2026-09-16, General)
Landed on npm 0.6.0 via #71 (duplex bridge) + #72 (release): Grok→Codex inject / managed daemon paths and
gbot codex bridgeCLI are in tree. Mac+Ubuntu install/daemon/plugin matrix smoked at 0.6.0 (full duplex/relay live re-proof still with Bridge Ops).Still open (do not close yet): managed Desktop attach proof under post-#65 (
desktopAttached=unknowneven when shim configured — needs shared-thread turn ID match); MATCH2 private-stdio false-positive on probe shells; upstream Desktop private-stdio / local-daemon attach class issues.