agents-relay 2.0.120 → 2.0.121
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/adapters.js +1 -1
- package/dist/task-context.js +16 -5
- package/package.json +1 -1
package/dist/adapters.js
CHANGED
|
@@ -322,7 +322,7 @@ export class ChatGptAdapter {
|
|
|
322
322
|
throw new Error('browser-worker execution aborted');
|
|
323
323
|
const policy = chatGptTabClosePolicy(task.chatgptTabClosePolicy, this.tabClosePolicy);
|
|
324
324
|
const submit = () => (this.runner ?? browserWorkerRunner())(definition, {
|
|
325
|
-
prompt: task.chatgptThreadDelivery?.
|
|
325
|
+
prompt: task.chatgptThreadDelivery?.repository && task.chatgptThreadDelivery.executionId
|
|
326
326
|
? taskReferencePrompt(task.chatgptThreadDelivery.repository, task.chatgptThreadDelivery.jobId, task.id, task.chatgptThreadDelivery.executionId, task.input) : task.input,
|
|
327
327
|
...(task.attachments?.length ? { files: task.attachments } : {}),
|
|
328
328
|
...(task.chatgptThreadDelivery ? { thread: task.chatgptThreadDelivery } : {}),
|
package/dist/task-context.js
CHANGED
|
@@ -11,11 +11,22 @@ export function taskExecutionContext(job, taskId, executionId) {
|
|
|
11
11
|
projectPath: job.projectPath, state: job.state }, task, comments: task.comments ?? [], dependencies: task.dependencies.map(id => job.tasks.find(item => item.id === id) ?? { id, missing: true }),
|
|
12
12
|
plan: job.plans?.find(plan => plan.id === task.planningDecisionId) ?? null };
|
|
13
13
|
}
|
|
14
|
+
/** Browser new-turn envelope: the local Contract and durable Task Context are authoritative. */
|
|
14
15
|
export function taskReferencePrompt(repository, jobId, taskId, executionId, managedInput) {
|
|
15
|
-
|
|
16
|
-
const index = managedInput?.indexOf(marker) ?? -1;
|
|
17
|
-
if (managedInput !== undefined && index < 0)
|
|
16
|
+
if (managedInput !== undefined && !managedInput.includes('[Execution event contract — mandatory]'))
|
|
18
17
|
throw new Error(`Missing managed execution event contract for ${jobId}/${taskId}/${executionId}`);
|
|
19
|
-
const
|
|
20
|
-
return `[Agents Relay managed task]
|
|
18
|
+
const source = `job/${jobId}/task/${taskId}/execution/${executionId}`;
|
|
19
|
+
return `[Agents Relay managed task]
|
|
20
|
+
Repository: ${repository}
|
|
21
|
+
Job ID: ${jobId}
|
|
22
|
+
Task ID: ${taskId}
|
|
23
|
+
Execution ID: ${executionId}
|
|
24
|
+
Exact event source.id: ${source}
|
|
25
|
+
|
|
26
|
+
FIRST publish exactly one task.started through the canonical Neo events-bus with this exact source.id.
|
|
27
|
+
THEN read the entire authoritative event contract from /Users/chengli/Workspace/agents-relay/skills/agents-relay/contracts/event-contract.md before any task work. If unavailable publish task.failed and stop.
|
|
28
|
+
THEN retrieve the authoritative Task Context:
|
|
29
|
+
agents-relay task context --repo ${repository} --id ${jobId} --task-id ${taskId} --execution-id ${executionId}
|
|
30
|
+
Verify the execution ID. Read Task input, dependencies, Plan, project context, and output requirements from that response. Never guess or create a new Job. Continue in this thread; Relay owns completion and review.
|
|
31
|
+
Follow the file's lifecycle contract, including progress/heartbeat and exactly one task.completed or task.failed before exiting. If context is unavailable publish task.failed with the blocker.`;
|
|
21
32
|
}
|