Skip to content

workflow: subagent bash commands hang indefinitely when codedb refuses cwd, causing ~48min timeout #93

Description

@yxlyx

Summary

When using the workflow tool with ultracode mode in a non-git home directory, subagent bash commands hang for extremely long periods (~48 minutes) before erroring out, causing the workflow to fail.

Steps to Reproduce

  1. Run the harness from a non-git home directory (e.g., ~/)
  2. Trigger ultracode mode with a prompt that causes the harness to dispatch a workflow with subagents
  3. Subagents try codedb searches, which fail with: ✗ refusing to index temporary root: /Users/limyuxi
  4. Subagents fall back to bash grep commands on the home directory

Observed Behavior (from harness.trace.jsonl)

t=52353  codedb → 53 bytes (empty/refusal)
t=52353  codedb → 53 bytes (empty/refusal)  
... (all codedb calls return refusal)
t=104850 bash → 131KB result (47s)
t=111838 bash → 7KB result (18ms)
t=355561 bash → ERROR (131KB, 243s)
t=2990381 bash → ERROR (24 bytes, 2878s / ~48min)
t=2990439 bash → ERROR (24 bytes, 2878s)
t=2990451 bash → ERROR (131KB, 2936s / ~49min)
t=2990532 bash → ERROR (131KB, 2936s)

Impact

  • Workflow phase 1 subagents both reported ok: false
  • Phase 2 synthesis task never ran (ms: 0)
  • Main turn ended with "detail": "Interrupted"
  • Total wasted time: ~49 minutes

Suspected Root Cause

  1. Subagents don't have a reasonable timeout for bash commands
  2. When codedb refuses to index the cwd, subagents fall back to unfiltered grep on the entire home directory which scans massive amounts of data
  3. No early termination or escalation path when codedb repeatedly fails

Relevant Files

  • src/main.zig — subagent spawning and bash command execution
  • src/main.zig:2799 and :2804 — thinking animation lines (tangentially related to user's original request)

Trajectory Logs

Full trajectory available at:

  • harness.trace.jsonl (23 events)
  • harness.trajectory.jsonl (same directory)

Session version: 0.0.167
Harness version: simple-harness sdk-v0.3.1-34-g0418fa1-dirty

Suggested Fix

  1. Add a configurable/default timeout for subagent bash commands (e.g., 60s)
  2. When codedb returns a refusal, subagents should report the error immediately instead of falling back to expensive unfiltered grep
  3. Consider whitelisting safe cwd paths or providing a clearer error when codedb cannot index the current directory

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions