-
Notifications
You must be signed in to change notification settings - Fork 951
Support passing query message as command line argument #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
WalkthroughA new CLI option Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Example instruction:
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. Comment |
There was a problem hiding this 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:--taskargument wiring looks correct; consider making behavior clearer in help textThe 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
helpstring that omitting--taskkeeps 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
📒 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)
| 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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
--taskCLI 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.