Repository navigation
feat(workflows)!: credential expiry sweep is a scheduled workflow; delete the hub loop (CL-8181) - #772
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apps/hub/src/credential-expiry-sweep.ts(hub-owned periodic loop) withworkflows/credential-expiry, a schedule-triggered workflow package in the publishable shape everyworkflows/*package uses.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 ownexpiresAt— is delivered as mail by the host, the same primitive@corbits/heartbeat-workflow/@corbits/workbench-digest-workflowrely on.findDueCredentialExpiries) out of@corbits/notify(which needs@intx/db/postgresand can never be a workflow dependency) into the new package, generalized across every provider instead of a curated Hugging-Face-only list.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 typecheckbun run lintbun run check:structuralbun testinworkflows/credential-expiryandpackages/notify