Skip to content

Add Gemini run mode (third external-CLI mode alongside Codex/OpenCode)#134

Merged
Ark0N merged 1 commit into
Ark0N:masterfrom
aakhter:cod-36-gemini-run-mode
Jun 24, 2026
Merged

Add Gemini run mode (third external-CLI mode alongside Codex/OpenCode)#134
Ark0N merged 1 commit into
Ark0N:masterfrom
aakhter:cod-36-gemini-run-mode

Conversation

@aakhter

@aakhter aakhter commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Gemini as a third external-CLI run mode, alongside the existing Codex and OpenCode modes. This follows the same shape as those modes: a CLI resolver, run-mode wiring through the session/tmux layers, and the welcome/run-mode UI.

  • New src/utils/gemini-cli-resolver.ts resolves the Gemini CLI directory, matching the codex/opencode resolver pattern.
  • gemini is added to SessionMode and woven through the shared run-mode handling (session, tmux-manager, mux-interface, schemas, server, and the session/system/ralph/respawn routes) next to the existing codex/opencode branches, including a GET /api/gemini/status endpoint and the external-CLI alt-screen handling.
  • Frontend: a Gemini welcome button and run-mode dropdown option (matching the claude/opencode buttons), with the run-mode dot color and labels.

Note for reviewers

Gemini gets a welcome-screen button (matching Claude and OpenCode). Codex remains dropdown-only, which is the existing behavior on master; this PR does not change that. If you would prefer Gemini to also be dropdown-only for symmetry with Codex, that is a small follow-up.

Files

New: src/utils/gemini-cli-resolver.ts, test/gemini-mode.test.ts.
Wiring: src/session.ts, src/tmux-manager.ts, src/mux-interface.ts, src/types/session.ts, src/config/dependency-registry.ts, src/utils/index.ts, src/web/schemas.ts, src/web/server.ts, src/web/routes/{session,system}-routes.ts.
Frontend: src/web/public/{session-ui.js,index.html,styles.css,mobile.css}.
Tests updated: test/routes/system-routes.test.ts, test/run-mode-ui.test.ts.

Testing

  • tsc --noEmit: clean
  • test/run-mode-ui.test.ts: 4/4
  • test/routes/system-routes.test.ts: 65/65
  • test/gemini-mode.test.ts: 3/3
  • npm run build: passes

@Ark0N Ark0N merged commit 9cc310e into Ark0N:master Jun 24, 2026
2 checks passed
Ark0N pushed a commit that referenced this pull request Jun 24, 2026
Gemini (PR #134) blockers:
- runGemini() now unwraps the {success,data} envelope: status check reads
  .data.available, quick-start reads data.data.sessionId (was reading the raw
  shape, so the Run-Gemini button could never start a session).
- setGeminiEnvVars() now uses the socket-scoped ${this.tmux()} setenv instead of
  bare tmux — Gemini/Google auth env vars were targeting the wrong tmux server
  and silently failing on every install.

Gemini parity polish:
- gemini tab-mode badge ('gm') + .tab-mode.gemini CSS; kill-dialog label
  'Kill Tmux & Gemini'; codeman doctor dependency-registry entry; export
  isGeminiAvailable from utils barrel; COLORTERM=truecolor + unset NO_COLOR;
  add gemini to isAltScreenStripMode (Ink TUI, repaints inline like Codex/Claude).
- Revert 4 system-routes.test.ts envelope assertions weakened to
  (body.message ?? body.error) back to (body.success === false).
- Add a runGemini() vm-sandbox test that drives the envelope path end-to-end.

Ralph todo-config (PR #135): maxTodos/todoExpirationMinutes are now persisted
and read back — surfaced via the loopState getter (RalphTrackerState) into
toState()/SSE broadcast and restored in restoreState(), mirroring maxIterations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants