loadCliConfig: --dry-run still resolves systemPrompt {{include:...}} macros even though the agent is replaced
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 2
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 joewalker/loop-the-loop
-
bug S4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal informationĐang mởbug S3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
joewalker/loop-the-loop#79 ·
Tất cả issue của joewalker/loop-the-loop
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
caelestia-dots/caelestia#534 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bobadilla-tech/biasmarket.com#402 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
javvadivijayprasad/sel2pw#28 ·
-
Area: Infrastructure Chore Difficulty: Low Good First Issue Priority: Low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
DouglasNeuroInformatics/OpenDataCapture#1836 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Two wording fixes: the init PROVIDER comment and the confirm page's ledeCó thể đã có người làm @kurtbruns đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày