refactor(goal): sustain one ReAct run until the goal closes (#6538)

* refactor(goal): sustain one ReAct run until the goal closes

Keep active goals in the same runner beyond the ordinary iteration limit, with a final answer after successful closure. Remove cross-turn goal handoffs, continuation allowances and rollback bookkeeping while preserving input authorization, recovery, cancellation and terminal lifecycle ownership.

Contributes to NAN-392

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>

* test(goal): consolidate sustained-run regression coverage

Retain lifecycle, history, usage, provider-state privacy and checkpoint cancellation assertions in the existing long-run scenarios. Remove duplicate smoke cases and parameter combinations that do not exercise distinct behavior; keep real Gateway, authorization and generation regressions.
This commit is contained in:
chengyongruandchengyongru authored and GitHub committed 2026-11-03 22:47:00 +08:00
1 parent 3545539128
commit 62c2ed4e7e
68 files changed
+2683 -1421

No files matched your search

-43
View File
@@ -6,7 +6,6 @@ from nanobot.session.goal_state import (
discard_legacy_goal_state_key,
explicit_goal_requested,
goal_state_runtime_lines,
goal_state_ws_blob,
parse_goal_state,
sustained_goal_active,
)
@@ -78,48 +77,6 @@ def test_parse_goal_state_accepts_json_string():
}
def test_goal_state_ws_blob_inactive_when_missing_or_completed():
assert goal_state_ws_blob(None) == {"active": False}
assert goal_state_ws_blob({}) == {"active": False}
assert goal_state_ws_blob({GOAL_STATE_KEY: {"status": "completed", "objective": "x"}}) == {
"active": False,
}
def test_goal_state_ws_blob_active_shape():
meta = {
GOAL_STATE_KEY: {
"status": "active",
"objective": "Build feature.",
"ui_summary": "feat",
},
}
assert goal_state_ws_blob(meta) == {
"active": True,
"status": "active",
"ui_summary": "feat",
"objective": "Build feature.",
}
def test_goal_state_ws_blob_preserves_blocked_state_for_host_attention():
meta = {
GOAL_STATE_KEY: {
"status": "blocked",
"objective": "Deploy safely.",
"ui_summary": "Approval required",
"recap": "Production access is required.",
},
}
assert goal_state_ws_blob(meta) == {
"active": False,
"status": "blocked",
"ui_summary": "Approval required",
"objective": "Deploy safely.",
"recap": "Production access is required.",
}
def test_sustained_goal_active_false_when_missing_or_completed():
assert sustained_goal_active(None) is False
assert sustained_goal_active({}) is False