@commonlyai/cli 0.1.281 → 0.1.282
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/enforcement.js +4 -1
package/package.json
CHANGED
package/src/lib/enforcement.js
CHANGED
|
@@ -883,7 +883,10 @@ export const deliverChatReply = async ({
|
|
|
883
883
|
// is present, because a continuation posted with a missing root would
|
|
884
884
|
// silently become another top-level message — the exact flood this rung
|
|
885
885
|
// exists to prevent.
|
|
886
|
-
|
|
886
|
+
// The kernel can file the headline in the thread the turn answers (F245),
|
|
887
|
+
// and a thread has one root, so its root wins over the headline's own id.
|
|
888
|
+
const rootId = rootRes?.message?.thread_root_id
|
|
889
|
+
?? rootRes?.message?.id ?? rootRes?.message?._id ?? rootRes?.id ?? rootRes?._id;
|
|
887
890
|
if (!rootId) throw new Error('no message id in post response — cannot root the thread');
|
|
888
891
|
for (const chunk of chunks.slice(1)) {
|
|
889
892
|
// eslint-disable-next-line no-await-in-loop
|