Skip to content

Commit cc7686f

Browse files
committed
docs: update limit warning
1 parent b817214 commit cc7686f

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

docs/api-reference/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@
788788
"type" : "string"
789789
}
790790
}, {
791-
"description" : "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned.",
791+
"description" : "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned. \n\nWARNING!\n Use `limit` only for read-only/display purposes (pagination, viewing). Do NOT use `limit` to truncate messages before sending to LLM as it may cause tool-call and tool-result unpairing issues. Instead, use the `token_limit` edit strategy in `edit_strategies` parameter to safely manage message context size.",
792792
"in" : "query",
793793
"name" : "limit",
794794
"schema" : {

src/server/api/go/docs/docs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ const docTemplate = `{
10861086
},
10871087
{
10881088
"type": "integer",
1089-
"description": "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned.",
1089+
"description": "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned. \n\nWARNING!\n Use ` + "`" + `limit` + "`" + ` only for read-only/display purposes (pagination, viewing). Do NOT use ` + "`" + `limit` + "`" + ` to truncate messages before sending to LLM as it may cause tool-call and tool-result unpairing issues. Instead, use the ` + "`" + `token_limit` + "`" + ` edit strategy in ` + "`" + `edit_strategies` + "`" + ` parameter to safely manage message context size.",
10901090
"name": "limit",
10911091
"in": "query"
10921092
},

src/server/api/go/docs/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@
10831083
},
10841084
{
10851085
"type": "integer",
1086-
"description": "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned.",
1086+
"description": "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned. \n\nWARNING!\n Use `limit` only for read-only/display purposes (pagination, viewing). Do NOT use `limit` to truncate messages before sending to LLM as it may cause tool-call and tool-result unpairing issues. Instead, use the `token_limit` edit strategy in `edit_strategies` parameter to safely manage message context size.",
10871087
"name": "limit",
10881088
"in": "query"
10891089
},

src/server/api/go/docs/swagger.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,12 @@ paths:
13991399
name: session_id
14001400
required: true
14011401
type: string
1402-
- description: Limit of messages to return. Max 200. If limit is 0 or not provided,
1403-
all messages will be returned.
1402+
- description: "Limit of messages to return. Max 200. If limit is 0 or not provided,
1403+
all messages will be returned. \n\nWARNING!\n Use `limit` only for read-only/display
1404+
purposes (pagination, viewing). Do NOT use `limit` to truncate messages
1405+
before sending to LLM as it may cause tool-call and tool-result unpairing
1406+
issues. Instead, use the `token_limit` edit strategy in `edit_strategies`
1407+
parameter to safely manage message context size."
14041408
in: query
14051409
name: limit
14061410
type: integer

src/server/api/go/internal/modules/handler/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ type GetMessagesReq struct {
480480
// @Accept json
481481
// @Produce json
482482
// @Param session_id path string true "Session ID" format(uuid)
483-
// @Param limit query integer false "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned."
483+
// @Param limit query integer false "Limit of messages to return. Max 200. If limit is 0 or not provided, all messages will be returned. \n\nWARNING!\n Use `limit` only for read-only/display purposes (pagination, viewing). Do NOT use `limit` to truncate messages before sending to LLM as it may cause tool-call and tool-result unpairing issues. Instead, use the `token_limit` edit strategy in `edit_strategies` parameter to safely manage message context size."
484484
// @Param cursor query string false "Cursor for pagination. Use the cursor from the previous response to get the next page."
485485
// @Param with_asset_public_url query string false "Whether to return asset public url, default is true" example(true)
486486
// @Param format query string false "Format to convert messages to: acontext (original), openai (default), anthropic." enums(acontext,openai,anthropic)

0 commit comments

Comments
 (0)