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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/db.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-server",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Lightweight HTTP message relay for inter-agent communication across machines",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
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,