Skip to content

feat(super-agent): drop model picker and undocument model flags#7

Merged
Sodawyx merged 1 commit intomainfrom
feat/remove-model-select
Apr 25, 2026
Merged

feat(super-agent): drop model picker and undocument model flags#7
Sodawyx merged 1 commit intomainfrom
feat/remove-model-select

Conversation

@Sodawyx
Copy link
Copy Markdown
Contributor

@Sodawyx Sodawyx commented Apr 25, 2026

Summary

  • ar sa run no longer interactively picks ModelService / Model. CLI flags --model-service / --model still parse and pass through to SuperAgentClient.create() (None = server default), but they are no longer surfaced in user docs. --no-input is kept as a deprecated no-op so existing scripts continue to parse.
  • Deletes _utils/super_agent_picker.py (227 lines) and its 375-line unit test; refreshes click help text; bumps agentrun-sdk[core] floor to >=0.0.34 (that release omits modelServiceName / modelName from outgoing JSON when unset, which is what makes the None passthrough actually work).
  • Strips --model-service / --model rows from ## run / ## create / ## update option tables in docs/{en,zh}/super-agent.md; removes spec.model.{service,name} from the YAML schema sections, root superagent.yaml example, and quickstart blocks in README.md / README_zh.md. The ar model command-group entry stays — that's a separate, still-supported feature. The YAML parser is intentionally unchanged so old yamls with spec.model keep parsing silently.

Total: 12 files changed, +153 / −685.

Test plan

  • make lint clean on touched files
  • make coverage passes (≥95% gate; restored via 5 focused tests against pre-existing uncovered branches in pick_render_mode, repl state-write, render flush/error paths)
  • tests/integration/test_super_agent_run_cmd.pytest_run_missing_model_no_input flipped to assert success + None passthrough; new test_run_no_model_flags_passes_none locks in the bare-flag path
  • .venv/bin/ar sa run --help shows the updated help text (--no-input marked deprecated; --model-service / --model say "optional; server picks a default")
  • EN + ZH docs verified parallel via git diff --stat
  • No leftover super_agent_picker / PickerInputError / resolve_model references in src/, tests/, or docs/

🤖 Generated with Claude Code

…tion

`ar sa run` no longer interactively picks ModelService / Model. CLI
flags `--model-service` / `--model` still parse and pass through to
`SuperAgentClient.create()` (None = server default), but they are no
longer surfaced in user docs. `--no-input` is kept as a deprecated
no-op so existing scripts continue to parse.

Code
- Remove `is_tty + resolve_model()` block from `ar sa run`; pass CLI
  flags straight through to the SDK.
- Delete `_utils/super_agent_picker.py` and its 375-line unit test
  (no production code references the picker after the run-command edit).
- Refresh `--model-service` / `--model` click help text to drop the
  obsolete TTY-picker mention.
- Bump `agentrun-sdk[core]` floor to >=0.0.34 — that release omits
  modelServiceName / modelName from the outgoing JSON when unset,
  which is what makes the None passthrough work end-to-end.

Tests
- Flip `test_run_missing_model_no_input` to assert success + None
  passthrough instead of the previous picker error.
- Add `test_run_no_model_flags_passes_none` to lock in the bare-flag
  path.
- Add focused tests against pre-existing uncovered branches
  (pick_render_mode mutual-exclusion, repl state-write failure, render
  flush exception swallowers + colored error path) to restore the
  >=95% coverage gate that the picker deletion would otherwise dip.

Docs
- `docs/{en,zh}/super-agent.md`: drop `--model-service` / `--model`
  rows from `## run`, `## create`, and `## update` option tables;
  remove the corresponding example bash snippets; strip
  `spec.model.{service,name}` from the YAML schema code block,
  field-mapping table, and multi-doc YAML example. Soften
  `--no-input` row to "Deprecated, no-op".
- `superagent.yaml` (root example): drop `spec.model` block.
- `README.md` / `README_zh.md`: drop stale super-agent picker output
  in the Step 2 quickstart and the `spec.model` block in the Step 3
  yaml example. The `ar model` command-group entry stays — that's a
  separate, still-supported feature.

The YAML parser (`_utils/super_agent_yaml.py`) is intentionally
unchanged so old yamls with `spec.model.{service,name}` keep parsing
silently.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Sodawyx <sodawyx@126.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the interactive ModelService/Model selection flow from ar sa run, allowing the server to choose defaults when --model-service/--model are omitted, and updates docs/tests accordingly while bumping the SDK floor to support “omit when unset” JSON behavior.

Changes:

  • Delete the interactive model picker utility and its unit tests; ar sa run now passes --model-service/--model through as-is (including None).
  • Update CLI help text and documentation (EN/ZH, READMEs) to stop documenting model flags and to mark --no-input as deprecated/no-op.
  • Add/adjust unit + integration tests for REPL state-write failures and renderer flush/error edge paths; bump agentrun-sdk[core] to >=0.0.34.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/agentrun_cli/commands/super_agent/run_cmd.py Removes picker-based resolution; passes model flags directly and updates help text.
src/agentrun_cli/_utils/super_agent_picker.py Deleted interactive picker implementation.
tests/unit/test_super_agent_picker.py Deleted unit tests for the removed picker.
tests/integration/test_super_agent_run_cmd.py Updates expectations for “no model flags” behavior and adds mutual-exclusion test.
tests/unit/test_super_agent_repl.py Adds coverage for REPL state persistence failure handling.
tests/unit/test_super_agent_render.py Adds coverage for flush failures and colored error rendering paths.
pyproject.toml Bumps agentrun-sdk[core] minimum version.
docs/en/super-agent.md Removes model flag documentation; updates --no-input description and examples.
docs/zh/super-agent.md Removes model flag documentation; updates --no-input description and examples.
README.md Removes interactive picker transcript; removes spec.model from YAML quickstart snippet.
README_zh.md Removes interactive picker transcript; removes spec.model from YAML quickstart snippet.
superagent.yaml Adds a repository-root SuperAgent YAML example (now without spec.model).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
"agentrun-sdk[core]>=0.0.33",
"agentrun-sdk[core]>=0.0.34",
"pyyaml>=6.0",
"questionary>=2.0",
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

questionary no longer appears to be used anywhere in the repo (the interactive model picker was removed, and there are no remaining imports/usages). Keeping it as a required runtime dependency increases install size and can introduce supply-chain/compatibility surface unnecessarily. Consider removing questionary>=2.0 from dependencies (or moving it to an optional extra if you plan to reintroduce interactive prompts elsewhere).

Suggested change
"questionary>=2.0",

Copilot uses AI. Check for mistakes.
Comment thread superagent.yaml
Comment on lines +8 to +15
tools:
- mcp-time-sa
skills:
- skill-wechat-article-search
sandboxes: []
workspaces: []
subAgents:
- agent-quick-vdyo9
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

This committed superagent.yaml example looks environment-specific (hard-coded tool/skill/sub-agent identifiers). Since it’s in the repo root with the same name used in the README quickstart, users may try to ar super-agent apply -f superagent.yaml and hit failures if those resources don’t exist. Consider making this file match the minimal README example (empty lists / generic names) or relocating/renaming it to clearly indicate it’s a project-specific sample.

Suggested change
tools:
- mcp-time-sa
skills:
- skill-wechat-article-search
sandboxes: []
workspaces: []
subAgents:
- agent-quick-vdyo9
tools: []
skills: []
sandboxes: []
workspaces: []
subAgents: []

Copilot uses AI. Check for mistakes.
Comment on lines +191 to +193
assert result.exit_code != 0
# click.UsageError -> exit code 2 by default
assert result.exit_code == 2 or "raw" in result.output.lower()
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

The assertion here is fairly loose (exit_code == 2 or "raw" in output) and could pass even if the command fails for an unrelated reason that happens to mention “raw”. To make this test reliably detect the intended behavior, assert the expected Click usage exit code (2) and that the error message contains the mutual-exclusion text from pick_render_mode (e.g. “mutually exclusive”).

Suggested change
assert result.exit_code != 0
# click.UsageError -> exit code 2 by default
assert result.exit_code == 2 or "raw" in result.output.lower()
# click.UsageError -> exit code 2 by default
assert result.exit_code == 2, result.output
assert "mutually exclusive" in result.output.lower()

Copilot uses AI. Check for mistakes.
@Sodawyx Sodawyx merged commit f05d4d2 into main Apr 25, 2026
19 checks passed
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.

2 participants