Skip to content

engine.max-turns is silently dropped when engine config is sourced from a shared import #26080

@yskopets

Description

@yskopets

Bug Report

Summary

When engine configuration (specifically max-turns) is moved into a shared import (.md file), the compiled .lock.yml file silently drops the --max-turns flag from the claude invocation. The workflow runs without the intended turn limit, defaulting to the engine's built-in default.

Steps to Reproduce

1. Create a shared import with engine config (shared/common.md):

---
engine:
  id: claude
  max-turns: 100
---

2. Import it in a workflow:

---
imports:
  - shared/common.md
---

3. Compile:

gh aw compile my-workflow.md

Expected Behavior

The compiled my-workflow.lock.yml should include --max-turns 100 in the claude invocation, just as it does when engine.max-turns is defined inline in the workflow.

Actual Behavior

The --max-turns flag is absent from the compiled lock file. No warning or error is emitted during compilation.

Comparison

Inline engine config (works correctly):

# my-workflow.md
engine:
  id: claude
  max-turns: 100

Compiled invocation:

claude --print ... --max-turns 100 ...

Engine config via shared import (broken):

# shared/common.md
engine:
  id: claude
  max-turns: 100

# my-workflow.md
imports:
  - shared/common.md

Compiled invocation:

claude --print ... (no --max-turns flag)

Impact

This is a silent failure — there is no compilation error or warning. Users refactoring engine configuration into shared imports will unknowingly lose their turn limit, which can lead to runaway agent jobs.

Environment

  • Compiler version: v0.65.7

Reported by Claude Code on behalf of the user.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions