fix(slack): make connection checks configurable actions

Merged
WE
14h ago
+20-0

Description

Fixes #16565.

Scheduled Slack delivery can pause for approval when the agent checks its connection with auth.test. This endpoint was absent from the Slack action catalog, so users could not configure its approval policy.

Add a Check connection action for POST /api/auth.test, with an Auto-approve catalog default. The existing permission editors expose this action. Other unrecognized endpoints still require approval.

Existing tasks must set Check connection to Auto-approve and save the task. Missing task choices still default to Ask, and workspace restrictions still apply. This change does not grant new permissions to existing tasks.

How Has This Been Tested?

  • uv run pytest -q backend/tests/unit/external_apps/test_slack_catalog.py backend/tests/unit/external_apps/test_action_policy_defaults.py backend/tests/unit/sandbox_proxy/test_gate.py — 111 passed.
  • Added coverage for connection-check matching and its default policy. Verified that auth.revoke and a similar endpoint remain unrecognized.
  • Pre-commit checks passed for all three changed files, including typing, lint, formatting, and feature-map integrity.
  • Live scheduled Slack delivery was not tested.

Additional Options

  • [Optional] Please cherry-pick this PR to the latest release version.

Summary by cubic

Makes Slack connection checks configurable by cataloging POST /api/auth.test as the slack.auth.test action with an Auto-approve default, so the endpoint is no longer unrecognized.

  • Existing tasks must explicitly save this action as Auto-approve for unattended connection checks; missing task choices still resolve to Ask.
  • Other auth.* endpoints remain unrecognized and continue to ask.

Summary by CodeRabbit

  • New Features
    • Added a configurable Slack Check connection action that verifies whether the connection is working.
    • New configurations default this action to Auto-approve.
  • Behavior Changes
    • Existing tasks need to save Auto-approve to run connection checks unattended; tasks without a saved choice will ask for approval.
    • Other unrecognized Slack endpoints continue to require approval.