Skip to content

fix: Forward actual error messages to Slack users, remove unused TaskExecutionErrorCode (#221) - #229

Merged
vybe merged 2 commits into
mainfrom
feature/221-slack-timeout-fix
Mar 31, 2026
Merged

vybe merged 2 commits into
mainfrom
feature/221-slack-timeout-fix

Conversation

@pavshulin

@pavshulin pavshulin commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

Context

PR #225 (merged) fixed two things:

  1. Timeout fix: Changed timeout_seconds=_get_channel_timeout() (hardcoded 120s) to timeout_seconds=None — lets TaskExecutionService use the agent's configured timeout (TIMEOUT-001). This is already in main.
  2. Error codes: Added TaskExecutionErrorCode enum for machine-readable error matching.

Testing revealed that the timeout error originates from the agent container via HTTP response (caught by except httpx.HTTPError), not from httpx.TimeoutException — so error_code was always None at runtime. The enum approach doesn't work for this case.

This PR (follow-up cleanup to #225)

Removes the non-functional TaskExecutionErrorCode and simplifies error handling:

message_router.py

task_execution_service.py

  • Remove TaskExecutionErrorCode enum (6 values, only TIMEOUT was assigned, never reached at runtime)
  • Remove error_code field from TaskExecutionResult
  • Remove from enum import Enum import

Tests

  • Remove test_task_execution_error_code.py (237 lines testing the removed enum)
  • Add test_slack_timeout_fix.py (11 tests for the simplified error message logic + timeout parameter contract)

On raw error messages to Slack users

This is intentional. The previous hardcoded messages ("Sorry, I encountered an error") gave users zero information about what went wrong. The actual error from the agent (e.g. "Task execution timed out after 900 seconds", "Agent at capacity") is more useful. These are the same messages shown in the Trinity UI execution logs.

Test plan

Fixes #221

@pavshulin pavshulin changed the title Feature/221 slack timeout fix fix: Remove TaskExecutionErrorCode, forward actual error messages to Slack (#221) Mar 30, 2026
 Pavlo added 2 commits March 30, 2026 16:57
…sages (#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
- Forward actual error messages to Slack users instead of generic text
- Generic fallback only for empty/unknown errors
- 11 unit tests covering error message routing and timeout parameter

Fixes #221
@pavshulin
pavshulin force-pushed the feature/221-slack-timeout-fix branch from d0c5571 to ddec0a1 Compare March 30, 2026 15:58
@pavshulin pavshulin changed the title fix: Remove TaskExecutionErrorCode, forward actual error messages to Slack (#221) fix: Forward actual error messages to Slack users, remove unused TaskExecutionErrorCode (#221) Mar 30, 2026
@vybe
vybe merged commit ea4acaf into main Mar 31, 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