Skip to main content

Module text

Module text 

Source

Constants§

QUOTED_CONTEXT_MAX_CHARS
Remove private reasoning and textual protocol artifacts before content is handed to a user-facing channel. Real tool calls are structured blocks; a literal [tool_use: ...] line is therefore always an implementation leak. Cap on the excerpt embedded by quoted_context_prefix.

Functions§

floor_char_boundary
quoted_context_prefix
Build the [quoted from …] prefix that channel adapters prepend when a user replies to an earlier message, so terse follow-ups (“why?”, “fix it”) keep their referent even after the original scrolled out of the session window. Returns None when the referenced content is empty.
sanitize_user_visible_text
split_text