Skip to content

feat: a socket client can take over the banner for agent questions while it stays connected - #476

Merged
arzafran merged 1 commit into
mainfrom
feat/claim-agent-banners
Oct 23, 2026
Merged

arzafran merged 1 commit into
mainfrom
feat/claim-agent-banners

Conversation

@arzafran

Copy link
Copy Markdown
Member

Summary

What this does: when Mesinyer is connected to Programa, an agent question shows one macOS banner (Mesinyer's, with answer buttons) instead of two. Programa still adds the question to its notification list, sidebar and Dock badge, and its own banner comes back by itself as soon as Mesinyer quits or disconnects.

  • New socket method notification.claim_banners (auth required), params {"kinds": ["needs_input"]}, result {"claimed": [...]}. The claim belongs to the calling connection: calling again replaces it, kinds: [] releases it, and SocketConnection.teardown() releases it on every close path, so a client that crashes never leaves banners off.
  • While any live connection claims needs_input, notifications posted by agent.needs_input skip notificationDeliveryHandler. Every other notification is unchanged.
  • Contract first: contracts/v2/methods.json, then the generated V2CommandCatalog.swift and V2MethodNames.swift.
  • docs/socket-api.md documents the method; CHANGELOG has an entry.
  • Test seam: two Debug-only methods, debug.notification.banner_count and debug.notification.banner_reset, count notifications handed to the banner path (counted before the permission check, so a CI runner without notification permission still sees them).

Why: Mesinyer (the team's Slack client) now posts actionable banners for agent questions; without this, every question raised two banners.

Testing

  • ./scripts/reload.sh --tag notif-claim builds the Debug app.
  • scripts/check-v2-contract.sh: OK.
  • New tests_v2/test_notification_claim_banners.py (added to ci_subset.txt): an unclaimed needs_input reaches the banner path; with a second connection's claim it is listed unread but not bannered; kinds: [] releases; a renewed claim holds again; closing the claiming connection restores banners; unknown kinds and a missing kinds are invalid_params. Not run locally, per the repo's testing policy; CI runs it.

Demo Video

None: no visible UI change; the effect is the missing duplicate banner, covered by the socket test.

  • Video URL or attachment: n/a

Review Trigger (Copy/Paste as PR comment)

@codex review
@coderabbitai review
@greptile-apps review
@cubic-dev-ai review

Checklist

  • Tested via CI and, for UI or behavior changes, a tagged build (./scripts/reload.sh --tag <name>)
  • I added or updated tests for behavior changes
  • I updated docs/changelog if needed
  • I requested bot reviews after my latest commit (copy/paste block above or equivalent)
  • All code review bot comments are resolved
  • All human review comments are resolved

@arzafran
arzafran merged commit ee60052 into main Oct 23, 2026
12 checks passed
@arzafran
arzafran deleted the feat/claim-agent-banners branch October 23, 2026 12:11
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