Skip to content

Agent: loop blocks on interactive skill prompts (writing-plans, finishing) #129

@federiconeri

Description

@federiconeri

Summary

Loop sessions block indefinitely when Claude Code skills produce interactive prompts that require user input, but no user is present in automated mode.

Problem / Context

During the second agent test, the loop got stuck twice:

  1. Planning session: superpowers:writing-plans skill outputs "Two execution options: 1. Subagent-Driven (this session) 2. Parallel Session (separate). Which approach?" — waits for user response
  2. Finish phase: superpowers:finishing-a-development-branch skill outputs "What would you like to do?" with merge/PR/cleanup options — waits for user response

Both prompts block the automated loop because Claude Code waits for stdin input that never comes.

Related to #93 (spec-aware skill injection engine).

Root Cause

  1. Skills loaded via Claude Code's skill system can contain interactive prompts
  2. RALPH_AUTOMATED=1 env var is set but skills don't check it
  3. The loop has no timeout mechanism to detect and recover from blocked sessions
  4. No mechanism to control which skills are available to loop sessions

Proposed Solution

Short-term (P0):

  • Add --allowedTools or skill blocklist to claude -p invocation in feature-loop.sh
  • Or: add CLAUDE.md instruction for the target project: "When RALPH_AUTOMATED=1, never invoke interactive skills"

Medium-term (P1, relates to #93):

  • Implement skill injection engine that controls which skills are available per phase
  • Planning phase: allow writing-plans but with --no-interactive mode
  • Implementation phase: allow test-driven-development only
  • PR phase: no skills needed

Long-term:

  • Claude Code session timeout mechanism in feature-loop.sh
  • Detect stalled sessions (no tool calls for N minutes) and kill/restart

Files to Modify

File Changes
src/agent/tools/execution.ts Add skill control flags to claude invocation
Ralph prompt templates Add RALPH_AUTOMATED awareness instructions

Acceptance Criteria

  • Loop sessions don't block on interactive skill prompts
  • Planning phase completes without "Which approach?" blocking
  • PR/finish phase completes without "What would you like to do?" blocking
  • Automated sessions skip or auto-answer interactive prompts

Metadata

Metadata

Assignees

Labels

ai/llmAI workflows, agents, promptsbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions