Skip to content

fix: Slack message router uses per-agent timeout + forwards error messages (#221) - #225

Merged
vybe merged 1 commit into
mainfrom
feature/221-slack-timeout-fix
Mar 30, 2026
Merged

vybe merged 1 commit into
mainfrom
feature/221-slack-timeout-fix

Conversation

@pavshulin

@pavshulin pavshulin commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Slack message router passed timeout_seconds=_get_channel_timeout() (default 120s) to TaskExecutionService.execute_task(), overriding the agent's configured execution_timeout_seconds (e.g. 900s). All other callers (chat.py, paid.py, internal.py) pass None and let the service read the per-agent timeout.

Also: error messages were hardcoded ("Sorry, I encountered an error"). Now forwards the actual error from the agent to the Slack user.

Changes

  • message_router.py: Pass timeout_seconds=None — uses agent's timeout (TIMEOUT-001)
  • message_router.py: Forward actual error messages to Slack users instead of generic text
  • Generic fallback only for empty/unknown errors

Test plan

  • 11 unit tests pass (tests/unit/test_slack_timeout_fix.py)
    • Timeout, capacity, auth, billing errors forwarded as-is
    • Empty/None/"Unknown error" → generic fallback
    • None vs explicit timeout parameter behavior
  • Local test: agent with 60s timeout → times out at 60s (not 120s)
  • Log confirms: Task execution timed out after 60 seconds

Fixes #221

…Code (#221)

The channel message router passed timeout_seconds=_get_channel_timeout()
(default 120s), overriding the agent's configured execution_timeout_seconds.
All other callers pass None and let TaskExecutionService read the per-agent
timeout (TIMEOUT-001).

- Pass timeout_seconds=None to match standard pattern
- Add TaskExecutionErrorCode enum for machine-readable error matching
- Set error_code=TIMEOUT on timeout results (only timeout for now)
- Add graceful timeout message for Slack users
- 13 unit tests: enum values, backward compat with all caller patterns

Fixes #221

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated via /validate-pr. Clean bug fix — removes hardcoded 120s Slack timeout in favor of per-agent configured timeout (TIMEOUT-001 pattern). Security checks pass, tests thorough, backward compatible.

@vybe
vybe merged commit 3a8b9c6 into main Mar 30, 2026
@pavshulin pavshulin changed the title fix: Slack message router uses per-agent timeout instead of hardcoded 120s (#221) fix: Slack message router uses per-agent timeout + forwards error messages (#221) Mar 30, 2026
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.

fix: Slack message router ignores per-agent execution timeout (TIMEOUT-001)

2 participants