mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-18 10:00:40 +08:00
feat: fix preserve escaped newlines in frontmatter & update tests & ci workflows (#6783)
This commit is contained in:
@@ -2,6 +2,7 @@ import asyncio
|
||||
import os
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
from typing import Any, cast
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
import pytest
|
||||
@@ -763,7 +764,7 @@ async def test_skills_like_requery_passes_extra_user_content_parts():
|
||||
provider=provider,
|
||||
request=req,
|
||||
run_context=run_context,
|
||||
tool_executor=MockToolExecutor(),
|
||||
tool_executor=cast(Any, MockToolExecutor()),
|
||||
agent_hooks=MockHooks(),
|
||||
tool_schema_mode="skills_like",
|
||||
)
|
||||
@@ -797,7 +798,7 @@ async def test_follow_up_accepted_when_active_and_not_stopping(
|
||||
|
||||
# Runner is active (not done) and stop is not requested
|
||||
assert not runner.done()
|
||||
assert runner._stop_requested is False
|
||||
assert runner._is_stop_requested() is False
|
||||
|
||||
ticket = runner.follow_up(message_text="valid follow-up message")
|
||||
|
||||
@@ -824,7 +825,7 @@ async def test_follow_up_rejected_when_stop_requested(
|
||||
|
||||
# Request stop
|
||||
runner.request_stop()
|
||||
assert runner._stop_requested is True
|
||||
assert runner._is_stop_requested() is True
|
||||
|
||||
ticket = runner.follow_up(message_text="follow-up after stop")
|
||||
|
||||
@@ -959,7 +960,7 @@ async def test_follow_up_rejected_and_runner_stops_without_execution(
|
||||
|
||||
# Request stop before any execution (simulates /stop command received at start)
|
||||
runner.request_stop()
|
||||
assert runner._stop_requested is True
|
||||
assert runner._is_stop_requested() is True
|
||||
|
||||
# Try to add follow-up after stop (should be rejected)
|
||||
ticket_after = runner.follow_up(message_text="follow-up after stop")
|
||||
@@ -1017,7 +1018,7 @@ async def test_follow_up_after_stop_not_merged_into_tool_result(
|
||||
|
||||
# Request stop (simulates /stop command during active execution)
|
||||
runner.request_stop()
|
||||
assert runner._stop_requested is True
|
||||
assert runner._is_stop_requested() is True
|
||||
|
||||
# Try to add follow-up after stop (should be rejected)
|
||||
ticket_after = runner.follow_up(message_text="invalid after stop")
|
||||
|
||||
Reference in New Issue
Block a user