feat(gateway): add /model and /agent slash commands for all gateway platforms#721
Conversation
OpenAB PR ScreeningThis is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Screening report## IntentPR #721 aims to add chat-visible configuration commands for non-Discord gateway platforms so users can inspect and switch their active model or agent without leaving the conversation. The operator/user-visible problem is that Discord already has FeatFeature. Adds plain-text
Who It ServesPrimary beneficiaries:
Rewritten PromptImplement shared gateway support for plain-text Requirements:
Merge PitchThis is worth advancing because it closes a visible feature parity gap between Discord and the other gateway platforms with an additive, low-risk user workflow. The main reviewer concern is likely scope and placement: adding command interception in Risk profile: low to moderate. The feature is additive, but it touches core gateway dispatch and session configuration state. Best-Practice ComparisonOpenClaw principles that apply:
Hermes Agent principles that apply:
The strongest best-practice overlap is keeping gateway-owned command handling explicit, deterministic, and isolated from normal agent execution. Implementation OptionsOption 1: Conservative shared helper only Option 2: Balanced command registry Option 3: Ambitious cross-platform command abstraction Comparison Table
RecommendationAdvance with the conservative shared-helper approach, but ask for two tightening changes before merge discussion:
A follow-up issue can track the balanced command registry if more gateway commands are expected. For this PR, keeping the change small is the right path because the user benefit is clear and the core risk is contained to command interception and session config mutation. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Fixed the prefix collision NIT — switched to Re: test coverage — noted. Will add unit tests for |
This comment has been minimized.
This comment has been minimized.
🟡 Design feedback — prefer OpenClaw-style
|
|
Rewritten to OpenClaw-style
All 11 scenarios tested end-to-end on Feishu. 197 cargo tests pass. |
🟢 Clean PR — approve recommendedWell-scoped, additive feature. Contributor addressed all first-round feedback: rewrote to OpenClaw-style Full review (Four Questions Framework)1. What problem does this solve?Gateway platforms (Feishu, LINE, Telegram, Teams) lack native slash command UIs. Users cannot list or switch models/agents from chat. Discord has 2. How does it solve it?
3. What alternatives were considered?
4. Is this the best approach?Yes. The implementation follows existing patterns ( Traffic Light🟢 INFO
🟡 NIT (non-blocking)
🔴 No suggested changes. What I checked
|
… platforms - handle_config_command() helper: exact match first, substring disambiguation - Category aliasing: /agents searches both 'agent' and 'mode' - Uses send_fire_and_forget() — no request-response overhead - Updated docs/feishu.md with new commands
Fixes silent message drop when user sends /modelsfoo (no space). handle_config_command returns None for unrecognized input, message now falls through to agent instead of being dropped.
…arg> - Subcommand syntax: /model list, /model set <name or number> - Numbered picker for text-only interfaces - /models and /agents as aliases for list - Unknown actions return error (avoids OpenClaw bug #46894) - Exact match only, no substring ambiguity - Updated docs/feishu.md
a0bc9fd to
b7f07db
Compare
chaodu-agent
left a comment
There was a problem hiding this comment.
Approve — clean, well-scoped feature. Contributor addressed all feedback (OpenClaw-style /model syntax, prefix collision fix).
…latforms (openabdev#721) * feat(gateway): add /models and /agents slash commands for all gateway platforms - handle_config_command() helper: exact match first, substring disambiguation - Category aliasing: /agents searches both 'agent' and 'mode' - Uses send_fire_and_forget() — no request-response overhead - Updated docs/feishu.md with new commands * fix: only continue on recognized command, forward unrecognized to agent Fixes silent message drop when user sends /modelsfoo (no space). handle_config_command returns None for unrecognized input, message now falls through to agent instead of being dropped. * refactor: rewrite /models /agents to OpenClaw-style /model <action> <arg> - Subcommand syntax: /model list, /model set <name or number> - Numbered picker for text-only interfaces - /models and /agents as aliases for list - Unknown actions return error (avoids OpenClaw bug #46894) - Exact match only, no substring ambiguity - Updated docs/feishu.md --------- Co-authored-by: wangyuyan-agent <265828726+wangyuyan-agent@users.noreply.github.com>
Summary
Adds
/modeland/agenttext slash commands for all gateway platforms (Feishu, LINE, Telegram, Teams), following OpenClaw's/model <action> <arg>subcommand pattern per maintainer request.Changes
src/gateway.rshandle_config_command()with subcommand parsing (list/set). Numbered list + set-by-number/name./modelsand/agentsas aliases.docs/feishu.mdDesign decisions
Per maintainer feedback on the original PR:
/model list,/model set <arg>instead of/models <name>. Extensible for future actions (status, etc.) without parser changes./model set 3) instead of guessing partial names. Better UX for text-only interfaces./model statusreturns "Unknown action" instead of being treated as a model name (avoids OpenClaw bug #46894)./modelsand/agentsas aliases — Backward compatible with the plural form.Prior Art
models list/set/status/model [name]/models(select menu)/model list/setmodels list/model(no args)/model listor/modelsmodels set <name>or number/model <name>/model set <name or number>/model statustreated as model name (#46894)Testing
/models— numbered list with ✅/model list— same as/models/model set 3— switch by number/model set deepseek-3.2— switch by name/model set 99— invalid number/model status— unknown action (not model name)/model set— no arg hint/agents— numbered agent list/model— alias for listcargo test— 197 passedEnd-to-end tested on Feishu. Other gateway platforms share the same code path.
Breaking Changes
None.
/modelsand/agents(plural) still work as aliases.Discord Discussion URL
https://discord.com/channels/1491295327620169908/1500160821567684660