ALEF-PAT-021

output-schema-no-loop-exit

execute × collapse · severity 7 · confidence 0.31

model voluntarily calls the structured-output tool but the agent loop treats it as "continue" and re-prompts — model calls the tool again, infinite loop

diagnosed in the wild

·

loading…

healed by ALEF

·

loading…

cited in posts

·

loading…

observable signature

{
  "behavior": "stopReason=toolUse AND tool.name==structured_output_tool AND loop continues"
}

verified instances (1) — from the catalog

fix archetypes

  • terminate-on-structured-toolcost: tiny

    if last tool call name == structured_output_tool, finalize(tool.input); do not re-prompt

compounds with

cite as

# In a PR description / issue / RFC:
fixes pattern ALEF-PAT-021 (output-schema-no-loop-exit)
ref: https://n50.io/patterns/021

# Machine query:
GET https://n50.io/api/patterns/021

# Scan your repo for this pattern:
npx @alef-prime/audit-agent-system . --pattern=021