mirror of
https://github.com/langchain-ai/deepagents.git
synced 2026-07-25 21:06:10 -04:00
d88601ed58
Auto-approve ("YOLO") runs are now labeled with
`dcode_auto_approve=True` in LangSmith trace metadata, making them
filterable.
---
Auto-approve ("YOLO") mode — the `Shift+Tab` toggle / `--auto-approve` —
sets `interrupt_on = {}` so tools run with no HITL gate, but nothing
recorded that state in LangSmith traces, so YOLO runs weren't
filterable. The `coding-agent-v1` contract's `approval_policy` key can't
help here: it's scoped to root/interrupted runs and would leak onto
every descendant run (and fail contract validation) if stamped
trace-wide.
This adds a non-contract diagnostic `dcode_auto_approve=True` metadata
key in `build_stream_config`, mirroring the existing
`dcode_experimental` pattern (only stamped when active). Interactive
turns pass `session_state.auto_approve`; headless turns pass the
resolved `use_auto_approve` (which reflects "tools run without HITL
because shell is unrestricted or disabled" — the same `auto_approve`
flag the graph consumes). Metadata is sampled once at turn start, so a
mid-turn toggle doesn't relabel that turn's trace.
New keyword-only `auto_approve` param defaults to `False`, so the change
is additive and backward-compatible.
Made by [Open
SWE](https://openswe.vercel.app/agents/31881cb9-2c33-7505-1b1a-fd453e84ea5a)
## References
- Plan:
https://openswe.vercel.app/agents/31881cb9-2c33-7505-1b1a-fd453e84ea5a/plan
---------
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>