Files
openclaw/extensions/anthropic/session-catalog-cursor.ts
qingminlong 1d999b817f fix(anthropic): reject invalid Claude session cursors (#104967)
* fix(anthropic): reject invalid Claude session cursors

* fix(anthropic): validate Claude session cursors exactly

* fix(anthropic): route cursor test through catalog provider

* fix(anthropic): validate Claude session cursors exactly

Co-authored-by: qingminlong <qing.minlong@xydigit.com>

* fix(anthropic): keep cursor limit private

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-17 20:19:29 +01:00

11 lines
283 B
TypeScript

const CLAUDE_SESSION_CURSOR_MAX_LENGTH = 256;
export function isExactClaudeSessionCursor(value: unknown): value is string {
return (
typeof value === "string" &&
value.length > 0 &&
value.length <= CLAUDE_SESSION_CURSOR_MAX_LENGTH &&
value === value.trim()
);
}