fix(ci): stabilize main test suite regressions (#17660)
* fix: stabilize main test suite regressions * test(agent): update MiniMax normalization expectation * test: stabilize remaining CI assertions * test: harden config helper monkeypatching * test: harden CI-only assertions * fix(agent): propagate fast streaming interrupts
This commit is contained in:
committed by
GitHub
parent
e7beaaf184
commit
f73364b1c4
@@ -8,12 +8,10 @@ effects (terminal, send_message, delegate_task, etc.).
|
||||
import threading
|
||||
from unittest.mock import patch
|
||||
|
||||
from run_agent import AIAgent
|
||||
|
||||
|
||||
def _make_agent_stub():
|
||||
def _make_agent_stub(agent_cls):
|
||||
"""Create a minimal AIAgent-like object with just enough state for _spawn_background_review."""
|
||||
agent = object.__new__(AIAgent)
|
||||
agent = object.__new__(agent_cls)
|
||||
agent.model = "test-model"
|
||||
agent.platform = "test"
|
||||
agent.provider = "openai"
|
||||
@@ -45,14 +43,16 @@ class _SyncThread:
|
||||
|
||||
def test_background_review_agent_uses_restricted_toolsets():
|
||||
"""The review agent must only have access to 'memory' and 'skills' toolsets."""
|
||||
agent = _make_agent_stub()
|
||||
import run_agent
|
||||
|
||||
agent = _make_agent_stub(run_agent.AIAgent)
|
||||
captured = {}
|
||||
|
||||
def _capture_init(self, *args, **kwargs):
|
||||
captured["enabled_toolsets"] = kwargs.get("enabled_toolsets")
|
||||
raise RuntimeError("stop after capturing init args")
|
||||
|
||||
with patch.object(AIAgent, "__init__", _capture_init), \
|
||||
with patch.object(run_agent.AIAgent, "__init__", _capture_init), \
|
||||
patch("threading.Thread", _SyncThread):
|
||||
agent._spawn_background_review(
|
||||
messages_snapshot=[],
|
||||
|
||||
Reference in New Issue
Block a user