Repository navigation
connect: slack signs in through the browser as you - #61
Merged
Merged
Conversation
Slack has no self-registration, so the Slack application aforge asks with is registered once and its id compiled in, the way Google's is. It is a public client — Slack's proof-key sign-in has no secret — so there is one row and not a pair: slack_oauth_client / SLACK_OAUTH_CLIENT replaces the shipped id for an organisation that wants its own application asking, and shows "not set" while the shipped one is in use. Co-Authored-By: Claude Fable 5 <[email protected]>
The older settings sheet scrolled to fit a selected row's whole hint, which on a short screen could push the row itself — its label, its value, its marker — above the frame. The row is the floor now: a hint taller than the frame is cut, never the row. Co-Authored-By: Claude Fable 5 <[email protected]>
…nd the bearer law Three laws the registry needed before a second browser plug could exist. A ClientCredential may be Public: a proof key per connection stands in for the secret, so the id alone is the whole credential. A plug may be doored: its vendor will not send a browser back to a loopback address, so it names a registered HTTPS address for one of the two fixed ports, which forwards the browser on to localhost with the query untouched; the free-port rung is never offered to such a vendor. And every key set this package sends is sent as a Bearer, whatever the vendor called it. A plug may also supply a transport for exchanges the vendor refuses with a success status, so the person reads the vendor's word rather than "missing access_token". Granted permissions are read whether the vendor separates them with spaces or commas. Co-Authored-By: Claude Fable 5 <[email protected]>
The Slack plug: user permissions only, never a bot; the sign-in goes through https://agentfield.ai/connect/slack/<port>, which forwards the browser to this machine; the exchange is proof-key only. Four helpers on the Web API — search, one bounded thread read, channel listing, posting — every one checking Slack's ok:false, which Slack sends with a 200. The three words that mean the key is dead read as "Slack has to be connected again", bare, from every helper. Two capabilities, reading and sending. Census 128 to 129, 29 to 30 in a browser. Co-Authored-By: Claude Fable 5 <[email protected]>
slack_search, slack_read_thread, slack_list_channels and slack_send arm when the account is picked up, in the shape the Gmail family has. The three that read are knowledge for a task node; the one that posts leaves in the person's name and is asked about by default, with a consent headline that says the channel and the text. v3 hands the manager the shipped Slack application as a public client. Co-Authored-By: Claude Fable 5 <[email protected]>
The census, the browser list, the twelve permissions, the two fixed addresses and what happens in a workspace that needs an admin's yes. The paragraph that said Slack was deliberately not shipped is replaced. The stale claim that Google needs an application id and secret in settings — false since the build began shipping one — is fixed on both pages. The always-ask table on the permissions page names three tools, and a test keeps that page and internal/approval agreeing. Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Nov 7, 2026
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.
What
Slack joins Google as a browser-connected account.
/connect→ Slack → sign in on Slack's own page →✓ Slack connected as <you> · <workspace>. Then four tools:slack_search,slack_read_thread,slack_list_channels, andslack_send(which asks first, likegmail_send). Any workspace, nothing registered by the person. Census 128 → 129 services, 29 → 30 in a browser.How it signs in, and why it looks the way it does
connect_defaults.go). PKCE means no secret exists — nothing to ship, nothing to rotate.SLACK_OAUTH_CLIENT/ theslack app idrow replace it for an organisation that wants its own (internal) app.http://localhost. Slack refuses non-HTTPS redirect URLs on a publicly distributed app, so the app registershttps://agentfield.ai/connect/slack/8765and…/18765, which 307 straight back tohttp://localhost:<port>/with the query untouched (website2.0 PR bug: task fails at run time on a project-less conversation — approve, then fail #58, live). The plug binds one fixed port at a time and presents the matching door; the:0rung is never used for it.auth.gogrows one optional interface (doored) for this; every other plug's path is unchanged.200 {"ok":false}on failure, on the token endpoint and every method. A small transport turns an exchange refusal into the shapex/oauth2reports, and every Web API call checksokbefore decoding, so a refusal reaches the model in Slack's own word.invalid_auth/token_revoked/account_inactiveare the only way a Slack user token dies (it has no expiry and no refresh), and they read as "Slack has to be connected again".token_type: user;x/oauth2would put that word on the Authorization header verbatim. Every key set this package sends is sent as a Bearer; what the service issued is stored unchanged.Verified against the real app before the code
Spikes on 2026-08-27 against the registered app (token revoked at the end): the secretless PKCE exchange at
oauth.v2.user.accessreturns a top-levelaccess_token(token_type: Bearer, comma-separatedscope); the door trip lands on the loopback listener withcodeandstate;auth.testgivesabir · Agent Field; noexpires_in/refresh_token. One thing not yet exercised live: the history throttle in a workspace other than the app's home one (the home workspace showed no throttle).Validation
Every gate in the repo's
make checkplusgofmt -landstrings bin/aforge | grep -c xoxp(0).go vetclean, build clean, Google/Gmail/Calendar sources byte-for-byte unchanged.internal/connect,internal/session,internal/config,internal/approval,internal/manual,internal/tui3fully green. The full suite has seven packages red —cmd/aforgetick tests,cmd/harness-design,internal/guard,internal/plan,internal/thread,internal/tuicalm-column, and theinternal/sessionrevise-verb flake — all of which reproduce identically at the base commit and pass/fail the same way without this change.Tests are derived from the validation contract in the spec (not from the code): the public-client listing; the exchange with
token_type: usersendingAuthorization: Bearer; a200 ok:falseexchange surfacing Slack's word and never a key;search.messagesdecoded from Slack's documented shape (channel: {id, name},user,username,permalink); oneconversations.repliescall withlimit=15; the three dead-token words and only those reading "Slack has to be connected again", unburied through every helper; both fixed-port cases and the plain busy sentence; comma-separated grants; the four-tool family and its inverse;slack_sendunder the acts-in-your-name floor with a consent headline that carries channel and text; Slack reads counted as knowledge for task nodes; the settings row; the manual answering "how do I connect my Slack workspace".Two review rounds (multi-lens adversarial review with independent refuters) preceded this; the findings that survived are all in.
Commits
Six, each one concern and each building on its own:
config: the slack application ships with the build— the shipped public client id, theslack app idrow andSLACK_OAUTH_CLIENT.tui: the selected settings row stays on screen— the older settings sheet's scroll clamp (a hint taller than the frame is cut, never the row).connect: a public client, a door for vendors that refuse localhost, and the bearer law— the three registry laws, no plug yet.connect: slack, signed in as you— the plug, the four helpers, the two capabilities, census 129/30.session: four slack hands, and slack_send joins the floor— tools, capability inverse, knowledge tools, consent headline, approval floor, v3 wiring.manual: slack arrives, and the pages tell the truth about it— both pages, the permissions count, and a test that keeps the permissions page andinternal/approvalagreeing.After merge
Try it:
bin/aforge→/connect→ Slack → browser → "search Slack for …", read a thread, list channels, send one message and expect the ask.🤖 Generated with Claude Code