vfven commited on
Commit
06d091f
·
verified ·
1 Parent(s): 7c3de4a

Update templates/code.html

Browse files
Files changed (1) hide show
  1. templates/code.html +17 -18
templates/code.html CHANGED
@@ -575,24 +575,23 @@ input.addEventListener("keydown", async function(e) {
575
  const data = await missionRes.json();
576
 
577
  // resultados por agente
578
- data.results.forEach(r => {
579
- if (r.success) {
580
- writeLine(`> ${r.agent}: OK`, "manager");
581
- } else {
582
- writeLine(`> ${r.agent}: ERROR`, "system");
583
- }
584
-
585
- if (r.response) {
586
- writeLine(`> ${r.response.substring(0,150)}`, "system");
587
- }
588
-
589
- // imágenes 🔥
590
- if (r.image_urls) {
591
- r.image_urls.forEach(url => {
592
- terminal.innerHTML += `<img src="${url}" class="mt-2 rounded shadow" />`;
593
- });
594
- }
595
- });
596
 
597
  writeLine("> Sistema: Misión completada ✔", "system");
598
  }
 
575
  const data = await missionRes.json();
576
 
577
  // resultados por agente
578
+ if (!data.results || data.results.length === 0) {
579
+ writeLine("> Sistema: No se requirieron agentes.", "system");
580
+ } else {
581
+ data.results.forEach(r => {
582
+ const agentName = r.agent || "unknown_agent";
583
+
584
+ if (r.success) {
585
+ writeLine(`> ${agentName}: OK`, "manager");
586
+ } else {
587
+ writeLine(`> ${agentName}: ERROR`, "system");
588
+ }
589
+
590
+ if (r.response) {
591
+ writeLine(`> ${r.response.substring(0,150)}`, "system");
592
+ }
593
+ });
594
+ }
 
595
 
596
  writeLine("> Sistema: Misión completada ✔", "system");
597
  }