agents-relay 2.0.270 → 2.0.271

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.
@@ -356,18 +356,43 @@ function openJobDetails(){
356
356
  const inputs=uniqueInputs(candidates,objective);
357
357
  showDetailsDialog('Job',job.id,job.title,objective,inputs,readerReviewComments(job));
358
358
  }
359
- function taskReaderObjective(task){
359
+ function taskReaderEnvelope(task){
360
+ const raw=detailText(task.input);
361
+ if(!raw.startsWith('{'))return null;
362
+ try{
363
+ const parsed=JSON.parse(raw);
364
+ return parsed&&typeof parsed==='object'&&!Array.isArray(parsed)?parsed:null;
365
+ }catch{return null;}
366
+ }
367
+ function taskReaderObjective(task,envelope=taskReaderEnvelope(task)){
368
+ const explicit=detailText(task.objective)||detailText(envelope?.taskObjective)||detailText(envelope?.objective);
369
+ if(explicit)return explicit;
360
370
  const title=detailText(task.title);
361
- // Generic agent/role names are identifiers, not meaningful objectives.
371
+ // A serialized Script/DAG execution envelope is not a natural-language objective.
372
+ // Until an actual Task objective is persisted, use its title rather than inventing one.
373
+ if(envelope)return title||'Task '+task.id;
362
374
  if(title&&/\s/.test(title))return title;
363
- const paragraphs=detailText(task.input).split(/\n\s*\n/).map(item=>item.trim());
364
- const first=paragraphs.find(item=>item&&!/^(Job ID|Task ID|Review head SHA|Execution ID):/i.test(item));
375
+ const first=detailText(task.input).split(/\n\s*\n/).map(item=>item.trim())
376
+ .find(item=>item&&!/^(Job ID|Task ID|Review head SHA|Execution ID):/i.test(item));
365
377
  return first||title||'Task '+task.id;
366
378
  }
379
+ function taskReaderInputs(task,envelope=taskReaderEnvelope(task)){
380
+ if(!envelope)return [{content:task.input}];
381
+ const inputs=[];
382
+ const request=detailText(envelope.taskInput)||detailText(envelope.input)||detailText(envelope.prompt);
383
+ const instruction=detailText(envelope.instruction)||detailText(envelope.instructions);
384
+ if(request)inputs.push({source:'Task request',content:request});
385
+ if(instruction)inputs.push({source:'Execution instructions',content:instruction});
386
+ // For unknown JSON input contracts, preserve the full input without turning it
387
+ // into a fake objective. Known DAG transport fields are not user-facing content.
388
+ if(!inputs.length)inputs.push({content:'```json\n'+JSON.stringify(envelope,null,2)+'\n```'});
389
+ return inputs;
390
+ }
367
391
  function openTaskDetails(task){
368
392
  const job=selected();
369
- const objective=taskReaderObjective(task);
370
- const candidates=[{content:task.input}];
393
+ const envelope=taskReaderEnvelope(task);
394
+ const objective=taskReaderObjective(task,envelope);
395
+ const candidates=taskReaderInputs(task,envelope);
371
396
  for(const attachment of task.attachments||[])candidates.push({source:'Attachment',content:attachment});
372
397
  const inputs=uniqueInputs(candidates,objective);
373
398
  showDetailsDialog('Task',task.id,task.title,objective,inputs,readerReviewComments(job,task));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agents-relay",
3
- "version": "2.0.270",
3
+ "version": "2.0.271",
4
4
  "description": "Durable async agent jobs coordinated through GitHub pull requests",
5
5
  "repository": {
6
6
  "type": "git",