Skip to content

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

Closed

Description

@vybe

Summary

Executions triggered from the Chat UI fail with "Silent launch failure: no Claude session created within 60 seconds" even though the agent container is healthy, reachable, and has available capacity. The user sees the execution start in the UI (status changes to "running"), but no Claude session is ever created. The cleanup service eventually marks it as failed. Simple MCP-triggered tasks (e.g. a ping) succeed on the same agent moments before/after the failure.

Component

Backend / Chat Router / Execution Dispatch

Priority

P2

Error

Silent launch failure: no Claude session created within 60 seconds

Backend log shows the slot is acquired and background task starts, but no further activity:

[Slots] Agent 'agent-name' acquired slot 1/3 for execution EXEC_ID (TTL=1200s)
[Task Async] Started background task for agent 'agent-name', execution_id=EXEC_ID

No subsequent session creation, no error logged — the execution simply goes silent until the cleanup service kills it.

Observed Behavior

Timeline from a real incident (all times UTC):

  1. 16:31:40 — MCP ping task dispatched → succeeds in 8.5s (proves agent is healthy)
  2. 16:32:49 — Chat /repurpose task dispatched → slot acquired, background task started
  3. No further logs — no Claude session created, no error, no communication with agent container
  4. 16:38:15 — Cleanup service marks execution as failed: "no Claude session created within 60 seconds"
  5. 16:40:25 — Same task retried from Chat → succeeds (session created, model set)

The failed execution had claude_session_id: null and model_used: null. The successful retry had claude_session_id: "dispatched" and model_used: "claude-opus-4-5-20251101".

Reproduction Steps

  1. Have an agent running with available capacity slots
  2. Verify agent is healthy (MCP ping succeeds)
  3. Send a task from the Chat UI (especially a longer/complex task)
  4. Observe execution enters "running" state in the UI
  5. Wait 60+ seconds — execution fails with "Silent launch failure"
  6. Retry the same task — it may succeed on the next attempt

This is intermittent. In one session, 10 out of 11 executions failed this way. After agent container restart, the first Chat-triggered task failed but the second succeeded.

Root Cause

Investigation needed. The background task created by [Task Async] silently fails to communicate with the agent container's agent-server. No error is logged, suggesting the HTTP call to the agent container either hangs indefinitely or fails without being caught.

Possible causes:

  • The async background task loses its HTTP connection context
  • Agent-server inside the container is not ready or drops the connection
  • Chat-specific dispatch path differs from MCP dispatch in a way that causes silent failures
  • Race condition in the execution dispatch — task is queued but never actually sent to the agent

Suggested Fix

Investigation needed. Key areas to check:

  1. Chat dispatch path (routers/chat.py) — compare with MCP dispatch path to find differences
  2. Background task error handling — ensure exceptions in the async task are caught and logged
  3. Agent-server communication — add timeout and retry logic for the HTTP call to the agent container
  4. Session creation tracking — log explicitly when the backend attempts to create a Claude session and what response it gets

At minimum, the background task should log an error if it fails to communicate with the agent container, rather than silently dying.

Impact

  • Users see executions "start" but silently fail — confusing UX
  • Failed executions hold capacity slots until cleanup (up to 60s+ delay)
  • Users retry repeatedly, filling all slots, making the agent appear completely stuck
  • In the observed incident, 10 consecutive failures caused the agent to be at capacity (3/3) with no real work running

Environment

  • Trinity version: bc36011
  • Agent container: healthy, running, reachable (131ms latency)
  • Auth: subscription (OAuth) + API key

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p2type-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions