agents-relay 2.0.96 → 2.0.97

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/dist/cli-help.js CHANGED
@@ -58,7 +58,7 @@ Required: --repo OWNER/REPO --pr NUMBER --id JOB_ID.
58
58
  Optional: --thread-id THREAD_ID persists a reviewer override; omitted uses Job reviewer/creator thread or legacy route. Rejects pending reviews and wakes managed reconciliation.`,
59
59
  'job create': `Create a SQLite-authoritative Job (objective-only).
60
60
 
61
- Required: --repo OWNER/REPO and a standalone Job objective. Job ID defaults to an auto-incrementing repository-scoped number; --id is optional for compatibility. Existing PR adoption is an explicit separate command: job adopt.
61
+ Required: --repo OWNER/REPO and a standalone Job objective. Job ID defaults to an auto-incrementing store-global number; --id is optional for compatibility. Existing PR adoption is an explicit separate command: job adopt.
62
62
  Common: --id JOB_ID (optional), --title TEXT, --objective-file PATH|- (preferred), --objective MARKDOWN (short/simple only), --project-path RELATIVE_PATH, --priority P0|P1|P2|P3, --mode fixed|autonomous, --initial-plan, --no-review, --tag JSON, --reviewer-thread-id ID, --creator-thread-id ID, --implementation-thread-id ID. --objective and --objective-file are mutually exclusive.
63
63
  Job creation always enables auto-merge. By default it is create-only; --initial-plan validates the first real Planner round before atomically creating the durable Job and Plan, then publishes the normal wake so Relay can continue without a second orchestrator command. Re-running create against an already healthy Job is idempotent and does not mutate its metadata.
64
64
 
@@ -14,14 +14,17 @@ export function isGeneratedEntityId(id, repository, kind) {
14
14
  const legacyPrefix = generatedEntityPrefix(repository, kind);
15
15
  return id.startsWith(legacyPrefix) && /^[0-9]+$/.test(id.slice(legacyPrefix.length));
16
16
  }
17
+ if (/^[1-9][0-9]*$/.test(id))
18
+ return true;
17
19
  const prefix = generatedEntityPrefix(repository, kind);
18
20
  return id.startsWith(prefix) && /^[0-9]+$/.test(id.slice(prefix.length));
19
21
  }
20
- /** Jobs remain repository-scoped. Task IDs are one Relay-global monotonically increasing integer sequence. Allocation is serialized by SQLite. */
22
+ /** Job and Task IDs each use their own store-global sequence. SQLite serializes allocation; legacy identifiers remain readable. */
21
23
  export function allocateEntityId(directory, repository, kind, requestKey, occupied = new Set()) {
22
- const prefix = kind === 'job' ? generatedEntityPrefix(repository, kind) : '';
23
- const scope = kind === 'task' ? '*' : repository;
24
- const scopedRequestKey = requestKey && kind === 'task' ? `${repository}:${requestKey}` : requestKey;
24
+ generatedEntityPrefix(repository, kind); // validate repository even though its name no longer appears in the ID
25
+ const prefix = '';
26
+ const scope = '*';
27
+ const scopedRequestKey = requestKey ? `${repository}:${requestKey}` : undefined;
25
28
  if (requestKey !== undefined && (!requestKey || requestKey.length > 512))
26
29
  throw new Error('Invalid idempotency key');
27
30
  mkdirSync(directory, { recursive: true });
@@ -39,6 +42,7 @@ export function allocateEntityId(directory, repository, kind, requestKey, occupi
39
42
  }
40
43
  }
41
44
  const old = db.prepare('SELECT value FROM sequences WHERE repository=? AND kind=?').get(scope, kind);
45
+ // Existing generated numeric IDs across all repositories are reserved by the caller.
42
46
  let next = (old?.value ?? 0) + 1;
43
47
  while (occupied.has(prefix + next))
44
48
  next++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.96",
3
+ "version": "2.0.97",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,6 +24,14 @@ The initial decomposition belongs to that durable Planner round. The orchestrato
24
24
 
25
25
  ## P0 / self job workflow
26
26
 
27
+ For a self Job owned by the current XChat thread, resolve the current thread ID
28
+ before creating the Job. If it cannot be retrieved reliably, ask the user for
29
+ the thread ID before proceeding. Set `creatorThreadId`,
30
+ `implementationThreadId`, and `reviewerThreadId` to that same thread ID at
31
+ creation, using the corresponding `--creator-thread-id`,
32
+ `--implementation-thread-id`, and `--reviewer-thread-id` options. Do not infer
33
+ the thread ID from an unrelated worker, execution, or previous conversation.
34
+
27
35
  P0/self work is ordinary durable Relay work. The orchestrator may choose normal
28
36
  Task requirements, but every newly created work Task is executable by a
29
37
  worker/model route selected by Execution Router. Relay has no privileged