Skip to content

Add session grant buttons to Telegram approval keyboard (fixes #230) - #231

Open
yablokolabs wants to merge 1 commit into
AtomicBot-ai:mainfrom
yablokolabs:fix/telegram-approval-grant-buttons
Open

Add session grant buttons to Telegram approval keyboard (fixes #230)#231
yablokolabs wants to merge 1 commit into
AtomicBot-ai:mainfrom
yablokolabs:fix/telegram-approval-grant-buttons

Conversation

@yablokolabs

Copy link
Copy Markdown
Contributor

The TUI approval prompt supports granting a category (s) or shell command shape (a) for the remainder of the session, but the Telegram inline keyboard only offered Approve (y) and Deny (n). This forced Telegram users to re-approve every command individually even for repeated safe operations.

Changes

  • buildKeyboard() now accepts the full ApprovalRequest and conditionally adds:
    • s row ("Grant category for session") when canGrantCategory() returns true
    • a row ("Grant <shape> for session") when canGrantShape() returns true
  • handleCallback() now parses s/a callback kinds and passes the matching grant scope through ApprovalGate.resolve()
  • 19 tests pass (3 new: grant category, grant shape, keyboard layout with buttons)

Impact

  • Uses existing gate infrastructure (recordGrant, canGrantCategory, canGrantShape) — no new logic, just new buttons reaching existing code
  • Callback data stays well within Telegram's 64-byte limit (appr:<id>:s / appr:<id>:a)
  • Zero new dependencies

Closes #230

@yablokolabs
yablokolabs force-pushed the fix/telegram-approval-grant-buttons branch from db9cd95 to cbaca21 Compare August 22, 2026 20:32
The TUI approval prompt supports granting a category (s) or shell command
shape (a) for the remainder of the session, but the Telegram inline keyboard
only offered Approve (y) and Deny (n). This forced Telegram users to
re-approve every command individually even for repeated safe operations.

Add two new inline keyboard rows when applicable:
- "Grant category for session" (s) — uses existing canGrantCategory()
- "Grant <shape> for session" (a) — uses existing canGrantShape()

The ApprovalGate already supports grant scopes via recordGrant(); this
change simply wires the bridge callbacks to pass them through resolve().

Fixes AtomicBot-ai#230
@yablokolabs
yablokolabs force-pushed the fix/telegram-approval-grant-buttons branch from cbaca21 to f3abe05 Compare August 22, 2026 20:34
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.

Telegram approval keyboard missing grant category/shape buttons (s/a)

1 participant