@inetafrica/open-claudia 2.2.23 → 2.2.24
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/CHANGELOG.md +3 -0
- package/core/scheduler.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v2.2.24
|
|
4
|
+
- Fix one-shot wakeups being lost across restarts when their fire collided with a busy channel. `fireJob` removed the wakeup from `jobs.json` as soon as it returned — but on a busy channel the actual run was deferred to an in-memory 30s retry timer, so the job was already gone from disk and a bot restart during the deferral window (e.g. `/upgrade`) silently dropped it. The wakeup now stays persisted until it actually runs (or is conclusively skipped after retries); a restart mid-deferral re-arms it from `jobs.json` via the existing missed-wakeup grace pass.
|
|
5
|
+
|
|
3
6
|
## v2.2.23
|
|
4
7
|
- **Token economy: tasks (R2).** The per-channel todo list no longer rides every prompt at full size.
|
|
5
8
|
- **Done means gone**: completing a task now deletes it from the store instead of leaving an `[x]` row. Finishing the last subtask of a plan deletes the whole plan. `tasks.complete()` wraps the status flip plus a `prune()` pass; the loopback `task-update` handler routes `status: completed` through it and reports how many entries were removed, so the CLI can tell the agent what disappeared. `prune()` also retires legacy debris — plans whose subtasks are all completed but whose own status was never flipped.
|
package/core/scheduler.js
CHANGED
|
@@ -78,11 +78,13 @@ async function fireJob(job, retry = 0) {
|
|
|
78
78
|
raw: null,
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
let deferred = false;
|
|
81
82
|
await runInChat(ctx, async () => {
|
|
82
83
|
const state = getUserState(canonicalUserId);
|
|
83
84
|
if (state.runningProcess) {
|
|
84
85
|
if (retry < 4) {
|
|
85
86
|
console.log(`scheduler: ${job.id} busy, deferring ${DEFER_BUSY_MS / 1000}s (retry ${retry + 1})`);
|
|
87
|
+
deferred = true;
|
|
86
88
|
setTimeout(() => fireJob(job, retry + 1), DEFER_BUSY_MS);
|
|
87
89
|
return;
|
|
88
90
|
}
|
|
@@ -115,7 +117,11 @@ async function fireJob(job, retry = 0) {
|
|
|
115
117
|
}
|
|
116
118
|
});
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
// Only delete a one-shot wakeup once it actually ran (or was skipped).
|
|
121
|
+
// Removing it while a busy-deferral is pending would leave the retry
|
|
122
|
+
// living only in an in-memory setTimeout — a restart during that
|
|
123
|
+
// window (e.g. /upgrade) would silently lose the wakeup.
|
|
124
|
+
if (job.kind === "wakeup" && !deferred) {
|
|
119
125
|
jobs.remove(job.id);
|
|
120
126
|
timers.delete(job.id);
|
|
121
127
|
}
|
package/package.json
CHANGED