loadCliConfig: --dry-run still resolves systemPrompt {{include:...}} macros even though the agent is replaced
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- cli
Línea de trabajo
Start at loadCliConfig and trace its calls to normalizeCliConfig, normalizeAgentSpec, and expandIncludes. Verify the dry-run path replaces the configured agent before unnecessary systemPrompt includes are resolved. Done means the provided missing-include reproduction runs successfully with --dry-run while normal agent normalization still works outside dry-run.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Observed behavior
loadCliConfig always runs normalizeCliConfig (and through it normalizeAgentSpec) before applying the --dry-run override that replaces the configured agent with DRY_RUN_AGENT_SPEC. normalizeAgentSpec awaits expandIncludes for any systemPrompt on a claude-sdk or openai-sdk agent spec. If the referenced include file does not exist, --dry-run fails with a low-level ENOENT even though the agent spec is about to be thrown away.
Reproduction with a missing include and --dry-run:
FAILED: ENOENT: no such file or directory, open '/tmp/dryrun-test-XXXXXX/does-not-exist.md'
The failing config:
{
"name": "test",
"agent": ["claude-sdk", { "systemPrompt": "{{include:./does-not-exist.md}}" }],
"promptGenerator": ["test", { "prompts": ["hi"] }]
}
The order in loadCliConfig is:
return {
...(await normalizeCliConfig(config, resolvedPath)), // expands systemPrompt includes here
...(maxPrompts !== undefined ? { maxPrompts } : {}),
...(verbose === true || dryRun === true ? { logger: 'verbose' as const } : {}),
...(dryRun === true ? { agent: DRY_RUN_AGENT_SPEC } : {}), // agent thrown away here
};
Expected behavior
When --dry-run is set the agent is replaced with DRY_RUN_AGENT_SPEC, so the configured agent's systemPrompt is never sent to a backend. A user iterating on a config (where the include file may not yet exist, or the path is being edited) should be able to use --dry-run to validate the prompt generator without also having to make the agent's systemPrompt includes resolve.
Today --dry-run does noticeably more work than necessary (reads include files from disk) and, more importantly, spuriously fails when a path that will never be used is broken.
Minimal reproduction
mkdir /tmp/loop-dry && cd /tmp/loop-dry
cat > config.json <<'JSON'
{
"name": "test",
"agent": ["claude-sdk", { "systemPrompt": "{{include:./missing.md}}" }],
"promptGenerator": ["test", { "prompts": ["hi"] }]
}
JSON
loop-the-loop --dry-run config.json
Result: fails with ENOENT: no such file or directory, open '/tmp/loop-dry/missing.md' instead of running a dry run.
Suggested fix
Short-circuit the agent normalization when dryRun is true. The simplest approach is to skip normalizeAgentSpec (or pass through config.agent unchanged) when parsedArgs.dryRun === true, since the agent will be replaced by DRY_RUN_AGENT_SPEC immediately afterwards. For example, inline the dry-run branch in loadCliConfig before calling normalizeCliConfig, or have normalizeCliConfig accept an optional flag that skips the agent step.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 1
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de joewalker/loop-the-loop
-
bug S4
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal informationAbiertobug S3
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
joewalker/loop-the-loop#79 ·
Todos los issues de joewalker/loop-the-loop
Issues similares
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Japan Fact 898 (good-first-issue)Abiertocommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
lingdojo/kana-dojo#33145 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
code-yeongyu/senpi#4278 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Activity | The activity list ignores taskIds and returns the activities of every taskPosiblemente ocupada @NdekoCode la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ever-co/ever-gauzy#11469 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
griffinwork40/agent-afk#4408 ·
Los mantenedores suelen responder en 1 día