Compare commits

...

2 Commits

Author SHA1 Message Date
Weilong Liao
3ae49b4c4f chore: delete tests/unit/test_system_prompt_none_bug.py 2026-04-30 23:12:11 +08:00
LIghtJUNction
e2139fd91b fix: guard against None system_prompt in _ensure_persona_and_skills
ProviderRequest.system_prompt defaults to None. When a persona with a
prompt is configured, _ensure_persona_and_skills calls
``req.system_prompt += ...`` which crashes with ``TypeError`` when
system_prompt is None.

Added a None guard before the persona prompt injection and skills prompt
appending sections so they always operate on a string.
2026-04-29 07:37:04 +08:00

View File

@@ -399,6 +399,9 @@ async def _ensure_persona_and_skills(
event, extract_persona_custom_error_message_from_persona(persona)
)
if req.system_prompt is None:
req.system_prompt = ""
if persona:
# Inject persona system prompt
if prompt := persona["prompt"]: