agents-relay 2.0.173 → 2.0.174
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/managed-worker-input.js +3 -28
- package/dist/task-context.js +10 -8
- package/package.json +1 -1
|
@@ -59,34 +59,9 @@ ${taskAgentHistoryContext(job, task)}\n\n${chairPlan ? `[Review Chair execution
|
|
|
59
59
|
${output}
|
|
60
60
|
${taskTag}${mode === 'evaluation' ? `[Isolated prompt evaluation mode]
|
|
61
61
|
This is a read-only evaluation of role guidance. Preserve and apply the role's reasoning and evidence standards, but do not call tools, publish lifecycle events, read or write files, or contact external services. Return the requested evaluation only.
|
|
62
|
-
` : `[
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
Every lifecycle event for this execution MUST set source.id to that exact string. Do not derive, rename, or replace it.
|
|
66
|
-
Follow the events-bus skill/protocol. For sandboxed Codex or hosted ChatGPT,
|
|
67
|
-
publish through the federated MCP tool events__publish; do not open NATS directly.
|
|
68
|
-
For a direct non-sandbox local worker, use NEO_EVENTS_EMIT when the caller provides it.
|
|
69
|
-
As your FIRST execution action, before reading files, editing code, running commands, or doing other work,
|
|
70
|
-
you MUST publish exactly one canonical task.started event for this exact Job/Task.
|
|
71
|
-
Immediately after task.started, BEFORE reading task context or doing any implementation/review/recovery work, read the full authoritative Relay event contract at absolute path /Users/chengli/Workspace/agents-relay/skills/agents-relay/contracts/event-contract.md. If it cannot be read, publish task.failed with the blocker and stop. Do not rely only on this prompt summary or a relative path.
|
|
72
|
-
|
|
73
|
-
Publish task.progress only for meaningful work milestones. It is nonterminal; do not fabricate progress. Relay's Task.timeoutMs is an inactivity timeout reset only by accepted task.started or newer task.progress events for this exact execution.
|
|
74
|
-
Before returning or allowing the worker process to exit, you MUST publish exactly one canonical terminal event:
|
|
75
|
-
- task.completed only after the declared output is durable;
|
|
76
|
-
- task.failed for implementation, tool, command, test, patch, commit, push, runtime, or other execution failure that prevents completion;
|
|
77
|
-
- task.completed or task.failed is the only agent terminal result. Relay owns task.blocked/task.unblocked lifecycle transitions; never publish task.blocked for a recovery request;
|
|
78
|
-
- Relay-owned cancellation is not an agent terminal result; if execution cannot continue, publish task.failed.
|
|
79
|
-
|
|
80
|
-
If any execution step fails and you cannot continue, publish task.failed with the concrete reason BEFORE exiting.
|
|
81
|
-
Never exit after task.started without publishing exactly one terminal task event.
|
|
82
|
-
Do not publish duplicate terminal task events.
|
|
83
|
-
The worker owns task.started and task terminal events. Relay-owned task.process.launched, task.process.exited,
|
|
84
|
-
and task.process.async_exited are process lifecycle only and NEVER replace the worker task lifecycle.
|
|
85
|
-
The ChatGPT/Codex conversation or process exit is never the task result.
|
|
86
|
-
|
|
87
|
-
[Final event gate]
|
|
88
|
-
Before your final return, verify that a terminal event for this exact Job/Task was published.
|
|
89
|
-
If no terminal event has been published, publish task.failed before exiting.`}`;
|
|
62
|
+
` : `[Required event contracts]
|
|
63
|
+
Execution source: ${sourceId}
|
|
64
|
+
Read and follow /Users/chengli/Workspace/neo/skills/events-bus/references/protocol.md and /Users/chengli/Workspace/agents-relay/skills/agents-relay/contracts/event-contract.md before execution. These contracts own event publishing and lifecycle requirements.`}`;
|
|
90
65
|
const role = task.agentName === 'planner' || task.agentName === 'reviewer' || task.agentName === 'troubleshooter' ? task.agentName : 'worker';
|
|
91
66
|
const safeAgent = mode === 'evaluation'
|
|
92
67
|
? selectedAgent.replace(/^.*(?:task\.started|task\.completed|task\.failed|events__publish|NEO_EVENTS_EMIT).*\n?/gm, '')
|
package/dist/task-context.js
CHANGED
|
@@ -30,20 +30,22 @@ export function taskAgentHistoryContext(job, task) {
|
|
|
30
30
|
}
|
|
31
31
|
/** Browser new-turn envelope: the local Contract and durable Task Context are authoritative. */
|
|
32
32
|
export function taskReferencePrompt(repository, jobId, taskId, executionId, managedInput) {
|
|
33
|
-
if (managedInput !== undefined && !managedInput.includes('[
|
|
34
|
-
throw new Error(`Missing
|
|
33
|
+
if (managedInput !== undefined && !managedInput.includes('[Required event contracts]'))
|
|
34
|
+
throw new Error(`Missing required event contract references for ${jobId}/${taskId}/${executionId}`);
|
|
35
35
|
const source = `job/${jobId}/task/${taskId}/execution/${executionId}`;
|
|
36
36
|
return `[Agents Relay managed task]
|
|
37
37
|
Repository: ${repository}
|
|
38
38
|
Job ID: ${jobId}
|
|
39
39
|
Task ID: ${taskId}
|
|
40
40
|
Execution ID: ${executionId}
|
|
41
|
-
|
|
41
|
+
Execution source: ${source}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
[Required event contracts]
|
|
44
|
+
/Users/chengli/Workspace/neo/skills/events-bus/references/protocol.md
|
|
45
|
+
/Users/chengli/Workspace/agents-relay/skills/agents-relay/contracts/event-contract.md
|
|
46
|
+
Read and follow both contracts before execution.
|
|
47
|
+
|
|
48
|
+
Retrieve the authoritative Task Context:
|
|
46
49
|
agents-relay task context --repo ${repository} --id ${jobId} --task-id ${taskId} --execution-id ${executionId}
|
|
47
|
-
Verify the execution
|
|
48
|
-
Follow the file's lifecycle contract, including optional meaningful progress and exactly one task.completed or task.failed before exiting. Accepted current-execution task.started and newer task.progress events reset Task.timeoutMs; duplicate, stale, or out-of-order progress does not. If context is unavailable publish task.failed with the blocker.`;
|
|
50
|
+
Verify the execution identity and follow the durable Task context. Relay owns completion and review.`;
|
|
49
51
|
}
|