Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/vibepod/commands/list_cmd.py (1)
63-64: Avoid eager configured-agent construction in--runningpaths.
configured_rowsis built even when--runningexcludes configured agents. This adds unnecessary work and creates avoidable coupling to configured-agent metadata for running-only output. Build configured rows only when needed.♻️ Proposed refactor
- running_rows = _running_rows(containers) - configured_rows = _configured_agent_rows() + running_rows = _running_rows(containers) if as_json: import json payload: dict[str, Any] = {"running": running_rows} if not running: - payload["agents"] = configured_rows + payload["agents"] = _configured_agent_rows() print(json.dumps(payload, indent=2)) return @@ if running: return + configured_rows = _configured_agent_rows() console.print() reference_table = Table(title="Configured Agents", title_justify="left")Also applies to: 69-71, 87-97
tests/test_list.py (1)
29-35: Consider asserting theimagefield in configured-agent JSON rows.The command now treats configured-agent rows as a defined schema (
short,agent,image); adding an assertion here would guard against silent payload regressions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/test_list.py` around lines 29 - 35, The test currently builds rows = payload["agents"] and by_agent = {row["agent"]: row for row in rows} and asserts keys and shortcuts; extend it to also assert each configured-agent row includes a non-empty "image" field to prevent schema regressions—for example, inside the loop over AGENT_SHORTCUTS (or when iterating by_agent.values()) add an assertion that "image" in by_agent[agent] and by_agent[agent]["image"] is truthy (or compare against an expected IMAGE_MAP if one exists) so every agent row has a defined image value.
🤖 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_list.py`:
- Around line 29-35: The test currently builds rows = payload["agents"] and
by_agent = {row["agent"]: row for row in rows} and asserts keys and shortcuts;
extend it to also assert each configured-agent row includes a non-empty "image"
field to prevent schema regressions—for example, inside the loop over
AGENT_SHORTCUTS (or when iterating by_agent.values()) add an assertion that
"image" in by_agent[agent] and by_agent[agent]["image"] is truthy (or compare
against an expected IMAGE_MAP if one exists) so every agent row has a defined
image value.
Refactors the agent listing functionality to improve both the code structure and the output format, especially for JSON and table display modes. The changes separate the concepts of configured agents and running agent containers, allowing for clearer output and easier testing of multiple running instances.
Output and Data Structure Improvements:
list_agentscommand now distinguishes between configured agents (agents) and currently running agent containers (running), supporting multiple running instances per agent.Code Refactoring:
_running_mapwith_running_rowsand_configured_agent_rowsfunctions, simplifying how agent and container data are collected and displayed.Testing Enhancements:
Summary by CodeRabbit
listcommand