Spaces:
Running
Running
Upload patch_catch_up_fix_backend.py
Browse files
patch_catch_up_fix_backend.py
CHANGED
|
@@ -85,7 +85,7 @@ def _patch_routes(content):
|
|
| 85 |
' """Get full message history for a session from the permanent dataset.\n'
|
| 86 |
'\n'
|
| 87 |
' Returns only valid conversation messages (user/assistant/tool roles).\n'
|
| 88 |
-
|
| 89 |
' tracing data that cannot be parsed as Message objects and would be\n'
|
| 90 |
' silently dropped during catch-up, causing message loss.\n'
|
| 91 |
' """\n'
|
|
@@ -208,8 +208,10 @@ def _patch_seed_from_summary(content):
|
|
| 208 |
print(" + Fall back to raw messages if summarization fails")
|
| 209 |
changed = True
|
| 210 |
|
|
|
|
| 211 |
if changed:
|
| 212 |
content = content + "\n" + PATCHED_MARKER + "\n"
|
|
|
|
| 213 |
|
| 214 |
return content, changed
|
| 215 |
|
|
|
|
| 85 |
' """Get full message history for a session from the permanent dataset.\n'
|
| 86 |
'\n'
|
| 87 |
' Returns only valid conversation messages (user/assistant/tool roles).\n'
|
| 88 |
+
" Event rows (role='event') are filtered out because they are internal\n"
|
| 89 |
' tracing data that cannot be parsed as Message objects and would be\n'
|
| 90 |
' silently dropped during catch-up, causing message loss.\n'
|
| 91 |
' """\n'
|
|
|
|
| 208 |
print(" + Fall back to raw messages if summarization fails")
|
| 209 |
changed = True
|
| 210 |
|
| 211 |
+
# Add marker
|
| 212 |
if changed:
|
| 213 |
content = content + "\n" + PATCHED_MARKER + "\n"
|
| 214 |
+
changed = True
|
| 215 |
|
| 216 |
return content, changed
|
| 217 |
|