Repository navigation
Description
Problem
12+ gstack skills hardcode codex exec as the cross-model second opinion engine:
/codex,/review,/ship,/plan-eng-review,/plan-ceo-review,/plan-design-review,/design-consultation,/design-review,/office-hours,/autoplan
These calls use Codex-specific flags (-s read-only, -c 'model_reasoning_effort=...', --enable web_search_cached, resume <session-id>) that have no direct equivalent in other CLIs.
Users who don't have (or don't pay for) OpenAI Codex CLI but do have Google Gemini CLI installed currently have to maintain a translation shim to use these skills. The shim works for basic calls but can't fully translate:
codex exec resume <session-id>(session continuity — no Gemini equivalent)-c 'model_reasoning_effort=...'(dropped silently)--enable web_search_cached(dropped — Gemini has built-in search but no equivalent flag)--jsonJSONL output mode (Gemini doesn't support structured trace output the same way)
Related
- office-hours: Phase 3.5 should fall back to Claude subagent when Codex is unavailable #463 addresses fallback to Claude subagent when Codex is missing, but only for
/office-hours - Several skills already have
CODEX_NOT_AVAILABLEdetection but handle it inconsistently (some skip silently, some fall back to Agent tool)
Proposal
Add a configurable "outside voice" backend in ~/.gstack/config.yaml:
outside_voice:
backend: gemini # or: codex, claude-subagent
# backend-specific config inherited from each CLI's own authThen in skill files, replace direct codex exec calls with an abstraction that dispatches to the configured backend. Each backend adapter handles flag translation:
| Codex flag | Gemini equivalent | Claude subagent |
|---|---|---|
-s read-only |
--sandbox |
Agent tool (read-only by default) |
-c 'model_reasoning_effort=...' |
n/a (drop) | model param |
--enable web_search_cached |
built-in (drop) | WebSearch tool |
resume <session-id> |
n/a | SendMessage to existing agent |
--json (JSONL traces) |
n/a | parse agent output |
This would:
- Let users choose their preferred second-opinion CLI
- Unify the inconsistent
CODEX_NOT_AVAILABLEhandling across skills - Make the "outside voice" pattern a first-class gstack concept rather than a Codex-specific feature
Workaround
A bash shim at ~/.local/bin/codex that intercepts codex exec and translates to gemini -p works for most cases but breaks on session continuity and JSONL output parsing.
Environment
- macOS (Apple Silicon)
@google/[email protected]via npm- gstack 0.13.0.0
Activity
drandrewlaw commentedon Apr 4, 2026
I just had a real-world experience with this in an
/office-hourssession that shows why multi-model second opinions are valuable.What happened: I ran Codex AND Gemini CLI as independent cold reads during Phase 3.5. They genuinely disagreed on a key premise (whether IoTeX was the right wedge chain for a DeFi monitoring product):
This forced a real decision that a single model wouldn't have surfaced. Three perspectives (Claude + Codex + Gemini) produced a genuinely better outcome than any single model alone.
How I ran it: After the existing Codex Phase 3.5 flow, I manually ran Gemini via
gemini -p "$(cat prompt_file)"with the same structured context block, adapted for Gemini's different strengths. The integration was straightforward.Key CLI differences I hit:
codex exec "prompt"gemini -p "prompt"-s read-only--approval-mode plan-C dir-pI'd like to implement this. The resolver pattern in
scripts/resolvers/review.tsis clean — addinggenerateGeminiSecondOpinion()alongside the existing Codex resolver is straightforward. The test infrastructure already exists (test/helpers/gemini-session-runner.ts,test/gemini-e2e.test.ts).Proposed approach:
GEMINI_SECOND_OPINIONresolver that auto-detectswhich geminioutside_voiceconfig pattern proposed in this issueRefs: #772 (auto-detect), #215 (Gemini CLI support)
fkittredge commentedon Jun 11, 2026
+1 — would like to use Gemini CLI as the outside-voice reviewer in place of (or alongside) Codex.
time-attack commentedon Jul 15, 2026
@korabeland The provider-neutral contract for cross-model second opinions remains unresolved, and this issue is the primary place tracking it.
vaskockorovski commentedon Aug 1, 2026
I'd like to build this, and extend the design slightly — happy to take it if the shape below works for you.
Motivation from real usage: running gstack with codex as the outside voice on every review leg, my OpenAI spend hit ~$18/day at solo-consultant throughput. I mined my own review dossiers before proposing this, and the data killed my first instinct (cap the rounds): across three recent leaves, genuine P1s landed at rounds 8 and 12 (one run), rounds 1/5/8/10 (another — two of the four were regressions introduced by the run's own fixes), and rounds 24/25/28 (a 34-round run). Any cap small enough to save money ships real defects. The loop is doing real work — it's just doing the cheap work at frontier prices.
Proposal: move the loop to a cheap backend, keep codex as the converged-artefact gate.
Key points:
codex execexactly as today.codex execcall sites with a dispatch helper; backends declare their invocation. This also gives office-hours: Phase 3.5 should fall back to Claude subagent when Codex is unavailable #463's Claude-subagent fallback a consistent home instead of the current per-skillCODEX_NOT_AVAILABLEdivergence.model_providers/profiles (OpenRouter etc.) rather than a per-vendor adapter — flag translation stays inside a tool that already solves it. Gemini CLI as a backend can layer on later without blocking this.I'll fork and run this locally regardless (it's costing me real money weekly), but I'd rather land it here than maintain drift — same as #1302. If you'd prefer a different config shape or scope, say the word before I cut code.
docs(outside-voice): state the adapter's ACTUAL wiring, not its intent
dgrant commentedon Sep 17, 2026
Yes yes yes. I currently have a bit of a shim that allow me to do outside-voice/adversarial passes with codex or agy or both.
Regarding this config proposal:
We should make it support a list of backends, not just one. The user should be prompted (for me the reason I want to be prompted is so I can confirm my current usages in codex and agy before deciding whether to go ahead with none, one, or both).
dgrant commentedon Sep 17, 2026
Some changes were recently made in 1.86.0.0. See: #2850 (massive PR)
I'm seeing this new
OUTSIDE_LABELtemplate variable, which comes from here:This looks like a good first step. At least 'codex' is less hard-coded now than before, and things are more refactored and abstracted so getting claude to use gemini instead of codex looks a bit easier.
hui-zheng commentedon Sep 20, 2026
Adding a data point from a setup that has been running a non-Codex outside voice for about seven weeks, plus a narrower proposal than the original one, because I think 1.86.0.0 already built most of what this issue asks for.
The seam exists now; only the selection is still hard-coded. Read against 1.87.4.0 as installed:
outsideVoiceFor/outsideVoiceCommand/outsideVoiceInvocation/outsideVoicePreflight/outsideVoiceProvenance/outsideVoiceRuntimeare exactly the abstraction this issue was asking for. What is missing is not the plumbing — it is that the choice is a ternary onctx.hostrather than something an operator can set.The contract a pluggable backend needs also already exists, in your own tree.
outsideVoiceCommandbuilds the Claude Code branch as:That is a complete, provider-neutral shape: prompt on stdin, review on stdout, explicit timeout, explicit access level. A third-party reviewer that honours it needs no new template logic at all. So the ask reduces to one config key naming the command, defaulting to today's host-derived behaviour:
with
outsideVoiceForconsulting it before falling back to the ternary, and theid/label/nativeLabelfields deriving from it soOUTSIDE_LABELand the provenance line stay accurate.One thing worth changing beyond selection: auth discovery should be able to run a command, not only read env vars.
bin/gstack-codex-probeaccepts credentials from exactly three places:This is a security and blast-radius argument rather than a convenience one. Env-var-only discovery means the only way to make the probe see a credential is to put that credential in the environment, where it is inherited by every child process of the shell that exported it. Any other tool in the same environment that reads the same variable name will then silently select that provider for its own purposes, with no prompt and no log line — the variable's presence is itself the configuration.
OPENAI_API_KEYin particular is a name that a great many unrelated tools treat as "use this provider", so the probe's accepted names are effectively a machine-wide switch.An optional
outside_voice_auth_cmd, where exit 0 means usable, removes that coupling entirely: the backend reads its credential at call time from wherever it actually lives — an OS keychain, a secret manager, a short-lived token — and nothing is exported for other processes to find.Also worth stating plainly, since the issue title says "alternative CLI backends": pointing Codex itself at a non-OpenAI provider is not a substitute for this.
outsideVoiceCommandhard-codescodex exec … -c model=…, and the model flag overrides the CLI's configured model, so the backend choice is gstack's rather than the operator's even when the provider is wired. We tried that route first and abandoned it; the concrete failure was the non-OpenAI endpoint rejecting Codex's namespaced tool wrapper with a 422 on/v1/responses.On the shape of a working third-party reviewer, since the contract above is the whole proposal: the one in use here is a small shell script with no tools and no repo access — a single
/v1/chat/completionscall, prompt on stdin, review on stdout, credential read at call time rather than from the environment. It has served as the outside voice for plan and architecture reviews here since 2026-08-01. Nothing about it is special; that is the point. Anything honouring the stdin/stdout contract already in your tree would work identically.For what it is worth on the "who takes it" question above: the narrower scope — one config key plus an optional auth command, no new backends bundled — looks small enough to land independently of anything Gemini-specific.
capy-ai commentedon Oct 11, 2026
Thanks @korabeland for the idea. In the Oct 11 triage we grouped the open feature requests by theme so related asks get built together instead of one at a time. This one is part of the Provider pluralism theme in TODOS.md (https://github.com/garrytan/gstack/blob/50d020ad9/TODOS.md#L54-L69), tracked as a whole in #3138. Closing it here so the open list stays actionable; it isn't rejected, and the theme credits every linked reporter when it's picked up.
capy-ai commentedon Oct 25, 2026
Reopened under the
parkedlabel: this is tracked in the Provider pluralism theme in TODOS.md and tracking issue #3138 (https://github.com/garrytan/gstack/blob/main/TODOS.md#p3-feature-themes-from-the-wave-9-triage-filed-2026-10-11), and what fixes it is the provider seam (#3138), which adds Gemini CLI as an outside-voice backend. Closed-but-tracked read as closed, so parked issues now stay open until they ship, are duplicates, or are declined (https://github.com/garrytan/gstack/blob/main/docs/triage.md).capy-ai commentedon Oct 31, 2026
Thanks for the request, @korabeland, and to everyone who upvoted it. Our second-opinion reviews are built around Codex and Claude Code, and adding Gemini CLI as a third would mean copying a lot of Codex-only setup. We're closing this as not planned for now, and we'll revisit it if we ever build a general way to pick your reviewer.