Repository navigation
feat(agentex): deliver Slack webhook triggers over Socket Mode #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,392
−26
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5b308df
feat(agentex): serve Slack webhook triggers over Socket Mode
kenairhodesScale 6eab343
feat(agentex): run the Slack Socket Mode bridge as its own process
kenairhodesScale 32a901f
docs(agentex): launch the Slack bridge with python -m, like the worker
kenairhodesScale a3fe635
build(agentex): lock only the slack-sdk addition
kenairhodesScale bee13e3
fix(agentex): sign Socket Mode forwards and serve one trigger per Sla…
kenairhodesScale 7708589
fix(agentex): name the Socket Mode columns for Slack and trim the bri…
kenairhodesScale 19fb99c
refactor(agentex): keep Slack Socket Mode settings in their own table
kenairhodesScale a196cdc
fix(agentex): reopen a Slack Socket Mode connection that never connects
kenairhodesScale 92348db
fix(agentex): open each Slack Socket Mode app in its own task
kenairhodesScale 1700101
fix(agentex): check that a Slack app token belongs to the app it regi…
kenairhodesScale 3dd42c5
fix(agentex): let a Slack Socket Mode app wait out its rate limit
kenairhodesScale 0f5d96f
fix(agentex): remove the auth registration when an API key insert fails
kenairhodesScale 7d62c41
feat(agentex): update a Slack trigger's Socket Mode settings, and run…
kenairhodesScale 025373b
chore(stlc): seal the python custom code integrated for this branch
kenairhodesScale f010ef0
Revert "chore(stlc): seal the python custom code integrated for this …
kenairhodesScale 07780d2
chore(agentex): name the compose profile for the bridge slack-socket-…
kenairhodesScale 916c3cf
fix(agentex): check access before loading a key in the Socket Mode ro…
kenairhodesScale dbc7f89
fix(agentex): load the environment before the bridge checks its key
kenairhodesScale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...tabase/migrations/alembic/versions/2026_11_16_1200_slack_socket_mode_apps_f3a5c7e9b1d2.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| """slack socket mode apps | ||
|
|
||
| Revision ID: f3a5c7e9b1d2 | ||
| Revises: e2f4a6c8b0d1 | ||
| Create Date: 2026-11-16 12:00:00.000000 | ||
|
|
||
| Creates ``slack_socket_mode_apps``: one row per Slack app whose events agentex | ||
| receives over Socket Mode, attached to the app's Slack webhook trigger in | ||
| ``agent_api_keys``. The table is new and empty, so its constraints build without | ||
| scanning anything; the foreign key briefly locks ``agent_api_keys`` and does not scan | ||
| it. IF NOT EXISTS makes a re-run a no-op. | ||
| """ | ||
|
|
||
| from collections.abc import Sequence | ||
|
|
||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision: str = "f3a5c7e9b1d2" | ||
| down_revision: str | None = "e2f4a6c8b0d1" | ||
| branch_labels: str | Sequence[str] | None = None | ||
| depends_on: str | Sequence[str] | None = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| op.execute( | ||
| """ | ||
| CREATE TABLE IF NOT EXISTS slack_socket_mode_apps ( | ||
| id VARCHAR NOT NULL PRIMARY KEY, | ||
| agent_api_key_id VARCHAR NOT NULL, | ||
| agent_id VARCHAR(64) NOT NULL, | ||
| slack_app_id VARCHAR(256) NOT NULL, | ||
| app_token_encrypted VARCHAR NOT NULL, | ||
| forward_path VARCHAR NOT NULL, | ||
| created_at TIMESTAMP WITH TIME ZONE DEFAULT now(), | ||
| CONSTRAINT uq_slack_socket_mode_apps_slack_app_id UNIQUE (slack_app_id), | ||
| CONSTRAINT uq_slack_socket_mode_apps_agent_api_key | ||
| UNIQUE (agent_api_key_id, agent_id), | ||
| CONSTRAINT fk_slack_socket_mode_apps_agent_api_key | ||
| FOREIGN KEY (agent_api_key_id, agent_id) | ||
| REFERENCES agent_api_keys (id, agent_id) ON DELETE CASCADE | ||
| ); | ||
| """ | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| op.execute("DROP TABLE IF EXISTS slack_socket_mode_apps;") |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.