Skip to content

Fail fast on Slack auth hangs - #110

Merged
nwparker merged 1 commit into
stablyai:mainfrom
manu354:fix/fail-fast-slack-timeouts
Jul 18, 2026
Merged

Fail fast on Slack auth hangs#110
nwparker merged 1 commit into
stablyai:mainfrom
manu354:fix/fail-fast-slack-timeouts

Conversation

@manu354

@manu354 manu354 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Adds bounded timeouts for agent-facing Slack commands so CLI calls do not hang silently when keychain, Slack API, or rate-limit retry paths stall.

Changes:

  • Add Slack API request timeout env override via AGENT_SLACK_API_TIMEOUT_MS.
  • Fail fast on browser-auth 429 retry windows by default, with opt-in wait via AGENT_SLACK_RATE_LIMIT_MAX_WAIT_MS.
  • Bound macOS keychain / safe-storage subprocess calls via AGENT_SLACK_KEYCHAIN_TIMEOUT_MS.
  • Add a non-interactive command watchdog via AGENT_SLACK_COMMAND_TIMEOUT_MS.
  • Add regression coverage for browser API timeout and 429 fail-fast behavior.

Validation:

  • bun run typecheck
  • bun test (241 pass)
  • bun run lint (0 errors; existing warnings only)
  • bun run format:check
  • bun run build:npm
  • node --check dist/index.js
  • Built CLI smoke against brain-grf4627 auth test/message list now exits quickly with invalid_auth instead of hanging.

nwparker added a commit that referenced this pull request Jul 18, 2026
Takeover: integrate 5 verified community PRs (#113 #110 #109 #92 #106)
@nwparker
nwparker merged commit 0a21d76 into stablyai:main Jul 18, 2026
@nwparker

Copy link
Copy Markdown
Contributor

Taken over, verified, and merged into main via #121 (commit 80f0e8d).

Branch takeover/pr-110. There was a conflict in src/slack/client.ts (main had refactored browserApiMultipart to an input object and added a 429-retry loop). Resolved by combining your timeout wrap with that refactor.

Heads-up (deliberate, disclosed): I extended your 429 fail-fast to the multipart upload path too, so both transports honor the "no hangs" promise (previously multipart could still wait up to 30s). The existing test/client.test.ts "retries HTTP 429" test now opts into waiting via AGENT_SLACK_RATE_LIMIT_MAX_WAIT_MS=30000 — retry logic unchanged, just gated behind the opt-in your PR introduces.

Verified: typecheck clean · 345 tests / 0 fail · bun test test/search-files.test.ts → 4 pass (timeout + 429 fail-fast) · lint 0 errors · build OK. Your commit 342b76d is preserved. Thanks @manu354! Closing as merged.

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