feat: /models, /agents, and /cancel slash commands with ACP configOptions#478
Conversation
e771e0f to
d743248
Compare
|
The CI failure is from
This only surfaces when merged with main (the branch itself compiles clean). Fix options:
The branch needs a rebase regardless ( |
CI fix: rebase requiredThe Root cause: The branch is based on v0.6.4 — the GitHub merge commit creates these methods but nothing calls them because Attempted rebase: Fix needed: Rewrite the PR against current main ( Alternatively, add |
c163e00 to
4819566
Compare
thepagent
left a comment
There was a problem hiding this comment.
LGTM — clean rebase, much simpler than the previous version.
✅ configOptions parsing + caching on create/load
✅ ConfigUpdate event keeps cache fresh during streaming
✅ Pool lock ordering correct (drop state before locking connection)
✅ Ephemeral responses, select menu with current value pre-selected
✅ No dead code — previous send_notification/cancel_session removed
Notes:
set_config_optionwill error for backends that don't support it (kiro-cli). Previous version had a prompt fallback — acceptable to omit if codex-acp is the primary target, but worth documenting.docs/slash-commands.mdreferences/models,/agents,/cancelbut this revision only implements/model. I'll push a fix to align the docs.
4819566 to
ce98b19
Compare
a5b7680 to
3516efa
Compare
3516efa to
603bcac
Compare
Implements dynamic model selection via Discord slash command that bridges to ACP session/set_config_option. Flow: 1. Bot registers /model slash command on ready 2. User invokes /model → OpenAB reads cached configOptions (category: model) 3. Discord Select Menu rendered with available models 4. User selects → OpenAB sends session/set_config_option to ACP agent 5. Agent confirms → Discord message updated Changes: - protocol.rs: Add ConfigOption/ConfigOptionValue types + parse_config_options() - connection.rs: Cache configOptions on session_new, add set_config_option() - pool.rs: Expose get_config_options() and set_config_option() on SessionPool - discord.rs: Register /model command in ready(), handle interaction_create() for both slash commands and component select menus Closes openabdev#477
3f52c10 to
de38dba
Compare
- /agents: select agent mode (category: agent) via generic handle_config_command - /cancel: send session/cancel notification to abort in-flight operations - Refactor handle_model_command into generic handle_config_command(category, label) - Add pool.cancel_session() using send_raw for JSON-RPC notification - Make AcpConnection::send_raw pub for pool cancel access
de38dba to
115634f
Compare
Store cancel handles (stdin + session_id) separately in PoolState. cancel_session() writes directly to stdin without locking the connection, so it works even while the streaming loop holds the connection lock.
- parse_config_options: fall back to kiro models/modes format when configOptions is absent - set_config_option: fall back to sending /<config_id> <value> as prompt when session/set_config_option is not supported - Tighten send_raw to pub(crate)
Summary
Implements
/models,/agents, and/cancelDiscord slash commands that bridge to ACP session config options and cancellation.Closes #477
Slash Commands
/models/agents/cancelHow it works
/models and /agents
/cancel
Changes
src/acp/protocol.rsConfigOptiontypes +parse_config_options()with kiro-cli fallbacksrc/acp/connection.rsset_config_option()with prompt fallback,send_notification(),cancel_handle()src/acp/pool.rsget_config_options(),set_config_option(),cancel_session()with lock-free cancel handlessrc/adapter.rspool()accessor on AdapterRoutersrc/discord.rs/models+/agents+/cancel, interaction handlersBackend compatibility
models/modesfallbackKey design decisions
"discord:<channel_id>"matching the adapter router formatTested
cargo check— no errors/modelsshows 12 models from kiro-cli/agentsshows 2 modes (kiro_default, kiro_planner)/cancelstops in-flight streaming without deadlockDiscord Discussion URL: https://discord.com/channels/1486155598964719616/1495343752947040306