Separate agent vs local commands with client-side handling and feedback#15
Separate agent vs local commands with client-side handling and feedback#15
Conversation
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
BukeLy
left a comment
There was a problem hiding this comment.
不够Userfriendly,你只是阻拦Command,你没有给User任何反馈,而且没前向兼容,未来如果有部分的cmd要在client处理就不好设置了.
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Blocked slash commands are now handled locally: users receive an inline “Unsupported command” message (listing allowed commands when configured) instead of silent drops, and the local handler is centralized for future client-side command logic. Fixed in 5b17e43. |
There was a problem hiding this comment.
Pull request overview
This PR adds a client-side command whitelist mechanism to filter which slash commands are forwarded to the Agent backend. Commands not in the whitelist are handled locally with immediate user feedback, preventing silent drops of CLI-local commands like /help or /context that produce no backend output.
- Introduced TOML-based configuration for declaring allowed slash commands
- Added config loading with defensive error handling and validation
- Implemented command gating in both producer (webhook handler) and consumer (SQS processor)
- Added local user feedback for blocked commands with helpful error messages
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| agent-sdk-client/config.toml | New TOML configuration file defining whitelist of commands to forward to backend |
| agent-sdk-client/config.py | Added TOML loading, command extraction logic, and whitelist validation with is_command_allowed method |
| agent-sdk-client/handler.py | Added _handle_local_command to provide immediate feedback for non-whitelisted commands before SQS queueing |
| agent-sdk-client/consumer.py | Added defensive whitelist check in SQS consumer (redundant with producer check) |
| tests/test_command_whitelist.py | Added unit tests for whitelist loading and command allow/deny decisions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
BukeLy
left a comment
There was a problem hiding this comment.
当前local cmd和agent cmd不够清晰.
应该不是WhiteList CMD的概念,应该是部分cmd是agent cmd部分是local cmd.
所以CONFIG配置文件修改一下,
1.修改原来的whitelist cmd改为agent cmd
2.添加一个新的章节[local_cmd]
3.修改handle_local_command,如comment提到的.
4.实现一个/help的local命令示例,输出Hello World.
5.整体CodeReview一下保持KISS原则.
Co-authored-by: BukeLy <19304666+BukeLy@users.noreply.github.com>
Switched config to separate agent/local commands, added local /help example, and updated handler/local command handling accordingly. (2175062) |
Client was forwarding all slash commands to the Agent backend, including CLI-local commands that produce no backend output.
agent_commandsandlocal_commandsinagent-sdk-client/config.toml; added a local/helpexample response.tomllibloader now parses agent/local sections with defensive logging for malformed entries.Example:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.