Why stopping a stream visually implies nothing about network closure, and how to fix it.
When a user clicks "Stop Generation", simply wiping the interface text buffer does not sever the underlying TCP connection to Anthropic or OpenAI. The lab will continue to compute tokens and bill your account in the background.
We strictly mandate the binding of native `AbortController` signals to every single HTTP `fetch()` request generated by Duplex.
const controller = new AbortController();
fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
signal: controller.signal
});
// To stop billing immediately:
controller.abort();