feat(code): configure Auto goal criteria acceptance - #4940
Merged
Conversation
…oast Remove the ``/goal accept`` and ``/goal edit`` redirect handler — the review prompt already exposes accept/edit actions, so the subcommands were a discoverability dead end that fell through to the objective path. Replace the per-mode breakdown in the ``/goal`` usage text with a concise description: dcode drafts a checklist and the goal persists once applied. The mode-specific behavior is discoverable through the app and the first-run preference screen. Drop the "Goal criteria automatically accepted without manual review." toast from ``_accept_goal_rubric``. YOLO's contract is no prompts, and opted-in Auto users already know they opted in — the toast was noise for both.
Keep bare `/goal` usage tips while slimmining empty `/goal show`, short-circuit no-op amend/clear, and brand goal grader model settings more clearly.
Ask only on create/amend so launch onboarding is not taxed for an unused preference, and let already-onboarded users still set Auto behavior on first use.
Suppress the deferred one-time preference via env in unit tests instead of writing a marker under tmp_path, which broke git empty-tree and dirty-count asserts.
Address PR review findings on the Auto goal-criteria acceptance flow: - Only prompt for the preference in Auto mode. The choice has no effect in Manual (always reviews) or YOLO (always applies), so non-Auto users are no longer asked about an Auto-only setting; they are prompted the first time they act on a goal after switching to Auto. - Dismiss the preference modal left mounted after a watchdog timeout or mount failure so it cannot linger over goal drafting. Cleanup only pops the modal when it is still the current screen, since dismiss() pops the top screen. - Log a warning when the `goals.auto_accept_criteria` manifest entry is missing before failing closed, so a manifest regression that silently ignores a saved preference leaves a trail instead of going dark. - Correct the partial-write warning copy: a saved preference with a failed one-time marker still applies and will not re-prompt. - Clarify the env-var docstring's fallthrough chain (config.toml, then the built-in disabled default). Tests: cover the manifest-unavailable fail-closed branch, the timeout and mount-failure fail-closed paths, the Auto-only prompt gate, and the orphaned- modal cleanup helper (both current and never-mounted screens).
- wrap over-length grader-clear assertion (E501) - assert an explicit SDK-default cap is distinct from unset: re-issuing reports "already set to N" and clearing still respawns - assert the bare "startup chat model" label (no suffix) at the model selector and already-default no-op sites for goal and rubric sources - clarify _startup_chat_model_label docstring on when the value is re-captured (startup retry) vs left untouched (live /model override)
Mason Daugherty (mdrxy)
pushed a commit
that referenced
this pull request
Jul 24, 2026
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.46](deepagents-code==0.1.45...deepagents-code==0.1.46) (2026-07-24) ### Highlights - Auto mode is now generally available. [#4957](#4957) - Added configurable Auto goal-criteria acceptance. [#4940](#4940) - Improved Auto behavior by authorizing actions from active goal/rubric directives, avoiding redundant approval prompts, showing the enable notice only on first global enable, deduplicating classifier-unavailable transcript spam, logging underlying classifier failures, and reporting classifier timeout budgets. [#5017](#5017) [#4993](#4993) [#5012](#5012) [#5013](#5013) [#5011](#5011) [#5025](#5025) - Added Hooks v2 capability snapshots and session transcripts, and hardened Hooks v2 command execution. [#4916](#4916) [#4918](#4918) [#4917](#4917) - Raised the agent recursion limit to 2000 and made it configurable. [#4994](#4994) ### Improvements and fixes - Let the rubric grader inspect working-directory files, show rubric grader defaults, and improved `/rubric` help and empty-state messaging. [#4835](#4835) [#4966](#4966) [#5015](#5015) - Unified goal activation signaling. [#4980](#4980) - Made Version, Model, and CWD copyable in the Debug Console. [#4975](#4975) - Improved `config get` output when a key is missing. [#4976](#4976) - Aborted YOLO launch on `Ctrl+C`/`Ctrl+D` and made the YOLO warning friendlier for new users. [#4953](#4953) [#4950](#4950) - Updated LangSmith handling: secret redaction is disabled by default, `/trace` now flags empty env overrides that shadow the LangSmith key, and the default US endpoint is no longer treated as a custom target. [#4970](#4970) [#4996](#4996) [#5022](#5022) - Injected OpenAI `prompt_cache_key` for any OpenAI-provider endpoint. [#4995](#4995) - Improved tool and schema presentation: finished calls stay on the live tool-group line, first-party tool schemas now include field descriptions, and `web_search`/`fetch_url` tool descriptions were trimmed. [#4927](#4927) [#5019](#5019) [#5016](#5016) - Omitted `plugins/` and `conversation_history/` from the `/agent` picker. [#4991](#4991) - Made selector modal backdrop dimming consistent. [#4990](#4990) - Restored the `"Server log preserved at:"` notice on exit. [#4999](#4999) - Used the SDK pin as the effective editable version. [#4949](#4949) _End release notes preview._ --- > [!NOTE] > A **New Contributors** section is appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 2). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.com>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
Auto mode now reviews generated goal acceptance criteria by default, while users who prefer uninterrupted goal setup can opt into applying them automatically. Manual mode always reviews and YOLO remains automatic. --- Users who have not already configured a preference see a one-time selector the first time they create or amend a goal **in Auto mode**: - **Review before applying** is recommended and preselected. - **Apply automatically in Auto mode** enables the uninterrupted flow. A Manual or YOLO user is prompted the first time they create or amend a goal after switching to Auto. Explicit environment or TOML settings suppress the selector, and a versioned state marker prevents it from reappearing once answered. Configure the Auto-mode preference in `~/.deepagents/config.toml`: ```toml [goals] auto_accept_criteria = true ``` Or set `DEEPAGENTS_CODE_GOAL_AUTO_ACCEPT_CRITERIA=true`. The environment variable takes precedence over TOML, invalid environment values fall through to TOML and then the safe `false` default, and the preference is resolved live on each proposal decision—so file or environment edits apply the next time a goal proposal is created, amended, regenerated, restored, or mode-resolved, not only after relaunch. If the preference cannot be resolved, it fails closed to review and logs. New, amended, regenerated, restored, and mode-transitioned goal proposals all resolve through the same live policy so the selected behavior is consistent throughout the session. <details> <summary>Example: Manual user later switches to Auto</summary> 1. Mason works in Manual and runs `/goal ship OAuth`. No preference selector appears, because the setting only affects Auto. 2. Later he enables Auto, then runs `/goal add refresh tokens` or `/goal amend include passkeys`. 3. Because Auto still has the built-in default and no marker, he gets the one-time selector with **Review before applying** preselected. 4. His choice is saved to `config.toml` and the versioned marker is set so the prompt does not return. </details> <details> <summary>Example: File edit takes effect on the next proposal decision</summary> 1. Mason is already in Auto with review selected. 2. In another editor he sets `auto_accept_criteria = true` in `~/.deepagents/config.toml`. 3. Nothing changes immediately. 4. On the next create, amend, regenerate, restore, or mode-resolution of a goal proposal, dcode re-reads the preference and auto-applies. </details> <details> <summary>Example: Same live policy across proposal paths</summary> - **New:** `/goal ship login` drafts criteria and either reviews or auto-applies under the current Auto/YOLO policy. - **Amended:** `/goal amend also require passkeys` regenerates the checklist and resolves it the same way. - **Regenerated:** feedback on an open review produces a new proposal that uses the policy in effect when it arrives. - **Restored:** resuming a thread with a pending proposal resolves that pending state through the same gate. - **Mode-transitioned:** enabling Auto or YOLO with a mounted review re-resolves that pending proposal immediately under the live policy. </details> --- Other nits: * Removed `/goal accept` and `/goal edit` subcommands. These were redirect-only handlers that pointed users to the inline review prompt; the review prompt's own keybindings are the real actions, so the subcommands were a discoverability dead end. * Simplified the `/goal` usage text to describe what `/goal` does rather than enumerating per-mode behavior. The mode-specific behavior is discoverable through the app and the first-run preference screen. * Removed the "Goal criteria automatically accepted without manual review." toast that fired on auto-accepted proposals. YOLO's contract is no prompts, and opted-in Auto users already know they opted in, so the toast was noise for both.
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.46](langchain-ai/deepagents@deepagents-code==0.1.45...deepagents-code==0.1.46) (2026-07-24) ### Highlights - Auto mode is now generally available. [langchain-ai#4957](langchain-ai#4957) - Added configurable Auto goal-criteria acceptance. [langchain-ai#4940](langchain-ai#4940) - Improved Auto behavior by authorizing actions from active goal/rubric directives, avoiding redundant approval prompts, showing the enable notice only on first global enable, deduplicating classifier-unavailable transcript spam, logging underlying classifier failures, and reporting classifier timeout budgets. [langchain-ai#5017](langchain-ai#5017) [langchain-ai#4993](langchain-ai#4993) [langchain-ai#5012](langchain-ai#5012) [langchain-ai#5013](langchain-ai#5013) [langchain-ai#5011](langchain-ai#5011) [langchain-ai#5025](langchain-ai#5025) - Added Hooks v2 capability snapshots and session transcripts, and hardened Hooks v2 command execution. [langchain-ai#4916](langchain-ai#4916) [langchain-ai#4918](langchain-ai#4918) [langchain-ai#4917](langchain-ai#4917) - Raised the agent recursion limit to 2000 and made it configurable. [langchain-ai#4994](langchain-ai#4994) ### Improvements and fixes - Let the rubric grader inspect working-directory files, show rubric grader defaults, and improved `/rubric` help and empty-state messaging. [langchain-ai#4835](langchain-ai#4835) [langchain-ai#4966](langchain-ai#4966) [langchain-ai#5015](langchain-ai#5015) - Unified goal activation signaling. [langchain-ai#4980](langchain-ai#4980) - Made Version, Model, and CWD copyable in the Debug Console. [langchain-ai#4975](langchain-ai#4975) - Improved `config get` output when a key is missing. [langchain-ai#4976](langchain-ai#4976) - Aborted YOLO launch on `Ctrl+C`/`Ctrl+D` and made the YOLO warning friendlier for new users. [langchain-ai#4953](langchain-ai#4953) [langchain-ai#4950](langchain-ai#4950) - Updated LangSmith handling: secret redaction is disabled by default, `/trace` now flags empty env overrides that shadow the LangSmith key, and the default US endpoint is no longer treated as a custom target. [langchain-ai#4970](langchain-ai#4970) [langchain-ai#4996](langchain-ai#4996) [langchain-ai#5022](langchain-ai#5022) - Injected OpenAI `prompt_cache_key` for any OpenAI-provider endpoint. [langchain-ai#4995](langchain-ai#4995) - Improved tool and schema presentation: finished calls stay on the live tool-group line, first-party tool schemas now include field descriptions, and `web_search`/`fetch_url` tool descriptions were trimmed. [langchain-ai#4927](langchain-ai#4927) [langchain-ai#5019](langchain-ai#5019) [langchain-ai#5016](langchain-ai#5016) - Omitted `plugins/` and `conversation_history/` from the `/agent` picker. [langchain-ai#4991](langchain-ai#4991) - Made selector modal backdrop dimming consistent. [langchain-ai#4990](langchain-ai#4990) - Restored the `"Server log preserved at:"` notice on exit. [langchain-ai#4999](langchain-ai#4999) - Used the SDK pin as the effective editable version. [langchain-ai#4949](langchain-ai#4949) _End release notes preview._ --- > [!NOTE] > A **New Contributors** section is appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 2). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto mode now reviews generated goal acceptance criteria by default, while users who prefer uninterrupted goal setup can opt into applying them automatically. Manual mode always reviews and YOLO remains automatic.
Users who have not already configured a preference see a one-time selector the first time they create or amend a goal in Auto mode:
A Manual or YOLO user is prompted the first time they create or amend a goal after switching to Auto. Explicit environment or TOML settings suppress the selector, and a versioned state marker prevents it from reappearing once answered.
Configure the Auto-mode preference in
~/.deepagents/config.toml:Or set
DEEPAGENTS_CODE_GOAL_AUTO_ACCEPT_CRITERIA=true. The environment variable takes precedence over TOML, invalid environment values fall through to TOML and then the safefalsedefault, and the preference is resolved live on each proposal decision—so file or environment edits apply the next time a goal proposal is created, amended, regenerated, restored, or mode-resolved, not only after relaunch. If the preference cannot be resolved, it fails closed to review and logs.New, amended, regenerated, restored, and mode-transitioned goal proposals all resolve through the same live policy so the selected behavior is consistent throughout the session.
Example: Manual user later switches to Auto
/goal ship OAuth. No preference selector appears, because the setting only affects Auto./goal add refresh tokensor/goal amend include passkeys.config.tomland the versioned marker is set so the prompt does not return.Example: File edit takes effect on the next proposal decision
auto_accept_criteria = truein~/.deepagents/config.toml.Example: Same live policy across proposal paths
/goal ship logindrafts criteria and either reviews or auto-applies under the current Auto/YOLO policy./goal amend also require passkeysregenerates the checklist and resolves it the same way.Other nits:
/goal acceptand/goal editsubcommands. These were redirect-only handlers that pointed users to the inline review prompt; the review prompt's own keybindings are the real actions, so the subcommands were a discoverability dead end./goalusage text to describe what/goaldoes rather than enumerating per-mode behavior. The mode-specific behavior is discoverable through the app and the first-run preference screen.