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:
parent
e7beaaf184
commit
f73364b1c4
37 changed files with 450 additions and 127 deletions
|
|
@ -1860,6 +1860,18 @@ def _enrich_with_attached_images(user_text: str, image_paths: list[str]) -> str:
|
|||
return text or "What do you see in this image?"
|
||||
|
||||
|
||||
def _messages_as_conversation(db, session_id: str, *, include_ancestors: bool = False):
|
||||
if include_ancestors:
|
||||
try:
|
||||
return db.get_messages_as_conversation(
|
||||
session_id, include_ancestors=True
|
||||
)
|
||||
except TypeError as exc:
|
||||
if "include_ancestors" not in str(exc):
|
||||
raise
|
||||
return db.get_messages_as_conversation(session_id)
|
||||
|
||||
|
||||
def _history_to_messages(history: list[dict]) -> list[dict]:
|
||||
messages = []
|
||||
tool_call_args = {}
|
||||
|
|
@ -2068,9 +2080,9 @@ def _(rid, params: dict) -> dict:
|
|||
_enable_gateway_prompts()
|
||||
try:
|
||||
db.reopen_session(target)
|
||||
history = db.get_messages_as_conversation(target)
|
||||
display_history = db.get_messages_as_conversation(
|
||||
target, include_ancestors=True
|
||||
history = _messages_as_conversation(db, target)
|
||||
display_history = _messages_as_conversation(
|
||||
db, target, include_ancestors=True
|
||||
)
|
||||
messages = _history_to_messages(display_history)
|
||||
tokens = _set_session_context(target)
|
||||
|
|
@ -2215,8 +2227,8 @@ def _(rid, params: dict) -> dict:
|
|||
db = _get_db()
|
||||
if db is not None and session.get("session_key"):
|
||||
try:
|
||||
history = db.get_messages_as_conversation(
|
||||
session["session_key"], include_ancestors=True
|
||||
history = _messages_as_conversation(
|
||||
db, session["session_key"], include_ancestors=True
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue