Skip to content

Spec generation stuck in infinite loop - StructuredOutput tool never called #458

@vanclute

Description

@vanclute

Description

Spec generation gets stuck in an infinite loop where the internal Stop hook repeatedly demands the agent call a "StructuredOutput" tool, but the agent never does.

Environment

  • OS: Windows 11
  • Node.js: v22.17.1
  • Automaker: Latest (cloned fresh today, Jan 12 2026)
  • Authentication: Claude Code CLI OAuth (Max subscription)

Steps to Reproduce

  1. Fresh clone of automaker repo
  2. npm install
  3. npm run dev:electron
  4. Create a new project
  5. Attempt to generate a spec for any feature

Expected Behavior

Spec generation completes and produces a specification document.

Actual Behavior

The agent gets stuck in a loop. Server logs show repeated messages like:

[SpecRegeneration] User message (tool result): {
  "type": "user",
  "message": {
    "role": "user", 
    "content": [{
      "type": "text",
      "text": "Stop hook feedback:\nYou MUST call the StructuredOutput tool to complete this request. Call this tool now."
    }]
  },
  "isSynthetic": true
}

The isSynthetic: true indicates these are internal Automaker messages, not external hooks.

This loop continues indefinitely (tested 500+ iterations), accumulating text but never completing.

Investigation Notes

  • Initially suspected external Claude Code hooks were interfering
  • Completely disabled all external hooks (renamed ~/.claude/hooks folder)
  • Problem persists identically with no external hooks
  • The "Stop hook feedback" is internal to Automaker's spec regeneration flow
  • Agent receives text responses but never calls the StructuredOutput tool

Logs

Stream message count reaches 500+ with pattern:

  1. Assistant sends text response (~38 chars each iteration)
  2. Synthetic user message demands StructuredOutput tool call
  3. Repeat indefinitely

Total accumulated text grows (e.g., "total now: 8930 chars") but spec never completes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingNew IssueA label for reporting issues that have not been reported before after searching for the issue.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions