feat(launcher): 'mosaic yolo claudex' — GPT-in-Claude-Code launcher via claude-code-proxy #790
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Make Claudex an official Mosaic framework feature: a
mosaic yolo claudexlauncher that runs GPT models (gpt-5.6-soland siblings) inside the Claude Code harness viaraine/claude-code-proxyauthenticated with ChatGPT-subscription OAuth (no OpenAI platform key). Jason verified the raw setup on the Kinoite workstation on 2026-07-16 via a hand-rolledccgptwrapper; this issue promotes that into a first-class, Mosaic-composed launcher.Authoritative spec
jarvis-brain@main→docs/claude-code/CLAUDEX-GPT-PROXY.md(SHA-256196ad82974c72e479579500d060b025a478e1ea99ada6731b792bdbdf719e5b2). Implementers MUST read it; the env-var table, gotchas, and handoff design notes are normative.Classification (non-negotiable)
Claudex sessions are EXPERIMENTAL / second-opinion capacity — NOT orchestration-grade until Mosaic gates (hooks/queue-guard/sequential-thinking/completion gates) are re-validated under GPT. Mosaic hooks and gates were tuned against Claude models; expect prompt-behavior drift. The launcher must surface this classification in-session (banner and/or composed-contract note) so a claudex session is never mistaken for an orchestrator/delivery lane. Aligns with Jason's standing GPT-caution steer.
Design constraints (from the spec)
mosaic claudedoes (CONSTITUTION/AGENTS/SOUL/USER injection, hooks, MCP) but into an isolatedCLAUDE_CONFIG_DIR(e.g.~/.claude-gptor a Mosaic-owned path). NEVER point at~/.claude, or GPT sessions will mutate real Claude state.ANTHROPIC_BASE_URL=http://127.0.0.1:18765,ANTHROPIC_AUTH_TOKEN=unused(proxy holds the real credential),ANTHROPIC_MODEL=gpt-5.6-sol[1m],ANTHROPIC_SMALL_FAST_MODEL=gpt-5.6-luna[1m],CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1, plus the isolatedCLAUDE_CONFIG_DIR.claude-code-proxy codex auth statusvalid (trigger re-auth device flow if expired — device codes expire ~5 min); proxy listening on127.0.0.1:18765. Liveness = any HTTP response is alive; do NOT usecurl -f(root path returns non-2xx; the original wrapper spawned duplicate proxies because of this).claude-code-proxy.service) over nohup-on-demand for a permanent command; fall back gracefully where systemd-user is unavailable.haiku|sonnet|opusdo not map to Codex models. Either pin all tiers to one GPT model or maintain an explicit mapping in the launcher (default primarygpt-5.6-sol, small/fastgpt-5.6-luna). Document the decision.~/.config/claude-code-proxy/codex/auth.json; the proxy holds the real credential and Claude Code sees onlyunused. Never print/log token values. No secrets in the composed config dir.Target surface (verified against
origin/main@9745bc3f)All work in
packages/mosaic(published as@mosaicstack/mosaic, themosaicCLI):src/commands/launch.ts— the launch seam. ReusecomposeContract(runtime, mosaicHome)(layer injection, ~L325),ensureRuntimeConfig()(~L537), the preflight helpers (checkRuntime/checkSequentialThinking/auditClaudeSettings), andlaunchRuntime(runtime, args, yolo)(~L729). Note:execRuntime()(~L807) currently passesprocess.envunchanged — claudex needs an env-injection path (extendexecRuntime/delegateToScriptto accept env overrides, or a dedicated claudex launch path). Theclaudecase today audits/uses~/.claude— claudex must instead compose into and point at the isolated dir.src/cli.ts—yoloalready exists in the framework command list (~L69) and runtimes are registered viaregisterLaunchCommands(). Wireclaudexas ayolotarget / pseudo-runtime.packages/mosaic/framework/tools/(resolved viaresolveTool/fwScript) — home for any new proxy-preflight / systemd-unit helper scripts.src/config/and runtime MCP wiring undersrc/runtime/mcp-config.ts.Phased plan
codex auth status(+ re-auth flow), liveness probe (gotcha #1), optional systemd user unit management. Pure, well-tested helpers; no session launch yet.CLAUDE_CONFIG_DIR; inject the env-var set;mosaic yolo claudexlaunches a working GPT-in-Claude-Code session. Env-injection path added to the launch code.Docs update (
packages/mosaic/README.md+ framework docs) accompanies the code.Acceptance criteria
mosaic yolo claudexlaunches a GPT-backed Claude Code session using an isolatedCLAUDE_CONFIG_DIR;~/.claudeis provably untouched.curl -f; re-auth path works; no duplicate proxy processes.Delivery gates (Mosaic standard)
*.spec.tsmirroring existing launcher tests (launch.spec.ts,commands/*.spec.ts).mosaic) on exact head.~/.claudemutation, no secret leakage).main, reviewed squash PR, no direct push tomain.#758fleet DAG; must not preempt the M5-001/#758 gate flow.Filed by MS-LEAD (
web1:mosaic-100) per Jason directive (Discord 2026-07-16 19:06Z) relayed by Mos.