Conversation
New drivers: - stepfun_tts: StepAudio 2.5 TTS (Chinese/English, included in plan) - stepfun_image: Step Image Edit 2 (instruction-based image editing) - xiaomi_tts: MiMo V2.5 TTS with voice cloning and voice design - qwen_image: Wanx image synthesis via DashScope (turbo + plus) All providers reviewed: - StepFun: TTS + image editing (stepaudio-2.5-tts, step-image-edit-2) - Xiaomi: TTS with voice clone/design (mimo-v2.5-tts variants) - Qwen/DashScope: image generation (wanx2.1-t2i) - Kimi/Moonshot: text-only, no generation APIs - Featherless: text-only LLM gateway - OpenAI Sora: discontinued (no driver added)
PR Summary by QodoAdd StepFun, Xiaomi, and Qwen generation drivers Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1. Execute signature mismatch
|
| def _get_api_key(self) -> str | None: | ||
| return os.environ.get("STEPFUN_API_KEY") | ||
|
|
||
| def execute(self, inputs: dict[str, Any], runtime: ToolRuntime) -> ToolResult: |
There was a problem hiding this comment.
1. Execute signature mismatch 🐞 Bug ≡ Correctness
New generation drivers define execute(self, inputs, runtime) even though BaseTool’s contract is execute(self, inputs) and selectors invoke tools with a single positional argument, so these providers will raise TypeError when run through tts_selector/image_selector. The accompanying tests also reinforce the wrong arity by calling execute(..., None) and incorrectly try to unset API keys by passing the *API key value* (or empty string) from _get_api_key() into monkeypatch.delenv(), which may fail to remove the real env var or raise.
Agent Prompt
## Issue description
Unify the new generation drivers and their tests with the repository’s tool interface: `BaseTool` and selector orchestration expect `execute(self, inputs)` (single positional argument), but the new tools implement `execute(self, inputs, runtime)` and tests call `execute(..., None)`, causing runtime `TypeError` when selectors invoke these tools. Additionally, the tests attempt to unset API keys by passing the *API key value* (or an empty string) returned by `_get_api_key()` into `monkeypatch.delenv()`, which can fail to unset the real environment variable and/or raise.
## Issue Context
- `BaseTool.execute` is abstract and uses a single-argument signature.
- `TTSSelector` and `ImageSelector` invoke tools as `tool.execute(inputs)`.
- The four new tools currently require an extra positional `runtime` argument.
- `test_missing_api_key_returns_failure` uses `_get_api_key()` (returns the env var *value* or `None`) as the `delenv()` key, which can become `""` and does not correspond to the actual env var name.
## Fix Focus Areas
- tools/audio/stepfun_tts.py[106-110]
- tools/audio/xiaomi_tts.py[128-133]
- tools/graphics/qwen_image.py[106-111]
- tools/graphics/stepfun_image.py[94-99]
- tests/tools/test_new_generation_drivers.py[136-175]
- tools/base_tool.py[296-301]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| dependencies = [] | ||
| install_instructions = ( | ||
| "Set DASHSCOPE_API_KEY to your Alibaba Cloud DashScope API key.\n" | ||
| " export DASHSCOPE_API_KEY=your_key_here\n" | ||
| "Get a key at https://dashscope.aliyun.com/" | ||
| ) |
There was a problem hiding this comment.
2. Status ignores api key 🐞 Bug ☼ Reliability
The new API tools leave dependencies = [] and do not override get_status(), so they will be reported AVAILABLE even when their required API keys are missing. This can cause ToolRegistry menus and provider selection to route to these tools and then immediately fail at execution time.
Agent Prompt
## Issue description
New API-backed tools currently report AVAILABLE even when their required API key env vars are not set, because they neither declare env dependencies nor override `get_status()`.
## Issue Context
- `ToolRegistry.provider_menu()` and selectors use `tool.get_status()` to decide what’s configured/available.
- `BaseTool.get_status()` only checks `dependencies` via `check_dependencies()`.
## Fix Focus Areas
- tools/audio/stepfun_tts.py[41-46]
- tools/audio/xiaomi_tts.py[42-47]
- tools/graphics/qwen_image.py[37-42]
- tools/graphics/stepfun_image.py[43-48]
## Implementation notes
Pick one consistent pattern used in the repo:
1) Override `get_status()` in each tool to return UNAVAILABLE when the corresponding env var is missing (see `OpenAIImage.get_status()`), OR
2) Declare env dependencies, e.g. `dependencies = ["env:STEPFUN_API_KEY"]`, `dependencies = ["env:XIAOMI_API_KEY"]`, `dependencies = ["env:DASHSCOPE_API_KEY"]`.
Either approach will make registry menus and provider selection reflect reality.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
New drivers:
All providers reviewed: