Skip to content

feat: agentMenu allowlist for the bot agent picker - #25

Merged
rubenperezrial merged 1 commit into
mainfrom
feat/agent-menu-allowlist
Sep 27, 2026
Merged

rubenperezrial merged 1 commit into
mainfrom
feat/agent-menu-allowlist

Conversation

@rubenperezrial

Copy link
Copy Markdown

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). getAvailableAgents is unchanged, so other flows/clients (TUI) are unaffected.

Seed for this workspace: agentMenu: ["boss", "executor"] in the bot's settings.json (deploy seeded by the pinned-deploy script with the bot stopped).

Fix

The empty-keyboard guard in showAgentSelectionMenu was dead code: grammY 1.45.1 initialises InlineKeyboard with [[]], so inline_keyboard.length === 0 never fired and an empty keyboard was sent. Now checks inline_keyboard.some((row) => row.length > 0) and replies agent.menu.empty — reachable when the allowlist matches no available agent.

Tests

  • allowlist → only those agents, in allowlist order
  • absent allowlist → all agents
  • unknown name → ignored + logger.warn
  • empty menu (allowlist matches nothing) → replies agent.menu.empty, no inline menu

Gate: bun run check green (1864 pass / 3 skip / 0 fail).

Deploy

Pinned to the branch SHA pre-merge on the deploy checkout.

No merge (decided by the user).

- 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.
@rubenperezrial
rubenperezrial merged commit 4d017fc into main Sep 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant