Register global commands from manifest and improve permission callback formatting - #41
Conversation
…ion callback formatting
There was a problem hiding this comment.
Code Review
This pull request introduces the registration of global manifest commands (such as static commands) into the session's command_store during initialization, ensuring they are included in command update notifications to ACP clients. It also includes minor formatting adjustments. Feedback was provided regarding the registration logic: directly accessing pool.manifest.commands and skipping string values ignores shorthand commands, and could lead to failures if the command name is not explicitly defined. It is recommended to use pool.manifest.get_command_configs() instead, which correctly resolves shorthand commands and ensures names are populated, while also using explicit is not None checks instead of implicit truthiness checks on mappings.
…mands and use explicit None checks - Use pool.manifest.get_command_configs() instead of direct access to automatically convert string shorthands to StaticCommandConfig objects - Ensure command names are populated from dictionary keys when missing in config - Use explicit 'is None' check instead of implicit boolean checks for commands mapping to prevent logic errors with empty collections
修复自定义command通过acp协议回调的问题