Skip to content

fix(connections): verify native credentials with shared provider checks - #186

Merged
kjgbot merged 4 commits into
mainfrom
codex/control-authorization-health-20261115
Nov 16, 2026
Merged

kjgbot merged 4 commits into
mainfrom
codex/control-authorization-health-20261115

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Native management listings previously treated saved credentials as authorization proof. The listing and provider catalog now verify credentials through their canonical authority and expose status/reason/check time separately from local readiness. Runtime/environment listings retain their existing readiness contract.

Consumes published @relayfile/connection-health@0.1.1 (AgentWorkforce/relayfile-providers#24, now merged). Tokens carry the exact credential revision captured with them, including after refresh; same-ID reconnects cannot inherit previous proof. Expired, unrefreshable tokens retain inactive status across the store's error marker. A present native binding remains distinct from provider acceptance, and relay-web#147 prioritizes rejected authorization.

Completed proofs cache for 30 seconds under the workspace/credential revision. Explicit Refresh (refreshAuthorization=true) bypasses that cache. Unknown results never cache. The eight-slot queue permits at most five seconds waiting plus five seconds active and 64 pending entries. Unknowns emit sanitized, rate-limited provider/reason diagnostics. As before for runtime use, checking expired OAuth credentials can refresh canonical tokens or record an expiry marker; this is done inside the credential authority, never in relayfile-control.

Validation after rebasing on main: npm run typecheck; node --import tsx --test --test-concurrency=1 test/admin.test.ts (13 tests); npm run build. Coverage includes HTTP/DB checks, repeated-read cache reuse, explicit Refresh, refusal vs outage, secret exclusion, unchanged internal readiness, repeated expiry, and reconnect races. One race regression fails when atomic token-version binding is reverted. The registry tarball matches the reviewed artifact and includes its compiled exports.

Khaliq authorized merging once green on 2026-11-16. Current-head full CI and PostgreSQL verifier are green: https://github.com/AgentWorkforce/relay-control/actions/runs/43941638945 . All visible feedback is addressed; the merge hold is released. No manual deployment or credential-authority duplication in relayfile-control.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 64988c0f-7d80-48f4-8739-f1412aa655ee
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T07:50:54.987640Z b83d834 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@khaliqgant khaliqgant added the merge-train:hold Do not merge until the owner gives the go label Nov 16, 2026 — with ChatGPT Codex Connector

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment thread src/admin/routes.ts Resolved
Comment thread src/admin/connections.ts Resolved
Comment thread src/admin/connections.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b83d834baa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/admin/connections.ts Resolved
Comment thread src/admin/connections.ts Resolved

@agent-relay-code agent-relay-code Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at 9f73543 (comment only; the PR body holds it, so no approval yet).

  1. Not installable yet. @relayfile/connection-health@0.1.0 is not on the registry, so npm ci fails and "Typecheck and test" is red. The lockfile pins a sha512 integrity for the locally packed tarball; after publication the registry tarball must be byte-identical or npm ci still fails. Safer: publish, then re-run npm install @relayfile/connection-health@0.1.0 and commit the refreshed lock entry.

  2. A member GET now writes and calls out. On main runtimeToken is reached only through the internal service route. With listHealth, every GET /integrations and GET /integrations/providers by any workspace member runs runtimeToken (OAuth refresh, credential rewrite, markError flipping status to error) plus a provider request per connection. Worth stating in the PR body, and worth confirming the queue's semantics since I cannot read the package: cache TTL per key, concurrency bound, and a request timeout on signal so a hanging provider cannot stall the listing. The key includes record.version, which markError bumps, so a failing connection is re-probed on every listing.

  3. Catch-all in the probe. The catch maps every error, including database failures from this.get, to unknown/credentials_unavailable. Consider rethrowing non-ConnectionError/non-provider errors so an outage is not reported as a credential state.

  4. Minor: listHealth calls this.get up to three times per connection; a single read after the probe would do.

Local checks here could not run (dependency missing); the review is static.

@khaliqgant

Copy link
Copy Markdown
Member Author

The repository guidance audit landed on main at 30f89522d128 and overlaps this PR's documentation paths (README.md). Please rebase on current main and reconcile the new concise root README / docs/repository-guide.md / AGENTS guidance split before this PR is considered ready.

@kjgbot
kjgbot force-pushed the codex/control-authorization-health-20261115 branch from 98683e5 to 49361c7 Compare November 16, 2026 18:46
@kjgbot
kjgbot force-pushed the codex/control-authorization-health-20261115 branch from 49361c7 to 58459f1 Compare November 16, 2026 19:39
@kjgbot

kjgbot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the visible review on 9f73543: current head is 58459f1fe61dc43464ae68cda0d7bc294ca15aac, rebased on main.

  1. The exact compiled dependency is now published as 0.1.1; registry integrity matches the lockfile and all eight distributed build files match reviewed provider source. Providers Key session erasure by workspace and source #24 is merged with green main CI.
  2. The management read's side effects are now documented: expired OAuth credentials can refresh or record an expiry marker inside the canonical credential authority. Completed proofs cache for 30 seconds under the exact workspace/binding/revision; explicit Refresh bypasses completed cache, concurrent work deduplicates, and unknowns never cache. Limits are eight active, 64 pending, five seconds queued and five seconds active. Diagnostics are sampled and sanitized.
  3. Supplementary-check failures deliberately degrade to unknown rather than fail the whole listing or claim credential validity. The initial database-backed list still fails normally if storage is unavailable. No catch path turns an outage into active/inactive proof. This preserves the listing's supplementary-health contract.
  4. The extra snapshots are deliberate: the verified token carries its credential revision atomically, and post-check/final snapshots refuse proof after a same-ID replacement. Removing the atomic revision binding makes the race regression fail. Completed-proof caching avoids repeated provider traffic and the probe reads on ordinary repeated loads.

The runtime listing retains its boolean local-readiness contract; management listings distinguish native binding presence from provider authorization, and the matching web UI renders rejected authorization as inactive. The guidance/README split was reconciled on main.

Local final validation: typecheck, 13 HTTP/DB admin tests, build. The updated repeated-list regression proves cache reuse, forced Refresh retries, refusal vs outage and secret exclusion. Khaliq has directly authorized merging once current-head CI/reviews are green; no manual deployment is requested.

@kjgbot kjgbot removed the merge-train:hold Do not merge until the owner gives the go label Nov 16, 2026
@kjgbot
kjgbot merged commit 59370e2 into main Nov 16, 2026
4 checks passed
@kjgbot
kjgbot deleted the codex/control-authorization-health-20261115 branch November 16, 2026 19:52
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.

2 participants