Conversation
📝 WalkthroughWalkthroughThis PR implements the Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as run command
participant AgentSpec
participant Docker as DockerManager
User->>CLI: invoke with --ikwid=true, agent=claude
CLI->>AgentSpec: get agent spec for claude
AgentSpec-->>CLI: return AgentSpec with ikwid_args=["--dangerously-skip-permissions"]
alt ikwid enabled and args exist
CLI->>CLI: append ikwid_args to launch command
else ikwid disabled or args missing
CLI->>CLI: use original command unchanged
end
CLI->>Docker: launch container with (possibly augmented) command
Docker-->>User: container running
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip Flake8 can be used to improve the quality of Python code reviews.Flake8 is a Python linter that wraps PyFlakes, pycodestyle and Ned Batchelder's McCabe script. To configure Flake8, add a '.flake8' or 'setup.cfg' file to your project root. See Flake8 Documentation for more details. |
Greptile SummaryThis PR introduces a new Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[run command invoked] --> B{ikwid flag set?}
B -- No --> E[command = spec.command]
B -- Yes --> C{spec.ikwid_args set?}
C -- Yes --> D["command = list(command or []) + ikwid_args\ninfo log: IKWID mode appending args"]
C -- No --> F[warning: IKWID not supported for agent\ncommand unchanged]
E --> G[run_agent called with command]
D --> G
F --> G
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_run.py (1)
538-708: Consider extracting shared test fixture to reduce duplication.The
_CapturingDockerManagerclass is duplicated across these tests and several existing tests in the file. Consider extracting it to a shared fixture or module-level class.That said, the tests themselves are well-structured and correctly verify all ikwid scenarios:
- ✓ Appends args for claude
- ✓ Appends args for codex
- ✓ Ignores for unsupported agent
- ✓ No modification when disabled
♻️ Optional: Extract shared capturing manager
# Add at module level (around line 409, near _StubDockerManager) class _CapturingDockerManager: """DockerManager mock that captures run_agent kwargs.""" def __init__(self) -> None: self.captured: dict = {} def ensure_network(self, name: str) -> None: pass def networks_with_running_containers(self) -> list[str]: return [] def pull_image(self, image: str) -> None: pass def ensure_proxy(self, **kwargs) -> None: # type: ignore[no-untyped-def] pass def run_agent(self, **kwargs) -> object: # type: ignore[no-untyped-def] self.captured.update(kwargs) return type( "_Container", (), { "name": f"vibepod-{kwargs.get('agent', 'test')}-test", "id": "abc123", "status": "running", "attrs": {"NetworkSettings": {"Networks": {}}}, "reload": lambda self: None, "labels": {}, "logs": lambda self, **kw: b"", }, )()Then use it in tests:
def test_ikwid_appends_args_for_claude(monkeypatch, tmp_path: Path) -> None: """--ikwid appends --dangerously-skip-permissions to claude command.""" manager = _CapturingDockerManager() monkeypatch.setattr(run_cmd, "get_config", lambda: _make_config()) monkeypatch.setattr(run_cmd, "DockerManager", lambda: manager) run_cmd.run(agent="claude", workspace=tmp_path, detach=True, ikwid=True) assert manager.captured["command"] == ["claude", "--dangerously-skip-permissions"]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/test_run.py` around lines 538 - 708, Extract the duplicated _CapturingDockerManager into a module-level class with an instance-level captured dict (e.g., class _CapturingDockerManager with self.captured), implement ensure_network/networks_with_running_containers/pull_image/ensure_proxy as no-ops and run_agent to self.captured.update(kwargs) and return the fake container (use kwargs.get("agent") for the name); then in tests (test_ikwid_appends_args_for_claude, test_ikwid_appends_args_for_codex, test_ikwid_ignored_for_unsupported_agent, test_ikwid_false_does_not_modify_command) replace the inner class with manager = _CapturingDockerManager() and monkeypatch.setattr(run_cmd, "DockerManager", lambda: manager) and update assertions to check manager.captured["command"] (instead of the local captured dict).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/test_run.py`:
- Around line 538-708: Extract the duplicated _CapturingDockerManager into a
module-level class with an instance-level captured dict (e.g., class
_CapturingDockerManager with self.captured), implement
ensure_network/networks_with_running_containers/pull_image/ensure_proxy as
no-ops and run_agent to self.captured.update(kwargs) and return the fake
container (use kwargs.get("agent") for the name); then in tests
(test_ikwid_appends_args_for_claude, test_ikwid_appends_args_for_codex,
test_ikwid_ignored_for_unsupported_agent,
test_ikwid_false_does_not_modify_command) replace the inner class with manager =
_CapturingDockerManager() and monkeypatch.setattr(run_cmd, "DockerManager",
lambda: manager) and update assertions to check manager.captured["command"]
(instead of the local captured dict).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 08e99d7f-d5f6-4974-ad3e-047d664b09df
📒 Files selected for processing (4)
src/vibepod/commands/run.pysrc/vibepod/core/agents.pytests/test_agents.pytests/test_run.py
This pull request introduces a new
--ikwidoption to theruncommand, allowing users to enable an "I Know What I'm Doing" mode that auto-approves or skips permission prompts for supported agents. The implementation includes updates to agent specifications, command handling, and comprehensive tests to ensure correct behavior for both supported and unsupported agents.New feature: "IKWID" mode support
ikwidboolean option to theruncommand insrc/vibepod/commands/run.py, which enables auto-approval/permission skipping for supported agents.AgentSpecclass insrc/vibepod/core/agents.pyto include an optionalikwid_argsfield, specifying extra command-line arguments for "IKWID" mode.Agent specification updates
ikwid_argsfor theclaudeagent (["--dangerously-skip-permissions"]) and for thecodexagent (["--full-auto"]). Other agents do not haveikwid_argsset, so "IKWID" mode is ignored for them. [1] [2]Command handling improvements
runcommand logic to append the appropriateikwid_argsto the agent command when "IKWID" mode is enabled, and to log a warning if the selected agent does not support it.Implements #43
Summary by CodeRabbit
Release Notes
--ikwidCLI flag to the run command, enabling auto-approval mode and permission prompt skipping