Skip to content

Auto-fetch container image for agent on start#35

Merged
nezhar merged 1 commit into
mainfrom
issue-30
Mar 11, 2026
Merged

Auto-fetch container image for agent on start#35
nezhar merged 1 commit into
mainfrom
issue-30

Conversation

@nezhar
Copy link
Copy Markdown
Collaborator

@nezhar nezhar commented Mar 10, 2026

This pull request introduces a new auto-pull feature for agent containers in VibePod, allowing users to control whether the latest Docker image is pulled before each run. The feature supports global, per-agent, and CLI flag overrides, and is fully documented and tested.

Summary by CodeRabbit

Release Notes

  • New Features

    • Container images now auto-pull by default; configurable globally, per-agent, or via CLI flag.
    • Global setting can be overridden on a per-agent basis.
  • Documentation

    • Clarified detached mode behavior and how to interact with running containers.
    • Added guidance on auto-pull configuration options and resolution order.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 10, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a configurable auto-pull feature for container images with a three-tier precedence system: CLI flag overrides per-agent configuration, which overrides global configuration. The global default changes from False to True, and documentation is updated to explain the new behavior and clarify detached container workflows.

Changes

Cohort / File(s) Summary
Documentation Updates
docs/agents/index.md, docs/configuration.md
Adds "Auto-pulling the latest image" section explaining precedence (CLI flag > per-agent > global), updates "Detached mode" semantics, and replaces customization subsection with guidance for interacting with running containers via exec.
Configuration Schema
src/vibepod/core/config.py
Changes global auto_pull default from False to True; adds per-agent auto_pull field (defaults to None) for all agents (claude, gemini, opencode, devstral, auggie, copilot, codex) to enable per-agent override.
Runtime Implementation
src/vibepod/commands/run.py
Implements precedence logic: computes should_pull as CLI flag or (per-agent auto_pull if set, else global auto_pull); pulls image if true before starting agent.
Test Coverage
tests/test_config.py, tests/test_run.py
Adds tests verifying per-agent auto_pull defaults to None, per-agent override behavior, global override fallback, and CLI flag precedence; includes stub DockerManager for test isolation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Pull that image, near or far,
Config tiers like a shining star—
CLI wins, then per-agent say,
Global's backup, come what may!
Auto-pulling saves the day! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: introducing auto-fetching of container images for agents on startup.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-30

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/quickstart.md (1)

78-99: ⚠️ Potential issue | 🟡 Minor

Update the earlier startup bullets to match the new default.

This page still says the image is pulled only “if not already present,” but src/vibepod/core/config.py Line 32 now defaults auto_pull to True. As written, the quickstart describes two different pull policies on the same page.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/quickstart.md` around lines 78 - 99, The quickstart's earlier startup
bullets contradict the new default pull policy; update the startup text so it
states the container image is pulled by default (because
src/vibepod/core/config.py sets auto_pull = True) instead of saying "only if not
already present." Locate the startup bullets in docs/quickstart.md and change
the wording to reflect the new default auto-pull behavior (or mention how to opt
out) and ensure any examples or notes about pulling are consistent with the
auto_pull configuration and its variable name.
docs/configuration.md (1)

37-42: ⚠️ Potential issue | 🟡 Minor

Keep the “Full reference” agent blocks consistent.

This snippet now shows auto_pull only for claude, but src/vibepod/core/config.py Lines 37-93 adds auto_pull: None for every built-in agent. In a section labeled “Full reference,” that makes the copied defaults misleading for gemini, opencode, and the rest. Either add the field to each agent block or call out that the remaining blocks are abbreviated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/configuration.md` around lines 37 - 42, The "Full reference" agent
examples are inconsistent: only the claude block shows auto_pull while the
actual defaults include auto_pull for every built-in agent (e.g., gemini,
opencode); update the docs by either adding the auto_pull: null line to every
agent block in the full-reference agents section (keeping env, image, enabled
fields matching the canonical defaults) or explicitly mark the other agent
blocks as abbreviated and note that auto_pull defaults to null for all
built-ins; reference the agents keys (claude, gemini, opencode, etc.) and the
auto_pull field when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/agents/index.md`:
- Around line 170-209: The docs describe a pre-start detached workflow but the
code in run.py calls manager.run_agent(...) before the detach early return, so
-d only detaches the terminal while the agent is already started; either update
the docs to remove the “customise then start manually” steps or change run.py to
implement a true “start-without-launching-agent” mode (e.g., add a --start flag
or move the manager.run_agent(...) call to after the detach check and only
invoke it when not in a pre-start state). Locate manager.run_agent in
src/vibepod/commands/run.py and either (A) revise the docs to state that -d only
detaches the terminal and that the agent is already running, or (B) implement
the flag/flow change so -d leaves the container running without starting the
agent, and ensure the CLI flag name and behavior are documented accordingly.

---

Outside diff comments:
In `@docs/configuration.md`:
- Around line 37-42: The "Full reference" agent examples are inconsistent: only
the claude block shows auto_pull while the actual defaults include auto_pull for
every built-in agent (e.g., gemini, opencode); update the docs by either adding
the auto_pull: null line to every agent block in the full-reference agents
section (keeping env, image, enabled fields matching the canonical defaults) or
explicitly mark the other agent blocks as abbreviated and note that auto_pull
defaults to null for all built-ins; reference the agents keys (claude, gemini,
opencode, etc.) and the auto_pull field when making the change.

In `@docs/quickstart.md`:
- Around line 78-99: The quickstart's earlier startup bullets contradict the new
default pull policy; update the startup text so it states the container image is
pulled by default (because src/vibepod/core/config.py sets auto_pull = True)
instead of saying "only if not already present." Locate the startup bullets in
docs/quickstart.md and change the wording to reflect the new default auto-pull
behavior (or mention how to opt out) and ensure any examples or notes about
pulling are consistent with the auto_pull configuration and its variable name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a8f4b83a-4507-4564-8480-2636d9d61472

📥 Commits

Reviewing files that changed from the base of the PR and between 944b5dd and 179ede6.

📒 Files selected for processing (7)
  • docs/agents/index.md
  • docs/configuration.md
  • docs/quickstart.md
  • src/vibepod/commands/run.py
  • src/vibepod/core/config.py
  • tests/test_config.py
  • tests/test_run.py

Comment thread docs/agents/index.md Outdated
@nezhar
Copy link
Copy Markdown
Collaborator Author

nezhar commented Mar 10, 2026

Implements #30

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/configuration.md (1)

37-42: ⚠️ Potential issue | 🟡 Minor

Document auto_pull consistently across agent blocks.

This is in the “Full reference”, but only agents.claude.auto_pull is shown even though src/vibepod/core/config.py adds auto_pull: None for every built-in agent. Someone copying the gemini/opencode blocks from this page will miss a supported override. Either add auto_pull: null to each agent section or note that the omitted agents support the same key.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/configuration.md` around lines 37 - 42, Add the missing auto_pull
documentation for all built-in agents: either add the line `auto_pull: null` to
each agent block (e.g., under `agents.gemini`, `agents.opencode`, etc.) in the
“Full reference” so every agent lists the per-agent override, or add a single
note stating that all agents support the `agents.<agent>.auto_pull` key (default
null) as implemented in the config initializer (see auto_pull handling in
src/vibepod/core/config.py). Ensure the chosen approach is applied consistently
across every agent section in the configuration reference.
🧹 Nitpick comments (1)
tests/test_run.py (1)

300-315: Keep the test fixture aligned with the new config shape.

_make_config() still models the old baseline: it defaults global_auto_pull to False and drops agents.claude.auto_pull when the value is None. That means the fallback test is only covering the missing-key case, not the explicit null state introduced in src/vibepod/core/config.py. Aligning the fixture with production defaults will make these tests less brittle.

Proposed tweak
 def _make_config(
-    global_auto_pull: bool = False,
+    global_auto_pull: bool = True,
     agent_auto_pull: bool | None = None,
 ) -> dict:
-    agent_cfg: dict = {"env": {}, "init": []}
-    if agent_auto_pull is not None:
-        agent_cfg["auto_pull"] = agent_auto_pull
+    agent_cfg: dict = {"env": {}, "init": [], "auto_pull": agent_auto_pull}
     return {
         "default_agent": "claude",
         "auto_pull": global_auto_pull,
         "auto_remove": True,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_run.py` around lines 300 - 315, The fixture _make_config is out of
sync with production defaults: change the default global_auto_pull to True and
ensure agents.claude.auto_pull is present even when agent_auto_pull is None (do
not drop the key); update the agent_cfg construction to always set
agent_cfg["auto_pull"] = agent_auto_pull so tests cover the explicit null state
introduced in src/vibepod/core/config.py while keeping the existing parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/configuration.md`:
- Around line 37-42: Add the missing auto_pull documentation for all built-in
agents: either add the line `auto_pull: null` to each agent block (e.g., under
`agents.gemini`, `agents.opencode`, etc.) in the “Full reference” so every agent
lists the per-agent override, or add a single note stating that all agents
support the `agents.<agent>.auto_pull` key (default null) as implemented in the
config initializer (see auto_pull handling in src/vibepod/core/config.py).
Ensure the chosen approach is applied consistently across every agent section in
the configuration reference.

---

Nitpick comments:
In `@tests/test_run.py`:
- Around line 300-315: The fixture _make_config is out of sync with production
defaults: change the default global_auto_pull to True and ensure
agents.claude.auto_pull is present even when agent_auto_pull is None (do not
drop the key); update the agent_cfg construction to always set
agent_cfg["auto_pull"] = agent_auto_pull so tests cover the explicit null state
introduced in src/vibepod/core/config.py while keeping the existing parameters.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e5cbeaf1-6e7a-401a-ae04-4d58d252b1cc

📥 Commits

Reviewing files that changed from the base of the PR and between 179ede6 and 0dd48f1.

📒 Files selected for processing (6)
  • docs/agents/index.md
  • docs/configuration.md
  • src/vibepod/commands/run.py
  • src/vibepod/core/config.py
  • tests/test_config.py
  • tests/test_run.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/test_config.py
  • src/vibepod/commands/run.py

@nezhar nezhar merged commit 43f1f9f into main Mar 11, 2026
17 checks passed
@nezhar nezhar deleted the issue-30 branch March 20, 2026 13:55
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