Skip to content

Fixes gemini cli start issues#52

Merged
nezhar merged 1 commit into
mainfrom
gemini-issues
Mar 26, 2026
Merged

Fixes gemini cli start issues#52
nezhar merged 1 commit into
mainfrom
gemini-issues

Conversation

@nezhar
Copy link
Copy Markdown
Collaborator

@nezhar nezhar commented Mar 26, 2026

This pull request updates the default Docker images for several agents to use the official vibepod namespace, improves how the Gemini agent is launched, and enhances environment variable handling for interactive containers. It also adds new tests to ensure these changes work as expected.

Summary by CodeRabbit

  • New Features

    • Agent containers now inherit host terminal environment variables (TERM, COLORTERM, TERM_PROGRAM, TERM_PROGRAM_VERSION, LANG) with a sensible TERM default for better terminal behavior.
  • Updates

    • Default Docker image references changed to the new vibepod/* registry for gemini, opencode, devstral, auggie, and copilot.
    • Gemini agent launch updated to run via the Node wrapper to ensure the correct runtime environment.
  • Tests

    • Added tests covering terminal env handling, default images, and the updated gemini launch.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d0a82884-773d-4d1a-8a9f-8caa17763c3c

📥 Commits

Reviewing files that changed from the base of the PR and between b6be056 and f5e6f0f.

📒 Files selected for processing (7)
  • docs/agents/index.md
  • docs/configuration.md
  • src/vibepod/commands/run.py
  • src/vibepod/core/agents.py
  • tests/test_agents.py
  • tests/test_constants.py
  • tests/test_run.py
✅ Files skipped from review due to trivial changes (4)
  • tests/test_agents.py
  • tests/test_constants.py
  • docs/configuration.md
  • docs/agents/index.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/vibepod/core/agents.py
  • tests/test_run.py

📝 Walkthrough

Walkthrough

Updated documentation image namespaces to vibepod/*, added terminal-related environment variable defaults forwarded into containers, changed the gemini agent command to run via env HOME=/config node /usr/local/bin/gemini, and added tests covering these behaviors.

Changes

Cohort / File(s) Summary
Documentation
docs/agents/index.md, docs/configuration.md
Replaced default agent Docker image references from nezhar/*vibepod/* for gemini, opencode, devstral, auggie, copilot.
Agent spec
src/vibepod/core/agents.py
Modified AGENT_SPECS["gemini"].command from ["gemini"]["env", "HOME=/config", "node", "/usr/local/bin/gemini"].
Run command
src/vibepod/commands/run.py
Added _terminal_env_defaults() and merged host terminal env vars (TERM, COLORTERM, TERM_PROGRAM, TERM_PROGRAM_VERSION, LANG) into container env, defaulting TERMxterm-256color.
Tests
tests/test_agents.py, tests/test_run.py, tests/test_constants.py
Added/updated tests for gemini node-wrapper command, image namespace defaults (vibepod/*), terminal env forwarding, and default images mapping; introduced test DockerManager stubs to capture env passed to containers.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as "vibepod CLI"
  participant Run as "commands.run.run()"
  participant Env as "_terminal_env_defaults()"
  participant Docker as "DockerManager.run_agent()"
  participant Container as "Container (running)"

  CLI->>Run: invoke run(...) with agent spec and --env
  Run->>Env: collect terminal env defaults
  Env-->>Run: terminal env dict
  Run->>Run: merge USER_UID/USER_GID, spec.extra_env, CLI --env, terminal env
  Run->>Docker: run_agent(..., env=merged_env, command=agent.command)
  Docker-->>Container: start container with merged env and command
  Container-->>CLI: container running / outputs
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through docs and swapped a name,
I nudged the TERM so colors stay the same,
Gemini now dances via node and HOME,
Containers hum a comfy chromatic poem,
Tiny rabbit cheers for vibepod's new frame! 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title "Fixes gemini cli start issues" focuses specifically on the Gemini agent CLI issue, but the PR encompasses much broader changes including Docker image namespace updates for five agents, terminal environment variable handling, and configuration documentation updates. Revise the title to reflect the primary scope, such as "Update agent Docker images to vibepod namespace and fix Gemini startup" or "Migrate to vibepod Docker images and improve Gemini CLI launch"
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gemini-issues

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 26, 2026

Greptile Summary

This PR fixes Gemini CLI startup issues by switching its container command from the bare gemini binary to an explicit env HOME=/config node /usr/local/bin/gemini invocation — working around Alpine BusyBox's lack of env -S support in shebang lines. It also migrates all non-claude agent images from the personal nezhar/ Docker Hub namespace to the official vibepod/ namespace, and improves interactive terminal compatibility by forwarding host terminal environment variables (TERM, COLORTERM, TERM_PROGRAM, TERM_PROGRAM_VERSION, LANG) into agent containers with a sensible TERM=xterm-256color fallback.\n\n- Gemini command fix (agents.py): The new [\"env\", \"HOME=/config\", \"node\", \"/usr/local/bin/gemini\"] command is well-commented and correctly avoids the BusyBox shebang limitation.\n- Image namespace migration (agents.py, run.py, docs): Five agents updated from nezhar/* to vibepod/*; consistent across source, tests, and documentation.\n- Terminal env forwarding (run.py): _terminal_env_defaults() is injected before spec.extra_env, so agent-specific and user-configured env values correctly take higher precedence.\n- Test duplication (test_run.py): The two new tests duplicate the _CapturingDockerManager inline class; a shared fixture would reduce maintenance burden (non-blocking).

Confidence Score: 5/5

Safe to merge — all logic changes are well-tested and the only finding is a non-blocking style suggestion around test helper duplication.

All three functional concerns (gemini command, image namespace, terminal env) are covered by new tests; the env priority ordering is correct (terminal defaults < spec.extra_env < agent config < CLI flags); no regressions introduced in existing tests.

No files require special attention; tests/test_run.py has minor code duplication but no correctness issues.

Important Files Changed

Filename Overview
src/vibepod/core/agents.py Changed gemini command from ["gemini"] to ["env", "HOME=/config", "node", "/usr/local/bin/gemini"] to bypass Alpine BusyBox shebang limitation; well-commented.
src/vibepod/commands/run.py Added _terminal_env_defaults() helper that forwards host terminal env vars into containers; injected into merged_env between built-in UID/GID and agent-specific spec.extra_env overrides.
tests/test_run.py Two new tests for terminal env forwarding; both duplicate the _CapturingDockerManager class verbatim — otherwise correct and well-targeted.
tests/test_constants.py New test file verifying all default images now resolve to the vibepod/ namespace when override env vars are absent.
tests/test_agents.py Added test asserting the new gemini node-wrapper command; straightforward and correct.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["run() called"] --> B["Build merged_env"]
    B --> B1["USER_UID / USER_GID"]
    B1 --> B2["_terminal_env_defaults()\n(TERM, COLORTERM, TERM_PROGRAM,\nTERM_PROGRAM_VERSION, LANG)\n+ TERM default xterm-256color"]
    B2 --> B3["spec.extra_env\n(e.g. HOME=/config for gemini)"]
    B3 --> B4["agent_cfg env\n(from vibepod config file)"]
    B4 --> B5["--env CLI flags\n(highest priority)"]
    B5 --> C["Resolve command"]
    C --> D{Agent == gemini?}
    D -- Yes --> E["['env', 'HOME=/config',\n'node', '/usr/local/bin/gemini']"]
    D -- No --> F["spec.command\n(e.g. ['claude'], ['codex'], ...)"]
    E --> G["DockerManager.run_agent()"]
    F --> G
Loading

Reviews (1): Last reviewed commit: "Fixes gemini cli start issues" | Re-trigger Greptile

Comment thread tests/test_run.py
@nezhar nezhar merged commit e78dbc2 into main Mar 26, 2026
20 checks passed
@nezhar nezhar deleted the gemini-issues branch April 10, 2026 16:36
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