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

+5 -2
View File
@@ -86,7 +86,7 @@ async def test_runner_recovery_diagnostics_obey_private_policy(log_content, kind
if kind == "injection":
spec.injection_callback = AsyncMock(side_effect=ValueError(_SECRET))
elif kind == "continuation":
spec.continuation_callback = MagicMock(side_effect=ValueError(_SECRET))
spec.continuation_callback = AsyncMock(side_effect=ValueError(_SECRET))
elif kind == "finalization":
spec.max_iterations = 0
provider.chat_stream_with_retry = AsyncMock(side_effect=ValueError(_SECRET))
@@ -101,11 +101,14 @@ async def test_runner_recovery_diagnostics_obey_private_policy(log_content, kind
spec.hook = BrokenFinallyHook()
with request_context(RequestContext(channel="websocket", chat_id="test", log_content=log_content)):
if kind == "finally":
if kind in {"finally", "continuation"}:
with pytest.raises(ValueError, match=_SECRET):
await AgentRunner().run(spec)
else:
await AgentRunner().run(spec)
if kind == "continuation":
assert all(_SECRET not in r["message"] for r in diagnostic_records)
return
errors = [r for r in diagnostic_records if r["level"].name == "ERROR"]
assert errors
assert all((r["exception"] is not None) is log_content for r in errors)