Skip to content

Grok bot ↔ Solenta: repo-routed intake that opens a fix thread with its own worktree #558

Closed

Description

@currentbits

User story

Solenta and a Grok bot should be able to talk to each other.

Concrete loop: a Grok bot worker is doing GitHub issue triage or PR review. When it finds something worth fixing, it reports into the correct Solenta project (the one whose origin is that repo) and starts a new thread with its own worktree to fix it. The other way: a Solenta thread or automation can send a triage/review job to the Grok bot and get structured findings back, not a paste.

This is a peer protocol, not "Grok is just another provider inside a thread."

Why this is not an existing ticket

Issue What it covers Why this is separate
#157 Generic external MCP pairing (Claude Desktop etc. launch Solenta tasks) Pairing tokens are the auth layer. This is the Grok-bot + GitHub product surface: owner/repo to project routing, triage-to-fix handoff, outbound review jobs.
#258 Solenta-owned inbound triage automation (classify, dedupe, ask questions) That agent lives inside Solenta. This is a Grok bot already working on GitHub that hands a finding in.
#242 Event triggers (PR opened, CI done, webhook) fire a Solenta automation Events are one-way pokes with no findings payload. The bot already did the review; it needs to file work, not fire a schedule.
#161 CI failures / PR comments route back onto an existing thread This creates a thread. There is no thread yet.
#167 Outbound notify webhooks (done/failed/waiting) Notifications, not work intake.
#422 Mixed-workforce roster (non-coding agents as threads) Adjacent attention-model. This is GitHub-identity routing for a coding Grok bot.

Do not lift the cross-project spawn guard (the Shipnest incident: a worker guessed a thread id and forked grok workers onto the wrong repo). thread_fork / thread_send stay same-project. This issue adds a deliberate intake primitive that creates a new lead thread in a named project after resolving GitHub identity.

Solenta today

  • Internal Grok workers already get coder-threads (electron/orchServer.js). thread_fork creates an orchWorker with its own git worktree by default. pool=grok is the worker-pool default.
  • Those tools require a source threadId + matching projectId. The caller must already be a Solenta thread. An external Grok bot (GitHub Action, grok CLI session, xAI review action) has neither.
  • A Grok worker that is a Solenta thread still cannot land a finding on a different project: thread_fork rejects a project mismatch on purpose.
  • Project to GitHub mapping already exists: slugFromRemoteUrl / repoInfoFromRemote (electron/services.js) derive owner/repo from origin. Issue paste-ingest (electron/issues.js) already talks to gh.
  • coder-threads is injected only into Solenta's own sessions. Grok's user MCP config (~/.grok/config.toml via grok mcp add) is global and not a GitHub-bot pairing.
  • Local-first: no Solenta-hosted share URL, no forge. Same guardrail as Origin / hosted-share rulings.

Competitors already run Grok (or a sibling CLI) on GitHub: xAI Code Review Action, Gemini CLI GitHub Action for issue triage + PR review. Those bots comment on GitHub and stop. The missing hop is "and now open a Solenta thread on the right checkout to fix it."

Both directions

1. Bot to Solenta (intake)

Authenticated Grok bot (or in-app grok worker whose finding belongs to another project) calls something like:

project_intake({
  repo: "owner/repo",          // or projectId, never a guessed threadId
  title: "…",
  prompt: "<self-contained fix brief>",
  worktree: true,              // default
  source: { kind: "issue"|"pr"|"review", ref: "…" }
})
→ { projectId, threadId, worktreePath }

Routing: owner/repo to the Solenta project whose origin slug matches. Unknown / ambiguous repo fails loud (do not guess; two checkouts of the same slug is the known memory-key collision). The new thread is a lead, not an orchWorker of the bot: the bot is not in that project. Worktree isolation stays the default, same as thread_fork.

Optional: the bot comments on the GitHub issue/PR with the new threadId so the human can find it. No hosted Solenta URL.

2. Solenta to bot (dispatch)

A Solenta thread, slash command, or automation can send a job the other way: "triage open issues on this project's origin" or "review PR #N." Findings come back as structured intake (and/or GitHub comments), which may then take path 1.

Do not invent a Solenta-hosted bot runner. Prefer: trigger the repo's existing Grok GitHub Action / gh review flow, or invoke the local grok CLI against the GitHub item with the same pairing identity. The protocol is the findings schema, not a new cloud.

Auth and scope

Depends on #157's pairing model (and the #125/#126 token fixes). Do not reuse the workspace-wide coder-threads bearer: that token can already thread_fork anything the caller can name, which is how the wrong-repo spawn happened.

Intake pairing should be:

An in-app grok worker that wants to file into another project uses the same intake tool, not thread_fork. Same-project forks stay on thread_fork.

Out of scope

Acceptance

  • Given project A with origin owner/repo-a and project B with origin owner/repo-b, an authenticated Grok bot reviewing owner/repo-a can intake a finding and get a new thread in A, with a worktree under A's repo. B is untouched.
  • The same call with an unknown origin fails with a named error, no thread created.
  • thread_fork from a thread in B still cannot spawn onto A.
  • A Solenta dispatch of "review PR #N" to the Grok bot produces a structured finding (issue/PR ref + brief) that can take the intake path without a human paste.
  • Tests: intake routing (match / miss / duplicate slug), worktree created, pairing token without intake capability is refused, thread_fork guard still red on cross-project.

Related

#157 (pairing), #258 (in-app triage), #242 (event triggers), #161 (existing-thread reaction), #167 (outbound notify), #245 (headless, so a bot on another machine can reach the workspace), #260 (agent-PR triage inbox), #259 (cross-model review).

Activity

  1. added
    plan:doing
    plan:done
    and removed
    plan:todo
    plan:doing
    on Oct 9, 2026
  2. currentbits commented on Oct 9, 2026

    @currentbits
    OwnerAuthor

    Closing as not planned in the 2026-10-09 board cleanup (#1532). Speculative idea with no work and no tie to the current roadmap. Reopen if it becomes a priority.

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

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions