Skip to content

fix(chat): prevent silent launch failure on async task executions (#279) - #280

Merged
vybe merged 1 commit into
mainfrom
feature/279-fix-silent-launch-failure
Apr 7, 2026
Merged

vybe merged 1 commit into
mainfrom
feature/279-fix-silent-launch-failure

Conversation

@vybe

@vybe vybe commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Async background tasks in chat.py never called mark_execution_dispatched(), leaving claude_session_id NULL
  • The cleanup service then killed in-flight executions after 60s as "silent launch failures" even though the agent was still processing
  • Added mark_execution_dispatched() call before agent_post_with_retry() in the async path (matching the sync TaskExecutionService pattern)
  • Added add_done_callback() on the background task to log any silently swallowed exceptions

Changes

  • src/backend/routers/chat.py — 2 fixes in the async task dispatch path

Test Plan

  • Trigger async task from Chat UI → execution should NOT get killed by cleanup after 60s
  • Verify claude_session_id is set to 'dispatched' immediately after task is accepted
  • Kill backend mid-execution → cleanup should still catch genuinely orphaned executions (those that never reached dispatch)
  • MCP-triggered tasks continue to work (sync path unchanged)

Closes #279

Generated with Claude Code

Async background tasks never called mark_execution_dispatched(), leaving
claude_session_id NULL. The cleanup service then killed in-flight
executions after 60s as "silent launch failures" even though the agent
call was still running. Also adds a done callback on asyncio.create_task
to log any unhandled exceptions that would otherwise be silently swallowed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@vybe
vybe merged commit 2798ca9 into main Apr 7, 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.

bug: Chat-triggered executions fail with 'Silent launch failure' despite agent being healthy

1 participant