@thoughtminers/agent-runtime-redis 0.0.0-stage → 0.1.0
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/README.md +43 -2
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +134 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -4
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @thoughtminers/agent-runtime-redis
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Cross-instance **supersede** `Lock` for `@thoughtminers/agent-runtime-core`.
|
|
4
|
+
|
|
5
|
+
The in-memory lock only serializes within one process; behind a load balancer with
|
|
6
|
+
no session affinity (Cloud Run, k8s), rapid messages for one conversation land on
|
|
7
|
+
different instances and race. This lock coordinates through Redis so a newer message
|
|
8
|
+
aborts the in-flight run on **any** instance and processes with the fuller context.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import Redis from 'ioredis';
|
|
12
|
+
import { createRedisLock } from '@thoughtminers/agent-runtime-redis';
|
|
13
|
+
|
|
14
|
+
const lock = createRedisLock(new Redis(process.env.REDIS_URL!));
|
|
15
|
+
// createAgent({ ..., lock });
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Client-agnostic: it needs only a small `RedisLike` surface (`incr`, `pexpire`,
|
|
19
|
+
`set … NX PX`, `get`, `eval`) — `ioredis` satisfies it as-is; no peer dependency.
|
|
20
|
+
|
|
21
|
+
## How it works (poll-based, one connection, no pub/sub)
|
|
22
|
+
|
|
23
|
+
- `INCR arl:gen:{id}` → a monotonic generation; the highest is the newest claimant.
|
|
24
|
+
- `SET arl:lock:{id} <gen> NX PX ttl` → the mutex, retried until the prior holder frees it.
|
|
25
|
+
- a background poller (`pollMs`, default 250) aborts the lease the moment a newer
|
|
26
|
+
generation appears, and heartbeats the lock TTL while held.
|
|
27
|
+
- release is a Lua compare-and-del — it never deletes another holder's lock.
|
|
28
|
+
|
|
29
|
+
Abort latency ≈ `pollMs`. **Fails safe:** any Redis error degrades to a no-op lease
|
|
30
|
+
(no serialization) instead of throwing — a reply matters more than strict ordering.
|
|
31
|
+
|
|
32
|
+
## Options
|
|
33
|
+
|
|
34
|
+
| Option | Default | |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| `keyPrefix` | `arl` | key namespace |
|
|
37
|
+
| `ttlMs` | `30_000` | lock lease TTL (heartbeated while held) |
|
|
38
|
+
| `pollMs` | `250` | supersede-check / heartbeat interval (≈ abort latency) |
|
|
39
|
+
| `acquireTimeoutMs` | `60_000` | max wait before degrading (proceed without the lock) |
|
|
40
|
+
| `genTtlMs` | `3_600_000` | TTL on the generation counter |
|
|
41
|
+
| `onError` | noop | called on any Redis error (the lock degrades) |
|
|
42
|
+
|
|
43
|
+
Testing: `pnpm test` runs deterministic fake-Redis unit tests; the integration test is
|
|
44
|
+
env-gated — `REDIS_URL=redis://localhost:6399 pnpm test` against a real Redis.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Lock } from '@thoughtminers/agent-runtime-core';
|
|
2
|
+
/**
|
|
3
|
+
* The minimal Redis surface this adapter needs. `ioredis` satisfies it as-is
|
|
4
|
+
* (`new Redis(url)`), so the package stays client-agnostic and dependency-free.
|
|
5
|
+
*/
|
|
6
|
+
export interface RedisLike {
|
|
7
|
+
incr(key: string): Promise<number>;
|
|
8
|
+
pexpire(key: string, ms: number): Promise<number>;
|
|
9
|
+
set(key: string, value: string, px: 'PX', ttlMs: number, nx: 'NX'): Promise<string | null>;
|
|
10
|
+
get(key: string): Promise<string | null>;
|
|
11
|
+
eval(script: string, numkeys: number, ...args: (string | number)[]): Promise<unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface RedisLockOptions {
|
|
14
|
+
/** Key namespace. Default `arl`. */
|
|
15
|
+
keyPrefix?: string;
|
|
16
|
+
/** Lock lease TTL in ms (heartbeated while held). Default 30_000. */
|
|
17
|
+
ttlMs?: number;
|
|
18
|
+
/** Supersede-check / heartbeat interval in ms. Also the abort latency. Default 250. */
|
|
19
|
+
pollMs?: number;
|
|
20
|
+
/** Max wait to acquire before degrading (proceed without the lock). Default 60_000. */
|
|
21
|
+
acquireTimeoutMs?: number;
|
|
22
|
+
/** TTL on the per-conversation generation counter. Default 1h. */
|
|
23
|
+
genTtlMs?: number;
|
|
24
|
+
/** Called on any Redis error; the lock degrades (never drops a message). */
|
|
25
|
+
onError?: (err: unknown) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Cross-instance per-conversation **supersede** lock (matches the harness
|
|
29
|
+
* `Lock` contract). A newer `claim` for a conversation aborts the in-flight
|
|
30
|
+
* lease on ANY instance and processes with the fuller context.
|
|
31
|
+
*
|
|
32
|
+
* Mechanism (poll-based — one Redis connection, no pub/sub):
|
|
33
|
+
* - `INCR arl:gen:{id}` → a monotonic generation; the highest is the newest claimant.
|
|
34
|
+
* - `SET arl:lock:{id} <gen> NX PX ttl` → the mutex; retried until the prior
|
|
35
|
+
* holder releases (its poller sees the newer gen, aborts, releases).
|
|
36
|
+
* - a background poller (every `pollMs`) aborts the lease when a newer gen
|
|
37
|
+
* appears, and heartbeats the lock TTL while held.
|
|
38
|
+
* - release is a compare-and-del (Lua) so we never delete someone else's lock.
|
|
39
|
+
*
|
|
40
|
+
* Fails safe: any Redis error degrades to a no-op lease (no serialization)
|
|
41
|
+
* rather than throwing — a reply matters more than strict ordering.
|
|
42
|
+
*/
|
|
43
|
+
export declare const createRedisLock: (redis: RedisLike, opts?: RedisLockOptions) => Lock;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3F,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvF;AAED,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAWD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,SAAS,EAAE,OAAM,gBAAqB,KAAG,IA8G/E,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Compare-and-delete: only release the lock if we still own the token.
|
|
2
|
+
const RELEASE_LUA = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end";
|
|
3
|
+
const noopLease = () => ({
|
|
4
|
+
signal: new AbortController().signal, // never fires
|
|
5
|
+
release: async () => { },
|
|
6
|
+
});
|
|
7
|
+
/**
|
|
8
|
+
* Cross-instance per-conversation **supersede** lock (matches the harness
|
|
9
|
+
* `Lock` contract). A newer `claim` for a conversation aborts the in-flight
|
|
10
|
+
* lease on ANY instance and processes with the fuller context.
|
|
11
|
+
*
|
|
12
|
+
* Mechanism (poll-based — one Redis connection, no pub/sub):
|
|
13
|
+
* - `INCR arl:gen:{id}` → a monotonic generation; the highest is the newest claimant.
|
|
14
|
+
* - `SET arl:lock:{id} <gen> NX PX ttl` → the mutex; retried until the prior
|
|
15
|
+
* holder releases (its poller sees the newer gen, aborts, releases).
|
|
16
|
+
* - a background poller (every `pollMs`) aborts the lease when a newer gen
|
|
17
|
+
* appears, and heartbeats the lock TTL while held.
|
|
18
|
+
* - release is a compare-and-del (Lua) so we never delete someone else's lock.
|
|
19
|
+
*
|
|
20
|
+
* Fails safe: any Redis error degrades to a no-op lease (no serialization)
|
|
21
|
+
* rather than throwing — a reply matters more than strict ordering.
|
|
22
|
+
*/
|
|
23
|
+
export const createRedisLock = (redis, opts = {}) => {
|
|
24
|
+
const prefix = opts.keyPrefix ?? 'arl';
|
|
25
|
+
const ttlMs = opts.ttlMs ?? 30_000;
|
|
26
|
+
const pollMs = opts.pollMs ?? 250;
|
|
27
|
+
const acquireTimeoutMs = opts.acquireTimeoutMs ?? 60_000;
|
|
28
|
+
const genTtlMs = opts.genTtlMs ?? 3_600_000;
|
|
29
|
+
const onError = opts.onError ?? (() => { });
|
|
30
|
+
const lockKey = (id) => `${prefix}:lock:${id}`;
|
|
31
|
+
const genKey = (id) => `${prefix}:gen:${id}`;
|
|
32
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
33
|
+
return {
|
|
34
|
+
claim: async (conversationId) => {
|
|
35
|
+
const lk = lockKey(conversationId);
|
|
36
|
+
const gk = genKey(conversationId);
|
|
37
|
+
let myGen;
|
|
38
|
+
try {
|
|
39
|
+
myGen = await redis.incr(gk);
|
|
40
|
+
await redis.pexpire(gk, genTtlMs);
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
onError(err); // Redis unreachable → degrade, don't drop the message.
|
|
44
|
+
return noopLease();
|
|
45
|
+
}
|
|
46
|
+
const token = String(myGen);
|
|
47
|
+
const controller = new AbortController();
|
|
48
|
+
let held = false;
|
|
49
|
+
let released = false;
|
|
50
|
+
let poller;
|
|
51
|
+
const stopPoller = () => {
|
|
52
|
+
if (poller) {
|
|
53
|
+
clearInterval(poller);
|
|
54
|
+
poller = undefined;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
poller = setInterval(() => {
|
|
58
|
+
void (async () => {
|
|
59
|
+
try {
|
|
60
|
+
const cur = await redis.get(gk);
|
|
61
|
+
if (cur !== null && Number(cur) > myGen) {
|
|
62
|
+
controller.abort(); // superseded by a newer claim
|
|
63
|
+
stopPoller();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (held)
|
|
67
|
+
await redis.pexpire(lk, ttlMs); // heartbeat only while holding
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
onError(err);
|
|
71
|
+
}
|
|
72
|
+
})();
|
|
73
|
+
}, pollMs);
|
|
74
|
+
poller.unref();
|
|
75
|
+
const lease = {
|
|
76
|
+
signal: controller.signal,
|
|
77
|
+
release: async () => {
|
|
78
|
+
if (released)
|
|
79
|
+
return;
|
|
80
|
+
released = true;
|
|
81
|
+
stopPoller();
|
|
82
|
+
try {
|
|
83
|
+
await redis.eval(RELEASE_LUA, 1, lk, token);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
onError(err);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const deadline = Date.now() + acquireTimeoutMs;
|
|
91
|
+
while (true) {
|
|
92
|
+
if (controller.signal.aborted) {
|
|
93
|
+
// Superseded before acquiring — the run will see signal.aborted and
|
|
94
|
+
// exit interrupted. We hold no key, so nothing to release.
|
|
95
|
+
stopPoller();
|
|
96
|
+
return { signal: controller.signal, release: async () => { } };
|
|
97
|
+
}
|
|
98
|
+
let ok = null;
|
|
99
|
+
try {
|
|
100
|
+
ok = await redis.set(lk, token, 'PX', ttlMs, 'NX');
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
onError(err);
|
|
104
|
+
stopPoller();
|
|
105
|
+
return noopLease(); // degrade
|
|
106
|
+
}
|
|
107
|
+
if (ok) {
|
|
108
|
+
// Acquired. Close the acquire↔supersede race: re-check the generation.
|
|
109
|
+
let cur = null;
|
|
110
|
+
try {
|
|
111
|
+
cur = await redis.get(gk);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
onError(err);
|
|
115
|
+
}
|
|
116
|
+
if (controller.signal.aborted || (cur !== null && Number(cur) > myGen)) {
|
|
117
|
+
await lease.release();
|
|
118
|
+
return { signal: controller.signal, release: async () => { } };
|
|
119
|
+
}
|
|
120
|
+
held = true;
|
|
121
|
+
return lease;
|
|
122
|
+
}
|
|
123
|
+
if (Date.now() > deadline) {
|
|
124
|
+
// Stuck prior holder — degrade rather than drop. The poller still
|
|
125
|
+
// aborts us if a newer claim arrives; release() Lua no-ops (not owner).
|
|
126
|
+
onError(new Error(`agent-runtime-redis: acquire timeout for "${conversationId}"`));
|
|
127
|
+
return lease;
|
|
128
|
+
}
|
|
129
|
+
await sleep(pollMs);
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,uEAAuE;AACvE,MAAM,WAAW,GACf,mGAAmG,CAAC;AAEtG,MAAM,SAAS,GAAG,GAAU,EAAE,CA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,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;oBAC5B,CAAC;oBAAC,OAAO,GAAG,EAAE,CAAC;wBACb,OAAO,CAAC,GAAG,CAAC,CAAC;oBACf,CAAC;oBACD,IAAI,UAAU,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;wBACvE,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,EAAE,CAAC;oBAChE,CAAC;oBACD,IAAI,GAAG,IAAI,CAAC;oBACZ,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;oBAC1B,kEAAkE;oBAClE,wEAAwE;oBACxE,OAAO,CAAC,IAAI,KAAK,CAAC,6CAA6C,cAAc,GAAG,CAAC,CAAC,CAAC;oBACnF,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtminers/agent-runtime-redis",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Redis cross-instance supersede Lock adapter for @thoughtminers/agent-runtime-core (client-agnostic via a structural RedisLike interface).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/thoughtminers/agent-runtime-core.git",
|
|
9
|
+
"directory": "packages/redis"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/thoughtminers/agent-runtime-core#readme",
|
|
12
|
+
"bugs": "https://github.com/thoughtminers/agent-runtime-core/issues",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=24"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc --build",
|
|
31
|
+
"prepublishOnly": "tsc --build --force",
|
|
32
|
+
"test": "node --test 'test/**/*.test.ts'"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@thoughtminers/agent-runtime-core": "workspace:*"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^24.0.0",
|
|
39
|
+
"ioredis": "^5.4.0",
|
|
40
|
+
"typescript": "^5.8.0"
|
|
41
|
+
}
|
|
42
|
+
}
|