agents-relay 2.0.182 → 2.0.184

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 CHANGED
@@ -249,6 +249,13 @@ Every model-backed task declares a durable output with `--output task-pr` or `--
249
249
 
250
250
  For Codex and ChatGPT, **correlated worker events are authoritative lifecycle inputs**, not a separate durable store. Event publication uses the canonical Neo `events-bus` surface (`events__publish` for sandboxed/hosted workers, or `NEO_EVENTS_EMIT` for direct local workers); Agents Relay subscribes, validates correlation, applies graph transitions, persists results in RelayStore, and projects them to GitHub. Relay publishes `task.process.launched` only after successful adapter launch; `task.started` is worker-owned and must be a new, correlated start acknowledgement. Codex publishes `task.process.exited` when its synchronous runtime exits, while ChatGPT publishes `task.process.async_exited` after its one-shot submission runtime exits; neither substitutes for `task.completed`, `task.failed`, `task.blocked`, or `task.cancelled`. The executing agent must publish exactly one correlated terminal event. Relay persists the matching durable state only from that terminal event. Model-backed tasks require an event bus and time out explicitly if no terminal event arrives.
251
251
 
252
+ External execution uses the single global `webhelm` executable installed by the
253
+ WebHelm skill. Before starting Relay, install the global skill and its launcher
254
+ (`npx skills add lalalic/browser-workspace -g -y -s webhelm`, then
255
+ `~/.agents/skills/webhelm/scripts/install-global-cli.sh`). Relay checks
256
+ `webhelm platform profile chatgpt` before browser workspace initialization.
257
+ Do not invoke the old `browser-workspace` executable or a separate `uvx` CLI.
258
+
252
259
  The ChatGPT adapter uses Relay's `agents/chatgpt-worker.agent.md` lifecycle contract. A new worker uses `webhelm platform run chatgpt new-thread --session-id SESSION_ID --config <file>` in a caller-owned Session. This is a regular persistent ChatGPT thread, which supports the connected Neo MCP in the verified account. Relay closes the Session after submission, but the ChatGPT thread remains in history. Existing-thread review and handoff continue through `new-turn`. File paths are included in the worker message for Neo MCP reading; they are not uploaded as browser attachments. Submission receipts retain `status: submitted`; the event bus owns task completion.
253
260
 
254
261
  ~~~sh
@@ -300,7 +307,7 @@ For every Job, unblock evidence becomes durable recovery context. Relay retries
300
307
 
301
308
  ### Browser Workspace product boundary
302
309
 
303
- Agents Relay owns the persistent `Relay` browser workspace as product infrastructure. At daemon startup it runs `webhelm status`, dynamically imports the returned absolute `admin_helper`, and calls `ensureWorkspace("Relay", 6)`. This bootstrap is best-effort: Browser Workspace discovery/helper failures are logged and skipped so they do not prevent `agents-relayd` from starting; ChatGPT browser work may remain unavailable until Browser Workspace recovers. Ordinary ChatGPT worker activity uses the public Browser Workspace one-shot `platform run ... --auto-session` command; orchestrator-owned self-healing flows may still use explicit session commands. Relay does not create or delete workspaces through CLI lifecycle commands.
310
+ Agents Relay owns the persistent `Relay` browser workspace as product infrastructure. At daemon startup it runs `webhelm status`, dynamically imports the returned absolute `admin_helper`, and calls `ensureWorkspace("Relay", 6)`. This bootstrap is best-effort: Browser Workspace discovery/helper failures are logged and skipped so they do not prevent `agents-relayd` from starting; ChatGPT browser work may remain unavailable until Browser Workspace recovers. New ChatGPT workers use a Relay-owned browser Session and close it after verified submission. Existing-thread `new-turn` messages use the durable async queue directly, without creating a browser Session. Relay does not create or delete workspaces through CLI lifecycle commands.
304
311
 
305
312
  ## Shared publication reporting
306
313
 
package/dist/adapters.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { access, readFile, realpath, writeFile, unlink } from 'node:fs/promises';
2
2
  import { join, relative, resolve, sep, basename } from 'node:path';
3
+ import { homedir } from 'node:os';
3
4
  import { DEFAULT_PROMPT_REFERENCE_DIRECTORY } from './agent-prompt-builder.js';
4
5
  import { pathToFileURL } from 'node:url';
5
6
  import { createHash, randomUUID } from 'node:crypto';
@@ -168,7 +169,7 @@ export function parseDriverJson(output) {
168
169
  throw new Error('browser-worker driver returned no submitted receipt');
169
170
  }
170
171
  function browserWorkspaceCli(override = process.env.AGENTS_RELAY_WEBHELM_COMMAND) {
171
- return override ? { command: override, prefix: [] } : { command: 'uvx', prefix: ['--from', 'browser-workspace', 'webhelm'] };
172
+ return { command: override || join(homedir(), '.local', 'bin', 'webhelm'), prefix: [] };
172
173
  }
173
174
  function browserWorkspaceCommand(cli, args, stdin, signal) {
174
175
  return rawBrowserWorkspaceCommand(cli, args, stdin, signal);
@@ -270,7 +271,11 @@ async function accessiblePromptReferences(prompt) {
270
271
  return readable;
271
272
  }
272
273
  export async function ensureChatGptBrowserWorkspace(command = process.env.AGENTS_RELAY_WEBHELM_COMMAND) {
273
- const status = parseWorkspaceJson(await browserWorkspaceCommand(browserWorkspaceCli(command), ['status']));
274
+ const cli = browserWorkspaceCli(command);
275
+ const profile = parseWorkspaceJson(await browserWorkspaceCommand(cli, ['platform', 'profile', 'chatgpt']));
276
+ if (profile.platform !== 'chatgpt')
277
+ throw new Error('Global WebHelm CLI cannot load the ChatGPT platform skill');
278
+ const status = parseWorkspaceJson(await browserWorkspaceCommand(cli, ['status']));
274
279
  if (typeof status.admin_helper !== 'string' || !status.admin_helper.startsWith('/')) {
275
280
  throw new Error('webhelm status returned no absolute admin_helper path');
276
281
  }
@@ -281,12 +286,16 @@ export async function ensureChatGptBrowserWorkspace(command = process.env.AGENTS
281
286
  await admin.ensureWorkspace(CHATGPT_BROWSER_WORKSPACE, CHATGPT_BROWSER_WORKSPACE_POOL_SIZE);
282
287
  }
283
288
  async function runBrowserWorker(cli, configFile, signal, action = 'new-thread') {
289
+ // Durable async turns are queued without browser sessions by the WebHelm runtime.
290
+ if (action === 'new-turn') {
291
+ return browserWorkspaceCommand(cli, ['platform', 'run', 'chatgpt', 'new-turn', '--mode', 'async', '--config', configFile], undefined, signal);
292
+ }
284
293
  const session = parseWorkspaceJson(await browserWorkspaceCommand(cli, ['session', 'start', '--workspace', CHATGPT_BROWSER_WORKSPACE], undefined, signal));
285
294
  const sessionId = session.session_id;
286
295
  if (typeof sessionId !== 'string' || !sessionId)
287
296
  throw new Error('webhelm session start returned no session_id');
288
297
  try {
289
- return await browserWorkspaceCommand(cli, ['platform', 'run', 'chatgpt', action, ...(action === 'new-turn' ? ['--mode', 'async'] : []), '--session-id', sessionId, '--config', configFile], undefined, signal);
298
+ return await browserWorkspaceCommand(cli, ['platform', 'run', 'chatgpt', action, '--session-id', sessionId, '--config', configFile], undefined, signal);
290
299
  }
291
300
  finally {
292
301
  await browserWorkspaceCommand(cli, ['session', 'stop', sessionId]).catch(() => { });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.182",
3
+ "version": "2.0.184",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: agents-relay
3
- description: Use when work needs durable, multi-agent orchestration across turns or processes: plan and execute Jobs/Tasks, coordinate dependencies and reviews, recover failures, and track authoritative lifecycle events. Also use for content-generation workflows (research, story, production, human review, publication) that need explicit agent roles and handoff boundaries. Not for simple one-shot tasks with no durable coordination.
3
+ description: Use when work needs durable, multi-agent orchestration across turns or processes - plan and execute Jobs/Tasks, coordinate dependencies and reviews, recover failures, and track authoritative lifecycle events. Also use for content-generation workflows (research, story, production, human review, publication) that need explicit agent roles and handoff boundaries. Not for simple one-shot tasks with no durable coordination.
4
4
  requires:
5
5
  skills:
6
6
  - daemon-service-manage