Repository navigation
feat: agentMenu allowlist for the bot agent picker - #25
Merged
Merged
Conversation
- New settings key `agentMenu: string[]`: when non-empty, the agent picker shows only those agents, in allowlist order (unknown names are logged and skipped). Absent/empty keeps the previous behaviour. - Fix the dead empty-keyboard guard in showAgentSelectionMenu (grammY yields [[]] for an empty InlineKeyboard): reply agent.menu.empty. - Tests: allowlist filtering/order, unknown-name warning, empty menu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new settings key
agentMenu: string[]. When non-empty, the bot's agent picker shows only those agents, in allowlist order (unknown configured names are logged and skipped). Absent or empty keeps the previous behaviour (all available agents).getAvailableAgentsis unchanged, so other flows/clients (TUI) are unaffected.Seed for this workspace:
agentMenu: ["boss", "executor"]in the bot'ssettings.json(deploy seeded by the pinned-deploy script with the bot stopped).Fix
The empty-keyboard guard in
showAgentSelectionMenuwas dead code: grammY 1.45.1 initialisesInlineKeyboardwith[[]], soinline_keyboard.length === 0never fired and an empty keyboard was sent. Now checksinline_keyboard.some((row) => row.length > 0)and repliesagent.menu.empty— reachable when the allowlist matches no available agent.Tests
logger.warnagent.menu.empty, no inline menuGate:
bun run checkgreen (1864 pass / 3 skip / 0 fail).Deploy
Pinned to the branch SHA pre-merge on the deploy checkout.
No merge (decided by the user).