opencode-auto-resume 1.0.20 → 1.0.21
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/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12700,6 +12700,14 @@ var AutoResumePlugin = async (ctx, options) => {
|
|
|
12700
12700
|
}
|
|
12701
12701
|
async function checkSessionHasActiveTool(sid) {
|
|
12702
12702
|
try {
|
|
12703
|
+
const listResponse = await ctx.client.session.list();
|
|
12704
|
+
const sessions2 = extractMessages(listResponse);
|
|
12705
|
+
const currentSession = sessions2.find((s) => s.id === sid);
|
|
12706
|
+
const status = currentSession?.status;
|
|
12707
|
+
if (status === "busy") {
|
|
12708
|
+
await log("debug", `Session ${short(sid)} is busy, likely executing a tool`);
|
|
12709
|
+
return true;
|
|
12710
|
+
}
|
|
12703
12711
|
const response = await ctx.client.session.messages({ path: { id: sid } });
|
|
12704
12712
|
const messages = extractMessages(response);
|
|
12705
12713
|
const lastMsg = messages[messages.length - 1];
|
package/package.json
CHANGED