a digital entity named phi that roams bsky phi.zzstoatzz.io
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

let owner likes authorize owner-gated tools in batch mode

_is_owner was always False in batch mode because author_handle is set
to "" when processing multiple notifications. now checks whether the
owner is among the batch's notification authors — a like counts as
presence, so liking a phi post can confirm a pending action.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+14 -2
+14 -2
src/bot/tools/_helpers.py
··· 40 40 41 41 42 42 def _is_owner(ctx: RunContext[PhiDeps]) -> bool: 43 - """Check if the current message author is the bot's owner.""" 44 - return ctx.deps.author_handle == settings.owner_handle 43 + """Check if the bot's owner is participating in this interaction. 44 + 45 + In single-message mode, checks author_handle directly. In batch mode 46 + (author_handle is empty), checks whether any notification in the batch 47 + came from the owner — a like counts as presence. 48 + """ 49 + if ctx.deps.author_handle == settings.owner_handle: 50 + return True 51 + if ctx.deps.notifications_context: 52 + return any( 53 + e.get("author_handle") == settings.owner_handle 54 + for e in ctx.deps.notifications_context.values() 55 + ) 56 + return False 45 57 46 58 47 59 # --- formatting ---