Skip to content

feat(evals): goal-tool over-eager-calling evals + gated prompt copy - #4412

Closed
Mason Daugherty (mdrxy) wants to merge 20 commits into
mainfrom
open-swe/goal-tools-eager-calling-evals
Closed

feat(evals): goal-tool over-eager-calling evals + gated prompt copy#4412
Mason Daugherty (mdrxy) wants to merge 20 commits into
mainfrom
open-swe/goal-tools-eager-calling-evals

Conversation

@mdrxy

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

Copy link
Copy Markdown
Member

Models over-eagerly call dcode's get_rubric / get_goal even when no goal or rubric was ever set, because GOAL_TOOLS_SYSTEM_PROMPT leads with an unconditional "inspect before finishing" instruction. This adds evals to pin the behavior down and rewrites the copy to gate on the precondition. Specifically:

  • New tool_not_called hard-fail success assertion in libs/evals/tests/evals/utils.py (the framework only had text-based success assertions + efficiency presence checks).
  • New libs/evals/tests/evals/test_goal_tools.py exercising the real GoalToolsMiddleware via create_agent (mirrors test_langchain_middleware_todo.py): two baseline regression gates that get_rubric / get_goal stay untouched when no goal/rubric is set (trivial task + real multi-step tool use), and a hillclimb case that a consulted rubric is still allowed (seeded via the public rubric input, since goal channels aren't part of the public graph input in an isolated harness).
  • Rewrote GOAL_TOOLS_SYSTEM_PROMPT to lead with "a goal/rubric is only present if one was set earlier; if none was set, do not call these tools."
  • Regenerated EVAL_CATALOG.md.

Made by Open SWE

References

`dcode`'s goal-tools prompt made models call `get_rubric`/`get_goal` even
when no goal or rubric was ever set. Add a `tool_not_called` hard-fail
assertion and a `test_goal_tools.py` eval module (baseline gates that the
tools stay untouched with no goal/rubric set, plus a hillclimb case that a
consulted rubric is still allowed), and rewrite `GOAL_TOOLS_SYSTEM_PROMPT`
to lead with the precondition that the tools are inert when nothing is set.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This PR title scope does not match the package directory it changes.

Title scope(s): evals

Touched package dir(s) not covered by those scopes:

  • package label dcode from libs/code/
  • package label deepagents from libs/deepagents/

This check is blocking because the PR title declares one package scope while the changed files live in a different package directory.

To resolve

Edit the PR title scope so it covers the changed package directory (for example, use fix(code): ... for libs/code/**), or move the files so they match the declared scope.

If intentional

Apply the allow-scope-mismatch label. The check re-runs and passes with an informational note.

@github-actions github-actions Bot added dcode Related to `deepagents-code` evals Evaluation suite and Harbor integration feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization open-swe size: M 200-499 LOC labels Jul 1, 2026
@mdrxy
Mason Daugherty (mdrxy) marked this pull request as ready for review July 6, 2026 22:17

@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: No issues found

Open SWE reviewed this PR and found no potential bugs to report.

Open in WebView Open SWE trace

@github-actions github-actions Bot added size: L 500-999 LOC and removed size: M 200-499 LOC labels Jul 7, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been open for at least 14 days.

It will be closed automatically once it has been open for at least 30 days and this warning is at least 16 days old, unless the do-not-close label is applied.

@mdrxy Mason Daugherty (mdrxy) added the do-not-close Bypass PR auto-deletion label Jul 16, 2026
@mdrxy

Copy link
Copy Markdown
Member Author

maybe instead of system prompt artificla msg when goal is added?

Mason Daugherty (mdrxy) and others added 3 commits July 17, 2026 16:03
…ager-calling-evals

# Conflicts:
#	libs/code/deepagents_code/goal_tools.py
#	libs/code/tests/unit_tests/smoke_tests/snapshots/system_prompt_interactive_local.md
@github-actions github-actions Bot added deepagents Related to the `deepagents` SDK / agent harness size: XL 1000+ LOC and removed size: L 500-999 LOC labels Jul 21, 2026
…ager-calling-evals

# Conflicts:
#	libs/code/deepagents_code/app.py
@mdrxy

Copy link
Copy Markdown
Member Author

Superseded by #4980.

The replacement carries forward the goal-state notices, goal-tool gating, internal-message filtering, and relevant eval coverage, reconciled with #4944’s accepted-goal continuation. This avoids landing two overlapping hidden-message protocols for the same goal-activation transition.

Closing this PR in favor of #4980.

Mason Daugherty (mdrxy) added a commit that referenced this pull request Jul 23, 2026
Supersedes #4412
Supersedes #4944

Accepted goals now transition into agent work through one coordinated
internal protocol: a durable notice records the authoritative goal
state, while a hidden continuation resumes work without replaying the
objective as another user message.

---

The previous PRs addressed two symptoms at the same transition. #4944
changed how work resumes after goal acceptance, while #4412 introduced
persisted notices that tell the agent when goal tools are relevant.
Landing them independently would create overlapping internal-message
lifecycles with separate persistence, restoration, summarization, and
transcript-filtering behavior.

This replacement gives the two message types explicit roles:

- The goal-state notice is the durable source of truth.
- The continuation is a one-time trigger emitted only after that state
is available.

It also handles persistence failure without directing the agent to
nonexistent saved state and keeps all internal goal-control messages out
of user-visible and grader transcripts. Goal-specific filtering remains
in `deepagents-code`; the replacement does not change the Deep Agents
SDK.
Marcelo5444 pushed a commit to Marcelo5444/deepagents that referenced this pull request Jul 30, 2026
Supersedes langchain-ai#4412
Supersedes langchain-ai#4944

Accepted goals now transition into agent work through one coordinated
internal protocol: a durable notice records the authoritative goal
state, while a hidden continuation resumes work without replaying the
objective as another user message.

---

The previous PRs addressed two symptoms at the same transition. langchain-ai#4944
changed how work resumes after goal acceptance, while langchain-ai#4412 introduced
persisted notices that tell the agent when goal tools are relevant.
Landing them independently would create overlapping internal-message
lifecycles with separate persistence, restoration, summarization, and
transcript-filtering behavior.

This replacement gives the two message types explicit roles:

- The goal-state notice is the durable source of truth.
- The continuation is a one-time trigger emitted only after that state
is available.

It also handles persistence failure without directing the agent to
nonexistent saved state and keeps all internal goal-control messages out
of user-visible and grader transcripts. Goal-specific filtering remains
in `deepagents-code`; the replacement does not change the Deep Agents
SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dcode Related to `deepagents-code` deepagents Related to the `deepagents` SDK / agent harness do-not-close Bypass PR auto-deletion evals Evaluation suite and Harbor integration feature New feature/enhancement or request for one internal User is a member of the `langchain-ai` GitHub organization open-swe size: XL 1000+ LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant