Skip to content

fix(worker): generate grok titles through the grok cli - #101

Merged
nixuuu merged 1 commit into
devfrom
fix/grok-text-generation
Nov 4, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/grok-text-generation

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 4, 2026

Copy link
Copy Markdown
Member

Canopy must never call model APIs directly; every model call goes through the official harness. Claude and Codex text generation (thread titles, semantic worktree branch names) already ran isolated SDK sessions, but Grok called /v1/chat/completions of a CLIProxyAPI instance directly.

  • Grok text generation now runs an isolated, short-lived Grok CLI session over our ACP adapter: separate temp home, no workspace, no tools, every permission request denied, timeout, output cap, process cleanup. Works with the native login and with a proxy configured behind the CLI.
  • The direct HTTP path and the "Grok titles only via CLIProxyAPI / grok-3-mini" restriction are gone; small-model selection follows the instance catalog.
  • Docs updated (thread-titles, grok-adapter, worktrees).
  • Repo audit: the only remaining direct inference is the bots runtime (apps/gateway/src/bots/model.ts), which the bots-harness stack (feat(bots): run bot turns through official harnesses on workers #97) removes.

Checks: install, gen:check, typecheck, lint, format:check, check:tmp (1059 pass, 153 skip, 0 fail), web build; adapter tests with the fake ACP agent and gateway↔worker integration for a Grok title and branch name.

Refs: d14cc36

@nixuuu
nixuuu merged commit 99e5376 into dev Nov 4, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/grok-text-generation branch November 4, 2026 21:00
nixuuu added a commit that referenced this pull request Nov 4, 2026
Stage 2 of bots on official harnesses (on top of #97).

- **Grok bots** run through the Grok CLI over our ACP adapter as hidden,
resumable sessions (`session/load`), isolated home per bot, every
built-in tool/permission denied, Canopy bot tools via MCP through the
bus — same guarantees as Claude/Codex (durability, offline queue,
cancel/retry, transcript rebuild).
- **Direct runtime removed:** `apps/gateway/src/bots/model.ts` and
everything only it used (direct HTTP model calls, chat-completions
mapping, completion caps, endpoint-key decryption for bots) are gone,
with the old variant-B paths, the "bots need an endpoint/proxy instance"
copy and their tests. Existing bots migrate to harness turns on a worker
picked by the stage-1 rule; bots without an eligible worker show a clear
state.
- **Guard:** a test fails CI if a direct LLM endpoint call
(`/v1/messages`, `/v1/responses`, `/chat/completions`, provider HTTP SDK
clients) is reintroduced outside fixtures. Repo audit: none left.
- The stack was rebased onto dev (incl. #101); stage 1's migration is
now `0070_bot_harness`.

Checks: install, gen:check, typecheck, lint, format:check, check:tmp
(1086 pass, 154 skip, 0 fail), web build; 22 gateway↔worker integration
tests for Grok bot turns, migration of an old-runtime bot and the guard.
Browser checked Grok bot creation/conversation and the updated copy in
light/dark at desktop and phone widths. Paid live tests opt-in, not run.

Draft until the stack is done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant