Compaction overhaul (#5186)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: David Katz <dkatz@squareup.com>
Co-authored-by: Alex Hancock <alexhancock@block.xyz>
This commit is contained in:
Douwe Osinga
2025-10-15 18:39:12 -04:00
committed by GitHub
parent ef9e68f2c6
commit 7c1f5dcb2f
56 changed files with 3069 additions and 4465 deletions
+20 -51
View File
@@ -2251,30 +2251,14 @@
}
]
},
"ContextLengthExceeded": {
"type": "object",
"required": [
"msg"
],
"properties": {
"msg": {
"type": "string"
}
}
},
"ContextManageRequest": {
"type": "object",
"description": "Request payload for context management operations",
"required": [
"messages",
"manageAction",
"sessionId"
],
"properties": {
"manageAction": {
"type": "string",
"description": "Operation to perform: \"truncation\" or \"summarize\""
},
"messages": {
"type": "array",
"items": {
@@ -2319,6 +2303,17 @@
"$ref": "#/components/schemas/Message"
}
},
"ConversationCompacted": {
"type": "object",
"required": [
"msg"
],
"properties": {
"msg": {
"type": "string"
}
}
},
"CreateRecipeRequest": {
"type": "object",
"required": [
@@ -3136,7 +3131,9 @@
"description": "A message to or from an LLM",
"required": [
"role",
"content"
"created",
"content",
"metadata"
],
"properties": {
"content": {
@@ -3334,7 +3331,7 @@
{
"allOf": [
{
"$ref": "#/components/schemas/ContextLengthExceeded"
"$ref": "#/components/schemas/ConversationCompacted"
},
{
"type": "object",
@@ -3345,28 +3342,7 @@
"type": {
"type": "string",
"enum": [
"contextLengthExceeded"
]
}
}
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/SummarizationRequested"
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"summarizationRequested"
"conversationCompacted"
]
}
}
@@ -3382,6 +3358,10 @@
"MessageMetadata": {
"type": "object",
"description": "Metadata for message visibility",
"required": [
"userVisible",
"agentVisible"
],
"properties": {
"agentVisible": {
"type": "boolean",
@@ -4429,17 +4409,6 @@
"propertyName": "type"
}
},
"SummarizationRequested": {
"type": "object",
"required": [
"msg"
],
"properties": {
"msg": {
"type": "string"
}
}
},
"TextContent": {
"type": "object",
"required": [