Stop poisoning slack connect requests with the demoted slack-sage alias#139
Merged
Merged
Conversation
normalizeProviderID was rewriting both "slack" and "slack-sage" inputs to "slack-sage" before any CLI command reached the cloud. Combined with the cloud-side env-var-override leak fixed in AgentWorkforce/cloud#525, that made `relayfile integration connect slack` always mint a Nango Connect session under the demoted alias, regardless of cloud-side fixes: $ relayfile integration connect slack --workspace rw_<id> Connect slack-sage: https://connect.nango.dev/?session_token=... The cloud registry has migrated `slack` to canonical and `slack-sage` to a backwards-compat alias resolved via resolveWorkspaceIntegrationProvider(). Returning the canonical id from the CLI lets the cloud either short-circuit (slack == canonical) or alias-back (slack-sage → slack) — both paths route to the same providerConfigKey on the cloud side. Also retire `slack-sage` from the offline fallback catalog and the prompt default list so first-run / offline users don't silently regress. The fallback at providerRootDir (cmd/relayfile-cli/main.go:4663) already accepts both ids and returns "slack", and is left untouched as defensive backstop for existing local state.json files still tagged slack-sage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
normalizeProviderIDrewrites bothslackandslack-sageinputs toslack-sagebefore any CLI request reaches the cloud, so everyrelayfile integration connect slackmints a Nango Connect session under the demoted alias regardless of cloud-side fixes — observed live today even after AgentWorkforce/cloud#525 was merged and deployed:The cloud registry has migrated to
slackcanonical withslack-sageretained as a backwards-compat alias resolved viaresolveWorkspaceIntegrationProvider. Returning the canonical id from the CLI lets the cloud either short-circuit (slack== canonical) or alias-back (slack-sage→slack); both paths land on the sameproviderConfigKeycloud-side.Changes
normalizeProviderIDreturnsslackfor bothslackandslack-sageinputs (wasslack-sagefor both).fallbackIntegrationCatalog) advertises canonicalslack.providerPromptTextusesslackinstead ofslack-sage.providerRootDiralready accepted both ids and returned/slack— left untouched as a defensive backstop for existing localstate.jsonfiles still taggedslack-sage.Test plan
go test ./cmd/relayfile-cli/— full suite green (4.6s, no regressions).go build ./cmd/relayfile-cli/clean.TestNormalizeProviderIDCanonicalizesSlackAlias— table-driven, covers canonical id, demoted alias, mixed case, whitespace, unrelated providers, and theslack-my-senior-devsibling that must not be affected.TestFallbackIntegrationCatalogUsesCanonicalSlackId— fails ifslack-sageever creeps back into the fallback catalog.rw_517d60b6: after this lands,relayfile integration disconnect slack→relayfile integration connect slackshould printConnect slack: ...andstate.jsonshould recordprovider: slack.Related
🤖 Generated with Claude Code