feat(zulip): streaming responses + steering via session injection #23
@@ -590,8 +590,9 @@ export default function (pi: ExtensionAPI) {
|
||||
if (!pending || !pending.zulipMessageId) return;
|
||||
|
||||
try {
|
||||
const preview = streamingAccumulator.length > 1800
|
||||
? streamingAccumulator.slice(0, 1800) + "\n\n_… still generating…_"
|
||||
const MAX_PREVIEW = 9500;
|
||||
const preview = streamingAccumulator.length > MAX_PREVIEW
|
||||
? streamingAccumulator.slice(0, MAX_PREVIEW) + "\n\n_… still generating…_"
|
||||
: streamingAccumulator;
|
||||
await queue!.editMessage(pending.zulipMessageId, preview);
|
||||
} catch {
|
||||
@@ -646,8 +647,9 @@ export default function (pi: ExtensionAPI) {
|
||||
return;
|
||||
}
|
||||
|
||||
const truncated = responseText.length > 1500
|
||||
? responseText.slice(0, 1500) + "\n\n[...truncated, see session for full output]"
|
||||
const MAX_ZULIP_MSG = 10000;
|
||||
const truncated = responseText.length > MAX_ZULIP_MSG
|
||||
? responseText.slice(0, MAX_ZULIP_MSG) + "\n\n[...truncated at Zulip limit, see session for full output]"
|
||||
: responseText;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user