agent-relay-server 0.15.0 → 0.15.1
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/db.ts +5 -0
package/package.json
CHANGED
package/src/db.ts
CHANGED
|
@@ -193,6 +193,11 @@ export function initDb(path: string = "agent-relay.db"): Database {
|
|
|
193
193
|
CREATE INDEX IF NOT EXISTS idx_msg_to ON messages(to_target);
|
|
194
194
|
CREATE INDEX IF NOT EXISTS idx_msg_created ON messages(created_at);
|
|
195
195
|
CREATE INDEX IF NOT EXISTS idx_msg_channel ON messages(channel);
|
|
196
|
+
-- (reply_to, from_agent) powers the reply-obligation NOT EXISTS subquery in
|
|
197
|
+
-- listPendingReplyObligations. Without it that subquery full-scans messages
|
|
198
|
+
-- per candidate row (O(n^2)): ~8.6s at 4k rows, which blew the 5s Stop-hook
|
|
199
|
+
-- timeout and wedged turns in "busy" (#199).
|
|
200
|
+
CREATE INDEX IF NOT EXISTS idx_msg_reply_to ON messages(reply_to, from_agent);
|
|
196
201
|
|
|
197
202
|
CREATE TABLE IF NOT EXISTS message_reactions (
|
|
198
203
|
message_id INTEGER NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
|