Skip to content

feat(code): move /goal criteria generation server-side - #4754

Merged
Mason Daugherty (mdrxy) merged 11 commits into
mainfrom
mdrxy/code/server-side-goal-criteria
Jul 15, 2026
Merged

feat(code): move /goal criteria generation server-side#4754
Mason Daugherty (mdrxy) merged 11 commits into
mainfrom
mdrxy/code/server-side-goal-criteria

Conversation

@mdrxy

@mdrxy Mason Daugherty (mdrxy) commented Jul 15, 2026

Copy link
Copy Markdown
Member

/goal acceptance-criteria drafting now runs on the agent server and can use conversation, repository, web, and explicitly read-only configured MCP context while preserving resumable review state.


Previously, /goal proposals were drafted in the client process from the explicit objective, so remote or sandbox repository context and references to the current conversation were unavailable. This moves proposal and amendment drafting into a nested agent in the main server graph, where it can use recent conversation context, bounded read-only repository search, fetch_url, optional web search, and configured MCP tools explicitly annotated as read-only.

Repository context remains read-only and repository-rooted across backends: local reads use a virtual project root, while sandbox reads are constrained to the provider's declared working directory, including canonical-path checks that reject symlink escapes.

Proposals are stored as pending checkpoint state rather than chat messages, so review survives remote interrupts and resumes without polluting the coding conversation. Each proposal is correlated with its originating request, and criteria requests are cleared after success, failure, or cancellation without clearing newer requests. Cancelling criteria generation stops the server run without adding normal chat-interruption messages. The client refreshes checkpoint state after generation and reuses the existing accept, edit, and reject flow; model profile overrides now cross the client/server boundary consistently.

@github-actions github-actions Bot added dcode Related to `deepagents-code` feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization size: XL 1000+ LOC labels Jul 15, 2026

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/code/deepagents_code/agent.py Outdated
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Jul 15, 2026
@mdrxy

Copy link
Copy Markdown
Member Author

Future direction, not a blocker for this PR: if dcode adds more server-side operations like /offload, consider extracting these non-chat workflows behind a small, explicit operations protocol rather than adding more command channels to the main conversation graph.

That could be a separate operations graph using the standard LangGraph run APIs, with a versioned request/result envelope containing an operation ID, source conversation thread ID, operation type, payload, status, result, and error. Each operation would run on its own thread/run, so results and cancellation are correlated without using chat messages or conversation-state fields as transport. The operations graph and agent graph could share the same cached model, repository/sandbox backend, MCP sessions, and tool policy.

The criteria agent introduced here should remain reusable in that design; only its transport and lifecycle ownership would move. I would wait until there is a second operation that needs the abstraction rather than generalizing prematurely.

@mdrxy

Copy link
Copy Markdown
Member Author

Follow-up to the future direction above: /offload is already the concrete second server-side operation that would justify this refactor.

Today the Textual client synthesizes a compact_conversation tool call, updates thread state, approves the resulting interrupt, drains the run, and handles reconciliation and cleanup. A follow-up should move that lifecycle behind the same kind of typed, server-owned operation boundary: the client submits an offload request through the normal server API, the server performs compaction and persists the result, and the client only renders the outcome.

That would give us the second real use case needed to design the shared operations protocol around observed requirements rather than generalizing this PR prematurely. Still not a blocker or scope expansion for this PR; /offload should be the next migration that drives the abstraction.

@mdrxy
Mason Daugherty (mdrxy) merged commit 9fdd498 into main Jul 15, 2026
72 checks passed
@mdrxy
Mason Daugherty (mdrxy) deleted the mdrxy/code/server-side-goal-criteria branch July 15, 2026 21:17
Mason Daugherty (mdrxy) pushed a commit that referenced this pull request Jul 16, 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.40](deepagents-code==0.1.39...deepagents-code==0.1.40)
(2026-07-16)

### Features

- Added plugin marketplace support
([#4554](#4554)).
- Added an “always allow” option to the project MCP approval prompt
([#4562](#4562)).
- Improved `/goal` workflows: criteria generation now runs server-side,
YOLO mode auto-accepts criteria, goals complete after satisfied grading,
and goal review editing now supports `Ctrl+X`
([#4754](#4754),
[#4784](#4784),
[#4781](#4781),
[#4780](#4780)).
- Reasoning effort now persists across restarts
([#4728](#4728)).
- Added a toast prompting you to re-paste when a chat paste collapses
([#4742](#4742)).

### Bug Fixes

- Tool calls awaiting approval are now surfaced correctly
([#4739](#4739)).
- Fixed transcript tail hydration when scrolled to the bottom edge
([#4733](#4733)).
- Kept chat input responsive during MCP viewer `Ctrl+R` reconnects
([#4753](#4753)).
- Improved inline free-text prompts by sharing paste handling and
matching primary-input `Ctrl+D` behavior
([#4736](#4736),
[#4729](#4729)).
- Fixed local offloaded tool results to use the real filesystem
([#4740](#4740)).
- Cleaned offloaded history when deleting a thread
([#4751](#4751)).
- Removed duplicated content from the system prompt by overwriting the
base prompt
([#4516](#4516)).
- Closed subprocess transport during install teardown
([#4735](#4735)).
- Added targeted `uv` constraints for prerelease dependencies
([#4744](#4744)).

_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
…i#4754)

`/goal` acceptance-criteria drafting now runs on the agent server and
can use conversation, repository, web, and explicitly read-only
configured MCP context while preserving resumable review state.

---

Previously, `/goal` proposals were drafted in the client process from
the explicit objective, so remote or sandbox repository context and
references to the current conversation were unavailable. This moves
proposal and amendment drafting into a nested agent in the main server
graph, where it can use recent conversation context, bounded read-only
repository search, `fetch_url`, optional web search, and configured MCP
tools explicitly annotated as read-only.

Repository context remains read-only and repository-rooted across
backends: local reads use a virtual project root, while sandbox reads
are constrained to the provider's declared working directory, including
canonical-path checks that reject symlink escapes.

Proposals are stored as pending checkpoint state rather than chat
messages, so review survives remote interrupts and resumes without
polluting the coding conversation. Each proposal is correlated with its
originating request, and criteria requests are cleared after success,
failure, or cancellation without clearing newer requests. Cancelling
criteria generation stops the server run without adding normal
chat-interruption messages. The client refreshes checkpoint state after
generation and reuses the existing accept, edit, and reject flow; model
profile overrides now cross the client/server boundary consistently.
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.40](langchain-ai/deepagents@deepagents-code==0.1.39...deepagents-code==0.1.40)
(2026-07-16)

### Features

- Added plugin marketplace support
([langchain-ai#4554](langchain-ai#4554)).
- Added an “always allow” option to the project MCP approval prompt
([langchain-ai#4562](langchain-ai#4562)).
- Improved `/goal` workflows: criteria generation now runs server-side,
YOLO mode auto-accepts criteria, goals complete after satisfied grading,
and goal review editing now supports `Ctrl+X`
([langchain-ai#4754](langchain-ai#4754),
[langchain-ai#4784](langchain-ai#4784),
[langchain-ai#4781](langchain-ai#4781),
[langchain-ai#4780](langchain-ai#4780)).
- Reasoning effort now persists across restarts
([langchain-ai#4728](langchain-ai#4728)).
- Added a toast prompting you to re-paste when a chat paste collapses
([langchain-ai#4742](langchain-ai#4742)).

### Bug Fixes

- Tool calls awaiting approval are now surfaced correctly
([langchain-ai#4739](langchain-ai#4739)).
- Fixed transcript tail hydration when scrolled to the bottom edge
([langchain-ai#4733](langchain-ai#4733)).
- Kept chat input responsive during MCP viewer `Ctrl+R` reconnects
([langchain-ai#4753](langchain-ai#4753)).
- Improved inline free-text prompts by sharing paste handling and
matching primary-input `Ctrl+D` behavior
([langchain-ai#4736](langchain-ai#4736),
[langchain-ai#4729](langchain-ai#4729)).
- Fixed local offloaded tool results to use the real filesystem
([langchain-ai#4740](langchain-ai#4740)).
- Cleaned offloaded history when deleting a thread
([langchain-ai#4751](langchain-ai#4751)).
- Removed duplicated content from the system prompt by overwriting the
base prompt
([langchain-ai#4516](langchain-ai#4516)).
- Closed subprocess transport during install teardown
([langchain-ai#4735](langchain-ai#4735)).
- Added targeted `uv` constraints for prerelease dependencies
([langchain-ai#4744](langchain-ai#4744)).

_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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dcode Related to `deepagents-code` dependencies Pull requests that update a dependency file feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization size: XL 1000+ LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant