v1.10.0 — Stop an answer, and stop paying for it twice

1.10.0New featureDenis Povarov

Stop an answer

While an answer is streaming, the send button becomes a stop button. Pressing it keeps the text that already arrived and stops the server generating the rest — which is what a visitor wants the moment they can see the answer is heading the wrong way.

Stopping is not treated as a failure. No error notice appears, the partial answer stays in the conversation and in the transcript you read later, and the next question can be asked straight away. In React, useKookeeChat() now exposes stop() for a composer of your own.

Answers are generated once, not twice

The tool-calling loop used to run a non-streamed completion to find out whether the model wanted a tool, and then a second, streamed one to actually say it. Every plain answer was therefore produced twice, and the visitor waited out the whole first generation before a single character appeared.

Each round is now a single streamed call. The first token arrives a full generation sooner, and a turn that needs no tools costs roughly half what it did. Nothing about how you use the chat changes — it is the same answer, sooner and cheaper. The reasoning is in Your Streaming Chatbot Is Probably Generating Every Answer Twice.

Answers are sanitized before they render

An assistant answer is written by a model whose input includes text nobody controls: the visitor's own words, the page the widget sits on, results from tools your site registers, and your assistant instructions. The widget now sanitizes every answer before rendering it, with an explicit allowlist of tags and attributes.

Prose, lists, tables, links, citations and highlighted code render exactly as before. A code block's Copy button also works on sites with a strict Content-Security-Policy now, because it no longer relies on an inline handler.

Clearer endings

An answer cut short — by the length limit, a content filter, or running out of search steps — now says so in a note under the message, instead of the server appending an English sentence to the answer itself. Translators and custom UIs get the reason as data.

A failure keeps whatever text arrived and names what happened underneath it. Reaching a rate limit, an exhausted monthly allowance and a full conversation each read differently now, rather than all saying "something went wrong".

Your own AI can read the help center

For teams building their own assistant rather than using the built-in one, @kookee/sdk 1.8.0 adds:

  • score on search hits — the similarity of the passage that matched, between 0.4 and 1, or null when the search fell back to text matching.

  • markdown: true on article reads — the body as Markdown in contentMarkdown, cheaper to put in a prompt than HTML.

  • includeChatbotOnly: true on search and reads — also return articles you marked chatbot-only. Listings, sitemaps and llms.txt still leave them out.

  • timeoutMs on the client, and an AbortSignal on help.chat() and help.chatStream(). Node's fetch has no deadline of its own.

The recipe is in Read your help center from your own AI assistant.

Also in this release

  • An existing conversation is replayed from the messages the server itself stored, so a caller cannot seed the model with assistant turns it never produced.

  • A turn refused for an exhausted allowance now returns an HTTP status and leaves no empty conversation behind.

  • A turn stopped or disconnected mid-answer is billed only for what it had already spent, and stored with what the visitor saw.

Requires @kookee/sdk and @kookee/react 1.8.0. The script-tag widget at kookee.dev/chat/latest.js updates itself.

Learn more