--exec: a sub-agent that reaches max_iterations ends the whole run instead of handing back to its parent
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Start with pkg/runtime/agent_delegation.go to trace how child sessions inherit iteration and non-interactive settings, then read enforceMaxIterations in pkg/runtime/loop_steps.go and the --exec handling in pkg/cli/runner.go. Reproduce with the supplied team configuration and non-terminal stdin; confirm that a helper capped at one iteration returns control to the root, which then completes its run.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
In docker agent run --exec, a sub-agent that reaches its max_iterations ends the whole run. Its lead never gets control back, so the lead cannot finish, summarise or report what the sub-agent did. The run exits 0.
Versions: v1.152.0 and v1.161.0, Linux, stdin not a terminal (CI or an unattended job).
Steps to reproduce
The provider is an OpenAI-compatible stub that answers with tool calls.
agents:
root:
model: m
instruction: lead
max_iterations: 20
sub_agents: [helper]
helper:
model: m
instruction: helper
max_iterations: 1
toolsets:
- type: todo
- The root's first answer is
transfer_tasktohelper. - The helper answers with several
create_todoscalls, then text. - Run
docker agent run team.yaml --exec go </dev/null.
Result: one helper call, then
⚠️ Maximum iterations (1) reached. The agent may be stuck in a loop.
Do you want to continue for 10 more iterations? (y/n):
Failed to read input, exiting...
and exit 0. The root's next model call never happens.
With the helper at max_iterations: 0 (no cap), the helper finishes and the root gets transfer_task response → "…" as expected.
Why (from the source, v1.161.0)
- Each
transfer_taskstarts a child session with the sub-agent's own cap (pkg/runtime/agent_delegation.go,session.WithMaxIterations(childAgent.MaxIterations())). - In
enforceMaxIterations(pkg/runtime/loop_steps.go), aNonInteractivesession stops itself and appends "Execution stopped after reaching the configured max_iterations limit". For a sub-agent, that would return its turn to the lead. - The
--execCLI path never marks the sessionNonInteractive, andtransfer_taskcopies the parent's value. So theMaxIterationsReachedEventreaches the CLI runner (pkg/cli/runner.go). The runner prompts, the read fails without a terminal, and it callsrt.Resume(ResumeReject(""))andreturn nil, which ends the whole run.
Expected
In --exec with no terminal, a capped sub-agent stops and hands its turn back to its parent, as a NonInteractive session already does, instead of the CLI ending the run. Possible approaches:
- mark
--execsessionsNonInteractivewhen stdin is not a terminal; - or have the CLI, on a failed read, reject only the session that reached its cap.
--yolo avoids the prompt, but it also auto-approves every tool call, which an unattended run with a restricted permission set cannot accept.
Related: #4560 (the continuation increment).
- Ngôn ngữ chính
- Go
- Star
- 4.7k
- Fork
- 565
- Merge trung bình
- 18 giờ 52 phút
- Pull request đã merge (30 ngày)
- 221
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/docker-agent
-
edit_file diff rendering panics on invalid UTF-8 textCó thể đã có người làm @TDnorthgarden đã nhận hôm nay. Đang mởarea/tui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
docker/docker-agent#4955 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A setting to turn off the models.dev catalog download (offline and strict-network use)Có thể đã có người làm @3431481073 đã nhận 19 ngày trước. Đang mởarea/config area/models
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
docker/docker-agent#4714 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Error when trying to run sandbox example?Có thể đã có người làm @dgageot đã nhận 27 ngày trước. Đang mởarea/cli
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
docker/docker-agent#4672 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`edit_file` silently edits the first match when `oldText` occurs more than onceCó thể đã có người làm @dwin-gharibi đã nhận 103 ngày trước. Đang mởarea/tools
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
docker/docker-agent#3929 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/api area/runtime
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
docker/docker-agent#4951 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của docker/docker-agent
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OneBusAway/maglev#2145 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
priority/medium status/ready type/chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
discobox-ai/discobox#1357 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itCó thể đã có người làm @fzn0x đã nhận hôm nay. Đang mởbug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ui/ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jbigler/railswitch#243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Helm probes fail when DCGM Exporter requires TLS client certificatesCó thể đã có người làm @git-jxj đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NVIDIA/dcgm-exporter#775 ·
Maintainer thường phản hồi trong vòng 1 ngày