fix(web): support parallel sessions; fix lost/duplicate in-flight replies

This commit is contained in:
zhayujie
2026-06-08 15:36:48 +08:00
parent 26300a8d43
commit b7aa64279d
10 changed files with 266 additions and 33 deletions

View File

@@ -269,7 +269,9 @@ def run_evolution_for_session(
new_messages = all_messages[done:]
transcript = _build_transcript(new_messages)
if not transcript.strip():
logger.info(f"[Evolution] session={session_id}: no new messages, skip")
# Routine no-op: the per-minute scan hits every idle session, so keep
# this at debug to avoid spamming the log.
logger.debug(f"[Evolution] session={session_id}: no new messages, skip")
# Advance the cursor anyway so we don't re-scan the same tail.
agent._evo_done_msg_count = total_msgs
return False

View File

@@ -120,11 +120,12 @@ them. When their signal is clear, act; do not be shy here.
- Nothing worth evolving -> output exactly `[SILENT]` and nothing else.
- Otherwise, after performing the edits, output a short user-facing summary in
the SAME LANGUAGE the user used in the conversation. Tell the user, briefly:
the SAME LANGUAGE the user used. Write it for an ordinary user, in plain
everyday words — NOT a developer report. No need to expose internal details
(file names/paths, system mechanics, etc.). Tell the user, briefly:
1) that you just did a self-learning pass,
2) what you learned and what you changed (in plain terms — no need to cite
exact file paths; "remembered X" / "improved the weekly-report skill" is
enough).
2) what you learned and what you changed in THIS pass ("remembered X" /
"improved the <name> skill" / "finished <task>").
Keep it to 1-3 lines. Generic shape (do not copy domain words):
"I just did a self-learning pass.
- Learned: <what you learned>