Skip to content

feat(gtd): add delegated contact API - #372

Open
salmonumbrella wants to merge 2 commits into
maathimself:mainfrom
salmonumbrella:feat/gtd-delegation-api-plugin
Open

feat(gtd): add delegated contact API#372
salmonumbrella wants to merge 2 commits into
maathimself:mainfrom
salmonumbrella:feat/gtd-delegation-api-plugin

Conversation

@salmonumbrella

@salmonumbrella salmonumbrella commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports the backend half of delegated-contact GTD state from closed PR #343 onto the plugin boundary described in #368. A caller can now label one or more owned threads as Delegated and attach a durable contact snapshot without adding a GTD table, migration, or command-engine dependency.

This PR is stacked on #371 and includes that predecessor commit until it lands.

Changes

  • Add POST /api/gtd/delegations for 1–100 unique, owned message IDs and an owned contact or null.
  • Store contact details and a durable delegation boundary under messages.plugin_annotations.gtd.delegation on every live row in the thread.
  • Serialize delegation, transition, and cleanup work per account and thread so concurrent requests cannot create duplicate copies or undo a successful explicit delegation.
  • Reconcile non-UIDPLUS copies through one fresh destination sync and a strict UID set difference. Ambiguous outcomes are reported without guessing.
  • Compensate annotation failures only when this request can identify the exact label copy it created. Pre-existing labels are never removed.
  • Inherit delegation snapshots onto newly synced rows and clear them only after the final Delegated copy disappears.
  • Keep personless delegation public metadata unchanged while retaining the internal boundary needed to distinguish an older message from a newer reply.

Blocked by #371.

Refs #343 and #368


Contributor License Agreement

By submitting this pull request I confirm that:

  • I have read and agree to the Contributor License Agreement.
  • My contribution is my own original work (or I have identified any
    third-party material and confirmed it is compatible with the CLA).
  • I have the right to submit this contribution under the terms of the CLA.

@salmonumbrella
salmonumbrella force-pushed the feat/gtd-delegation-api-plugin branch from faa0356 to 6aba9bc Compare August 26, 2026 06:00
@salmonumbrella
salmonumbrella marked this pull request as ready for review August 26, 2026 06:01
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