agent-relay-server 0.119.9 → 0.119.10

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/docs/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Relay API",
5
- "version": "0.119.9",
5
+ "version": "0.119.10",
6
6
  "description": "Real-time message bus for inter-agent communication. Agent-first: this spec is designed for machine consumption — agents can self-discover the full API surface via GET /api/spec.",
7
7
  "license": {
8
8
  "name": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-server",
3
- "version": "0.119.9",
3
+ "version": "0.119.10",
4
4
  "description": "Lightweight HTTP message relay for inter-agent communication across machines",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "CONTRIBUTING.md"
38
38
  ],
39
39
  "dependencies": {
40
- "agent-relay-channels-host": "0.119.9",
40
+ "agent-relay-channels-host": "0.119.10",
41
41
  "agent-relay-providers": "0.104.3",
42
42
  "agent-relay-sdk": "0.2.106",
43
43
  "ajv": "^8.20.0"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-relay-runner",
3
3
  "description": "Thin Agent Relay runner bridge for Claude Code",
4
- "version": "0.119.9",
4
+ "version": "0.119.10",
5
5
  "agentRelayContracts": {
6
6
  "providerPluginProtocol": 1
7
7
  }
@@ -229,6 +229,8 @@ export function applyMigrations(): void {
229
229
  const colNames = cols.map((c: any) => c.name);
230
230
  if (!colNames.includes("thread_id")) {
231
231
  getDb().run("ALTER TABLE messages ADD COLUMN thread_id INTEGER");
232
+ }
233
+ if (!colNames.includes("reply_to")) {
232
234
  getDb().run("ALTER TABLE messages ADD COLUMN reply_to INTEGER REFERENCES messages(id)");
233
235
  }
234
236
  if (!colNames.includes("reply_expected")) {
@@ -281,6 +283,10 @@ export function applyMigrations(): void {
281
283
  "UPDATE messages SET claim_expires_at = coalesce(claimed_at, ?) + ? WHERE claimed_by IS NOT NULL AND claim_expires_at IS NULL",
282
284
  ).run(Date.now(), CLAIM_LEASE_MS);
283
285
  getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_thread ON messages(thread_id)");
286
+ // (reply_to, from_agent) powers the reply-obligation NOT EXISTS subquery in
287
+ // listPendingReplyObligations. It must stay migration-owned because reply_to is
288
+ // an ALTER-added column on legacy DBs (#963).
289
+ getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_reply_to ON messages(reply_to, from_agent)");
284
290
  getDb().run("CREATE UNIQUE INDEX IF NOT EXISTS idx_msg_idempotency ON messages(from_agent, idempotency_key) WHERE idempotency_key IS NOT NULL");
285
291
  getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_delivery_status ON messages(delivery_status)");
286
292
  getDb().run("CREATE INDEX IF NOT EXISTS idx_msg_claimed_expires ON messages(claimed_by, claim_expires_at, id) WHERE claimed_by IS NOT NULL");
package/src/db/schema.ts CHANGED
@@ -163,14 +163,10 @@ export function initDb(path: string = "agent-relay.db"): Database {
163
163
  -- queries (delivery, polling, etc.) are served identically.
164
164
  -- idx_msg_resolved_to_id is created in applyMigrations() AFTER the
165
165
  -- resolved_to_agent ALTER — never inline here (same hazard as #483/#559).
166
+ -- idx_msg_reply_to is also migration-owned because reply_to was added by ALTER.
166
167
  CREATE INDEX IF NOT EXISTS idx_msg_to_id ON messages(to_target, id);
167
168
  CREATE INDEX IF NOT EXISTS idx_msg_created ON messages(created_at);
168
169
  CREATE INDEX IF NOT EXISTS idx_msg_channel ON messages(channel);
169
- -- (reply_to, from_agent) powers the reply-obligation NOT EXISTS subquery in
170
- -- listPendingReplyObligations. Without it that subquery full-scans messages
171
- -- per candidate row (O(n^2)): ~8.6s at 4k rows, which blew the 5s Stop-hook
172
- -- timeout and wedged turns in "busy" (#199).
173
- CREATE INDEX IF NOT EXISTS idx_msg_reply_to ON messages(reply_to, from_agent);
174
170
  CREATE TABLE IF NOT EXISTS scheduled_timers (
175
171
  id TEXT PRIMARY KEY,
176
172
  target TEXT NOT NULL,
@@ -597,7 +593,7 @@ export function initDb(path: string = "agent-relay.db"): Database {
597
593
  cleaned_at INTEGER
598
594
  );
599
595
  CREATE INDEX IF NOT EXISTS idx_workspaces_repo_status ON workspaces(repo_root, status);
600
- CREATE INDEX IF NOT EXISTS idx_workspaces_orchestrator ON workspaces(orchestrator_id);
596
+ -- idx_workspaces_orchestrator created in applyMigrations() AFTER orchestrator_id ALTER (#949)
601
597
  CREATE INDEX IF NOT EXISTS idx_workspaces_owner_agent ON workspaces(owner_agent_id);
602
598
  CREATE INDEX IF NOT EXISTS idx_workspaces_policy ON workspaces(owner_policy_name);
603
599