deer-flow/contracts/thread_goal_contract.json
Totoro c48447a4ae
fix(runtime): present outputs before a loop wrap-up and explain step-limit stops (#7588)
* fix(runtime): present outputs before a loop wrap-up and explain step-limit stops

Loop-detection warnings now ask the agent to present the files it already
created in /mnt/user-data/outputs before its final answer, when
present_files is available.

A run that exhausts recursion_limit now ends with stop_reason
recursion_capped and a plain message that lists outputs it created but
did not present. An active goal stands down without an evaluator call.
The /wait error envelope keeps the GraphRecursionError name, and IM
channels reply with the step-limit message instead of a generic failure.

* docs(changelog): note run-end delivery and step-limit stops (#7588)

* test(runtime): stop pinning LangGraph's step count in the step-limit test

The produced paths and the message already follow the observed model
calls, so the exact count only pinned LangGraph's per-step accounting.
Also note on the step-limit goal branch that its caller passes no
evaluator factory, so it has to stay ahead of the evaluator section.

---------

Co-authored-by: Totoro-qaq <279883115+Totoro-qaq@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-10-27 10:34:34 +08:00

48 lines
2.2 KiB
JSON

{
"version": 1,
"description": "Cross-language contract fixture for the chat goal state. When auto-continue stands down, the worker stores one of stand_down_reason_codes in goal.last_evaluation.stand_down_reason (backend/packages/harness/deerflow/runtime/runs/worker.py); check_failure_codes are the ones where the goal could not be checked. Clearing a met goal writes the goal_outcome channel in the same checkpoint, and every other goal write removes it (runtime/goal.py write_thread_goal); clients cannot write it. The POST /api/threads/{thread_id}/history head carries at most history_head_keys, projecting goal only while it is active and goal_outcome only when achieved. host_reason_texts are the English last_evaluation.reason values the host writes itself instead of the evaluator; the evaluator_failed reason embeds an exception type name and is covered by check_failure_codes. The frontend reads the same file so it never shows a raw code and never labels host text as the evaluator's.",
"stand_down_reason_codes": [
"blocked:missing_evidence",
"blocked:needs_user_input",
"blocked:run_failed",
"blocked:external_wait",
"max_continuations_reached",
"no_progress_detected",
"token_capped",
"loop_capped",
"recursion_capped",
"evaluator_failed",
"no_durable_end_of_turn",
"thread_changed_after_evaluation",
"thread_changed_before_continuation"
],
"check_failure_codes": [
"evaluator_failed",
"no_durable_end_of_turn",
"thread_changed_after_evaluation",
"thread_changed_before_continuation"
],
"goal_outcome": {
"channel": "goal_outcome",
"statuses": ["achieved"],
"keys": [
"status",
"objective",
"goal_created_at",
"achieved_at",
"continuation_count",
"max_continuations",
"reason",
"relied_on_assumption",
"reply_message_id"
]
},
"history_head_keys": ["title", "thread_data", "messages", "goal", "goal_outcome"],
"host_reason_texts": [
"No visible assistant evidence is available yet.",
"The turn ended on a question to the user that has not been answered.",
"No durable assistant end-of-turn receipt was available.",
"The run reached its step limit before finishing."
]
}