--exec: a sub-agent that reaches max_iterations ends the whole run instead of handing back to its parent
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 55/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- Go
- Étoiles
- 4.7k
- Forks
- 565
- Merge moyen
- 18 h 52 min
- PR mergées (30 j)
- 221
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de docker/docker-agent
-
edit_file diff rendering panics on invalid UTF-8 textPeut-être pris @TDnorthgarden l’a pris aujourd’hui. Ouvertearea/tui
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
docker/docker-agent#4955 ·
Les mainteneurs répondent en général sous 1 jour
-
A setting to turn off the models.dev catalog download (offline and strict-network use)Peut-être pris @3431481073 l’a pris il y a 19 jours. Ouvertearea/config area/models
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
docker/docker-agent#4714 ·
Les mainteneurs répondent en général sous 1 jour
-
Error when trying to run sandbox example?Peut-être pris @dgageot l’a pris il y a 27 jours. Ouvertearea/cli
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
docker/docker-agent#4672 · 1 commentaire · 1 réaction · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
`edit_file` silently edits the first match when `oldText` occurs more than oncePeut-être pris @dwin-gharibi l’a pris il y a 103 jours. Ouvertearea/tools
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
docker/docker-agent#3929 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
area/api area/runtime
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
docker/docker-agent#4951 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de docker/docker-agent
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
OneBusAway/maglev#2145 ·
Les mainteneurs répondent en général sous 2 jours
-
priority/medium status/ready type/chore
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
discobox-ai/discobox#1357 ·
Les mainteneurs répondent en général sous 1 jour
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itPeut-être pris @fzn0x l’a pris aujourd’hui. Ouvertebug priority: low
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement ui/ux
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
jbigler/railswitch#243 ·
Les mainteneurs répondent en général sous 1 jour
-
Helm probes fail when DCGM Exporter requires TLS client certificatesPeut-être pris @git-jxj l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
NVIDIA/dcgm-exporter#775 ·
Les mainteneurs répondent en général sous 1 jour