Document harness safety and first-run push-back
Merged
YO
3d ago+84+84+01234567890123456789-3-3-0123456789
Summary
Closes dagucloud/dagu#3616 and dagucloud/dagu#3617.
The reference pages behind the Agent Loops guides were missing three things that real agent runs turned up.
- Model output in shell commands (quoting page): which
runpositions are unsafe, withenvas the fix, and whatdagu validatenow warns about. - Agent configuration on the host (harness page): agent CLIs load the personal config of the account running Dagu. It covers a dedicated account,
setting_sources, andCODEX_HOME, and warns that Claude Code'sbareflag cannot use a subscription login, perclaude --help. - Push-back on a first run (human-in-the-loop, harness, and outer-loop pages): a step first running after a push-back keeps its prompt, and reads the feedback only from its environment.
The inner-loop page also gains a line on the repeat count in dagu status.
Merge order
This describes behaviour in dagucloud/dagu#3619, #3620, and #3621, so it should merge after them.
Verification
pnpm validate:exampleswith a build of those branches, andpnpm build.- The unsafe
runtable was tested with a stub agent, for each position and payload. CODEX_HOMEwas tested with a real Codex run, withauth.jsonlinked into a separate directory.setting_sourceswas tested with a real Claude Code run. The harness page states only that it leaves out user settings, because I could not confirm that it also excludes a globalCLAUDE.md.
Summary by cubic
Documents three gaps real agent runs surfaced in the agent loop reference pages, and follows two product changes.
Changes
- Quoting page: no way of quoting model output in
runis safe; pass it throughenvand read it per context —"$SUMMARY"only in a local POSIX/Nix shell,printenvin containers, and the language API under other interpreters. NUL bytes cannot go throughenv, anddagu validatewarns on model output in shell commands, except for validation-limited fields. Links the loop pages to this guidance. - Harness page: agent CLIs load the personal config of the account running Dagu; narrow it with
setting_sourcesorCODEX_HOME, and note Claude Code'sbareflag can't use a subscription login. - Loop pages and human-in-the-loop: a step first running after a push-back keeps its prompt and reads feedback only from its environment; reference it in the prompt when the model needs it.
- Inner-loop page:
dagu statusshows the repeat count.
This describes behavior in dagucloud/dagu#3619, #3620, and #3621, so it should merge after them.
Summary by CodeRabbit
- Documentation
- Clarified how
dagu statusreports repeat-step attempts and how push-back feedback is provided to steps that run afterward. - Added guidance on configuring built-in CLI agents, including which settings and authentication methods they use.
- Expanded shell-safety guidance for model-generated output, with an example using environment variables. Documented when
dagu validatewarns about model-generated values used in shell commands.
- Clarified how