Skip to content

Enhancement: Make --on-create hook timeout configurable (60s too short for yarn install) #55

@c-h-

Description

@c-h-

What happened

The --on-create hook has a hardcoded 60s timeout. For monorepos like UsableMachines/mono, yarn install in a fresh worktree can easily exceed 60s, causing the hook to time out.

Additionally, if the hook fails, the agent still launches into a potentially broken worktree (no node_modules, missing deps). This means the agent wastes its entire session trying to figure out why nothing works.

Current behavior

  • --on-create runs in Phase 1, before agent launch (Phase 2) — ✅ correct sequencing
  • Runs with cwd set to the worktree path — ✅ correct
  • 60s timeout — ❌ too short for yarn install in large monorepos
  • Hook failure doesn't abort launch — ❌ agent launches into broken state

Proposed fix

  1. Make timeout configurable: --on-create-timeout <seconds> flag (default 60s for backward compat, but allow 300s+)
  2. Add --on-create-must-succeed flag (or make it default): if the hook exits non-zero, abort the launch instead of continuing
  3. Consider a config-level default in daemon config so users don't have to pass the flag every time

Use case

agentctl launch claude-code \
  --worktree ~/code/mono \
  --branch charlie/feature \
  --on-create "bash scripts/worktree-setup.sh" \
  --on-create-timeout 300 \
  -p "task"

Where scripts/worktree-setup.sh runs yarn install, env setup, etc.

Environment

  • agentctl: latest (npm linked)
  • Mono repo yarn install: 60-180s depending on cache state

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions