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

+3 -1
View File
@@ -5,7 +5,7 @@ from unittest.mock import AsyncMock, MagicMock
import pytest
from nanobot.command.builtin import (
from nanobot.command.application import (
builtin_command_starts_agent_turn,
register_builtin_commands,
)
@@ -141,6 +141,7 @@ class TestMidTurnCommandDispatchedDirectly:
async def test_help_dispatched_with_session_none(
self, router: CommandRouter, fake_loop: MagicMock, fake_msg: MagicMock,
) -> None:
fake_loop.commands = router
ctx = CommandContext(
msg=fake_msg, session=None,
key="test:chat1", raw="/help", loop=fake_loop,
@@ -151,6 +152,7 @@ class TestMidTurnCommandDispatchedDirectly:
assert result.chat_id == "chat1"
assert result.metadata["render_as"] == "text"
assert "/new" in result.content
assert "/goal <goal>" in result.content
assert "/pairing [list|approve <code>|deny <code>|revoke <user_id>]" in result.content
@pytest.mark.asyncio