Skip to content

Conversation

@maxwellVisual
Copy link

@maxwellVisual maxwellVisual commented Nov 29, 2025

Add '--task' argument for s3 agent cli, compatible with the old parrameters. The agent will be called once with the argument as its query if the '--task' parameter is given. It's for scripting.

Summary by CodeRabbit

  • New Features
    • Added --task CLI option to provide tasks directly. When omitted, the application enters interactive mode for task input.

✏️ Tip: You can customize this high-level summary in your review settings.

Add '--task' argument for s3 agent, compatible with the old parrameters. The agent will be called once with the argument as its query if the '--task' parameter is given.
@coderabbitai
Copy link

coderabbitai bot commented Nov 29, 2025

Walkthrough

A new CLI option --task was added to the s3 CLI app. When provided, the agent directly processes the specified task; if omitted or empty, the program enters an interactive loop prompting for user queries. The control flow maintains existing pause/run behavior.

Changes

Cohort / File(s) Summary
CLI Task Argument
gui_agents/s3/cli_app.py
Added --task string argument to argparse. Updated control flow to conditionally enter interactive mode or directly execute agent with provided task.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify --task argument is correctly defined in argparse
  • Check conditional logic: empty/missing task triggers interactive mode, otherwise uses provided task
  • Confirm control flow maintains existing pause/run behavior and agent reset logic
  • Ensure backward compatibility when --task is not provided

Poem

🐰 A task now flows from CLI's call,
No prompts required when you provide it all,
But ask for none, and interact we shall,
Flexible options, answering the agent's call! 🎯

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 accurately reflects the main change: adding support for passing a query message via command line argument (--task), which enables the scripting use cases described in the PR objectives.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

Copy link

@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

🧹 Nitpick comments (1)
gui_agents/s3/cli_app.py (1)

318-322: --task argument wiring looks correct; consider making behavior clearer in help text

The new CLI option is plumbed correctly and matches the PR’s goal of enabling a single non‑interactive run. You might want to clarify in the help string that omitting --task keeps the previous interactive mode (e.g., “If omitted, you’ll be prompted for queries interactively.”), which will make the dual‑mode behavior more self‑documenting.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3ed515 and 847c40b.

📒 Files selected for processing (1)
  • gui_agents/s3/cli_app.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
gui_agents/s3/cli_app.py (7)
gui_agents/s3/agents/worker.py (1)
  • reset (62-87)
gui_agents/s3/agents/code_agent.py (1)
  • reset (105-111)
gui_agents/s3/agents/agent_s.py (2)
  • reset (31-33)
  • reset (75-83)
gui_agents/s3/core/mllm.py (1)
  • reset (60-69)
gui_agents/s1/cli_app.py (1)
  • run_agent (154-227)
gui_agents/s2/cli_app.py (1)
  • run_agent (154-226)
gui_agents/s2_5/cli_app.py (1)
  • run_agent (154-224)

Comment on lines +375 to +392
task = args.task
if task is None or not isinstance(task, str) or len(task.strip())==0:
while True:
query = input("Query: ")

while True:
query = input("Query: ")
agent.reset()

agent.reset()
# Run the agent on your own device
run_agent(agent, query, scaled_width, scaled_height)

response = input("Would you like to provide another query? (y/n): ")
if response.lower() != "y":
break
else:
agent.reset()

# Run the agent on your own device
run_agent(agent, query, scaled_width, scaled_height)

response = input("Would you like to provide another query? (y/n): ")
if response.lower() != "y":
break

run_agent(agent, task, scaled_width, scaled_height)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Empty/whitespace --task values silently drop into interactive mode, which can surprise scripted usage

Right now:

task = args.task
if task is None or not isinstance(task, str) or len(task.strip())==0:
    # interactive mode
    ...
else:
    agent.reset()
    run_agent(agent, task, scaled_width, scaled_height)

This treats --task "" or --task " " as not providing a task and falls back to the interactive loop. In non‑interactive/scripted contexts (the main new use‑case), this can cause the process to hang waiting for input("Query: ") rather than failing fast.

It also slightly conflicts with the PR summary (“When the --task parameter is provided, the agent will be invoked once with the argument value used as its query.”), since providing a whitespace-only task doesn’t result in a single run.

Consider distinguishing “flag absent” from “flag present but empty” and failing fast for the latter, e.g.:

-    task = args.task
-    if task is None or not isinstance(task, str) or len(task.strip())==0:
+    task = args.task
+    if task is None:
         while True:
             query = input("Query: ")
@@
-    else:
-        agent.reset()
-        
-        # Run the agent on your own device
-        run_agent(agent, task, scaled_width, scaled_height)
+    else:
+        # Fail fast if --task was provided but empty/whitespace-only to avoid
+        # unexpectedly dropping into interactive mode in scripted usage.
+        if not task.strip():
+            print("--task must be a non-empty instruction string")
+            sys.exit(1)
+
+        agent.reset()
+
+        # Run the agent on your own device
+        run_agent(agent, task, scaled_width, scaled_height)

This keeps the legacy interactive behavior when --task is omitted, while making scripted behavior more predictable and CI‑friendly.

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