Skip to content

feat(workflows)!: credential expiry sweep is a scheduled workflow; delete the hub loop (CL-8181) - #772

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-8181-credential-expiry
Sep 17, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-8181-credential-expiry

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Replace apps/hub/src/credential-expiry-sweep.ts (hub-owned periodic loop) with workflows/credential-expiry, a schedule-triggered workflow package in the publishable shape every workflows/* package uses.
  • The workflow reads stock GET /api/tenants/:tenantId/credentials (paired with /providers) with the run bearer via its own read-only tool, and its step's reply — a reconnect notice for any active credential past its own expiresAt — is delivered as mail by the host, the same primitive @corbits/heartbeat-workflow/@corbits/workbench-digest-workflow rely on.
  • Moves the pure decision logic (findDueCredentialExpiries) out of @corbits/notify (which needs @intx/db/postgres and can never be a workflow dependency) into the new package, generalized across every provider instead of a curated Hugging-Face-only list.
  • Deletes the hub sweep file and its test; the native mcp:<slug> OAuth-refresh path from the old sweep is out of scope (it mutates a stored credential secret directly, a hub-only capability).

Test plan

  • bun run typecheck
  • bun run lint
  • bun run check:structural
  • bun test in workflows/credential-expiry and packages/notify

Replace the hub-owned periodic loop apps/hub/src/credential-expiry-sweep.ts
with workflows/credential-expiry, a schedule-triggered workflow package in
the publishable shape every other workflows/* package uses. It reads the
stock GET /api/tenants/:tenantId/credentials with the run bearer and mails
a reconnect notice for any active credential past its own expiresAt.

The pure decision logic (findDueCredentialExpiries) moves from
@corbits/notify — which needs @intx/db/postgres and can never be a
dependency of installable workflow data — into the new package, generalized
across every provider rather than a curated SWEPT_PROVIDER_LABELS list. The
old sweep's native mcp:<slug> OAuth-refresh path is a hub-only concern (it
mutates a stored credential's secret directly, which no stock tenant route
exposes to a workflow run) and is out of scope for this port.
@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

CL-8181

@TheGreatAxios
TheGreatAxios merged commit d2b342e into main Sep 17, 2026
25 checks 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