Skip to content

Bidirectional Grok Bot ↔ Codex messaging (app-server + gbot) #24

Open

Description

@ScriptedAlchemy

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)

  1. Codex → Grok (ship first): Codex skill / MCP / plugin wrapping gbot send <bot|group> … (and optionally gbot thread for readback). Auth via existing gbot gateway / Grok Bot app session / CURSOR_ACCESS_TOKEN.
  2. 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.
  3. Do not scrape Desktop’s ephemeral CODEX_APP_TOOLS_PIPE_PATH (/tmp/codex-browser-use/*.sock) for product code — that path powers the built-in send_message_to_thread banner 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:

Until fixed, Grok→Codex should target daemon / TUI / codex agents sessions, not today’s Desktop stdio process.

Related local code

  • gbot send / gbot thread already 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

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

Activity

  1. ScriptedAlchemy commented on Sep 15, 2026

    @ScriptedAlchemy
    OwnerAuthor

    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

    • Bidirectional adapters are sound; do not emulate Desktop cross-task UI / scrape CODEX_APP_TOOLS_PIPE_PATH.
    • Product contract: authenticated, attributable delivery to a configured app-server route + thread, with receipts — not “make Desktop look like another task messaged it.”
    • Scope to Codex tasks, not arbitrary ChatGPT chats.
    • Destinations = allowlisted endpoint/profile + threadId, not agent-supplied socket paths.
    • Avoid sync deadlocks: send returns a receipt; waiting for a reply is a separate bounded op (correlation ID, hop limit).

    Correct assumptions

    • Missing socket ≠ proven Desktop-private mode; existing socket ≠ Desktop is using it (#41014 notes daemon can coexist beside private stdio).
    • Grok Bot often runs in the cloud — a local skill alone does not reach the Mac socket. Prefer approved local gbot codex first; later a narrow authenticated remote MCP.
    • Investigate upstream experimental codex queue / thread/queue/add before inventing our own queue.

    Suggested acceptance tweaks for this epic

    • Document endpoint ownership + execution location (local exec vs remote MCP)
    • Provenance envelope + message/correlation IDs; no auto-ack loops
    • Explicitly exclude Desktop-private attach and arbitrary ChatGPT-chat access
    • Compatibility matrix (CLI vs Desktop bundled app-server builds)

    Source: chatgpt.com chat “Implementation Review…”, model 6 Pro.

  2. ScriptedAlchemy commented on Sep 15, 2026

    @ScriptedAlchemy
    OwnerAuthor

    Checked acceptance against main @ ab70a00:

    Criterion State
    Codex → Grok MCP/skill Done (#27 / #25)
    Grok → Codex gbot codex Done (#28 / #26), daemon only
    Docs + no pipe scrape Done
    Live ChatGPT Desktop inject Still blocked upstream (openai/codex#41014, #41112)
    Mac Studio plugin smoke Not done on this host (Ubuntu evidence only)

    Leaving this epic open for Desktop + Mac smoke. Release still gated on product calls for history default (#18) and Version Packages (#29).

  3. ScriptedAlchemy commented on Sep 15, 2026

    @ScriptedAlchemy
    OwnerAuthor

    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

    Remaining checklist on this epic

    Must-fix before daily unattended use: #34, #35, #36 (and #37 for attributable routes). Treat turnId as acknowledged submission, not completed work.

  4. added 2 commits that reference this issue on Sep 15, 2026
  5. ScriptedAlchemy commented on Sep 16, 2026

    @ScriptedAlchemy
    OwnerAuthor

    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 bridge CLI 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=unknown even 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions