Ship Assistent 0.15.2: apply closed generate patches immediately, recover stalled streams, and skip repeat greetings when a chat already has replies.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -119,6 +119,37 @@ public partial class SwarmAssistentExtension
|
||||
AddLayer("extra", extraSystem);
|
||||
}
|
||||
|
||||
bool priorAssistant = false;
|
||||
foreach (JToken msg in userMessages ?? [])
|
||||
{
|
||||
if (string.Equals((msg as JObject)?["role"]?.ToString(), "assistant", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
priorAssistant = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!priorAssistant && !string.IsNullOrWhiteSpace(contextJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
JObject ctx = JObject.Parse(contextJson);
|
||||
priorAssistant = ctx.Value<bool?>("do_not_greet") == true
|
||||
|| (ctx["prior_assistant_turns"]?.Value<int?>() ?? 0) > 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// not json
|
||||
}
|
||||
}
|
||||
if (priorAssistant && !slimUtility)
|
||||
{
|
||||
AddLayer("continuity",
|
||||
"Conversation continuity: this thread already has your prior replies. "
|
||||
+ "Do NOT greet (no «О, привет», no hello, no 👋). "
|
||||
+ "Do NOT re-introduce yourself or dump your bio/tagline. "
|
||||
+ "Answer only the latest user message. Name yourself only if asked who you are.");
|
||||
}
|
||||
|
||||
layers["total"] = system.Length;
|
||||
if (system.Length > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user