feat(evals): goal-tool over-eager-calling evals + gated prompt copy - #4412
feat(evals): goal-tool over-eager-calling evals + gated prompt copy#4412Mason Daugherty (mdrxy) wants to merge 20 commits into
Conversation
`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>
|
⛔ This PR title scope does not match the package directory it changes. Title scope(s): Touched package dir(s) not covered by those scopes:
This check is blocking because the PR title declares one package scope while the changed files live in a different package directory. To resolveEdit the PR title scope so it covers the changed package directory (for example, use If intentionalApply the |
|
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 |
|
maybe instead of system prompt artificla msg when goal is added? |
…ager-calling-evals # Conflicts: # libs/code/deepagents_code/goal_tools.py # libs/code/tests/unit_tests/smoke_tests/snapshots/system_prompt_interactive_local.md
…ager-calling-evals # Conflicts: # libs/code/deepagents_code/app.py
…ager-calling-evals
…ager-calling-evals # Conflicts: # libs/evals/tests/unit_tests/test_harbor_langgraph_agent.py
|
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. |
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.
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.
Models over-eagerly call
dcode'sget_rubric/get_goaleven when no goal or rubric was ever set, becauseGOAL_TOOLS_SYSTEM_PROMPTleads 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:tool_not_calledhard-fail success assertion inlibs/evals/tests/evals/utils.py(the framework only had text-based success assertions + efficiency presence checks).libs/evals/tests/evals/test_goal_tools.pyexercising the realGoalToolsMiddlewareviacreate_agent(mirrorstest_langchain_middleware_todo.py): two baseline regression gates thatget_rubric/get_goalstay 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 publicrubricinput, since goal channels aren't part of the public graph input in an isolated harness).GOAL_TOOLS_SYSTEM_PROMPTto lead with "a goal/rubric is only present if one was set earlier; if none was set, do not call these tools."EVAL_CATALOG.md.Made by Open SWE
References