hermoso 0.1.263 → 0.1.265

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/mcp/client.mjs CHANGED
@@ -381,7 +381,13 @@ export async function pollJob(id, { intervalMs = 3000, timeoutMs = 10 * 60 * 100
381
381
  const job = await getJob(id);
382
382
  onTick?.(job);
383
383
  if (job.status === 'done') return { job, result: jobResult(job) };
384
- if (job.status === 'error') throw new Error(job.error || 'Render failed');
384
+ // A FAILED JOB HAS ALREADY BEEN RECORDED BY THE SERVER (2026-09-21). The job runner files the worker's real error in
385
+ // the ledger under the job's own type, with its status and markers. A bare Error here carried neither, so the tool
386
+ // wrapper took it for a failure that never reached the server and reported it a SECOND time with status 0: two
387
+ // make_template_ad refusals (a 400 the server had classed as the caller's config) sat on the admin board as
388
+ // "could not tell". `_viaApi` is the marker that says the server has seen it. It deliberately carries NO `jobId`:
389
+ // the tool layer reads a jobId on an error as "timed out, still rendering", which a failed job is not.
390
+ if (job.status === 'error') throw Object.assign(new Error(job.error || 'Render failed'), { _viaApi: true });
385
391
  if (Date.now() > deadline) throw Object.assign(new Error('Render timed out — check `hermoso jobs get ' + id + '`'), { jobId: id });
386
392
  // NEVER SLEEP PAST THE DEADLINE. A 3s interval made every wait 3s-granular: a caller who asked for 1s was held 3s,
387
393
  // and one who asked for 29s was held 30s, which is the whole 30-second step budget the ask exists to stay inside.