Skip to content

[Bug]: Desktop Run History empty for agent cron jobs despite /api/cron/jobs/{id}/runs returning runs (v0.16.0 regression) #46979

Open

Description

@seyeeL

Bug Description

In the Desktop GUI, the Run History panel shows "No runs yet" for agent cron jobs, even though the backend API returns the run sessions correctly. This started after updating to v0.16.0; the same jobs previously displayed their run history.

This is distinct from #42433 / #46918 / #44080, which all concern no_agent / script jobs whose /runs endpoint genuinely returns {"runs":[]} (script jobs don't create agent run-sessions). Here the jobs are normal agent jobs, the /runs endpoint returns a populated list, and the UI still shows nothing.

The backend is fully exonerated. Verified end-to-end:

  • State DB has the runs — 92 source='cron' sessions, including today's (e.g. cron_96bd815a3d61_20260616_010050, job "Memory Dream", end_reason=cron_complete).
  • Hitting the Desktop's own dashboard process (the one it spawned, using its HERMES_DASHBOARD_SESSION_TOKEN) over real HTTP returns the data:
    GET http://127.0.0.1:<port>/api/cron/jobs/96bd815a3d61/runs?limit=20 → HTTP 200, {"runs": [ …6 items… ], "limit": 20} (~107 KB).
  • Driving the exact endpoint backend path in-process returns 6 runs with full fields (id, started_at, title, preview, message_count, …):
    from hermes_cli import web_server as ws
    selected = ws._find_cron_job_profile("96bd815a3d61")   # -> 'default'
    db       = ws._open_session_db_for_profile(selected)   # -> root state.db
    len(db.list_cron_job_runs("96bd815a3d61", limit=20))   # -> 6

So DB layer, profile resolution, the /api/cron/jobs/{id}/runs endpoint, and JSON serialization all return the data — only the Desktop UI renders nothing.

Steps to Reproduce

  1. Have one or more agent cron jobs (non-empty prompt, no_agent: false) that have completed several runs.
  2. Update to v0.16.0 and open the Desktop GUI → cron jobs.
  3. Select a job with completed runs (e.g. a daily agent job).
  4. The Run History panel shows "No runs yet", while GET /api/cron/jobs/<id>/runs returns a populated runs array for that same job.

Expected Behavior

The Run History panel lists the job's completed runs (the same sessions the /runs endpoint returns), as it did before v0.16.0.

Actual Behavior

Run History shows "No runs yet" for every agent cron job, despite the endpoint returning HTTP 200 with a non-empty runs array. No error is surfaced in the UI.

Affected Component

Other — Desktop GUI, cron Run History view.

Debug Report

Not provided. hermes debug share uploads config and logs to a public paste service; this config contains live provider API keys and private cron prompts, so I'm not publishing it to a public issue. The end-to-end backend verification above (HTTP 200 + populated runs) is reproducible without it and contains no secrets. Happy to provide redacted specifics on request.

Operating System

Windows 11

Python Version

3.11.15

Hermes Version

Backend: Hermes Agent v0.16.0 (2026.6.5) · upstream 2dbc3bd9. Desktop is running the freshly-built binary from the same tree (apps/desktop/release/win-unpacked/Hermes.exe built 2026-06-16; the running processes started after that build), so this is current 0.16.0 code — not a stale install. Note: the desktop's own version string still reads 0.15.1 because apps/desktop/package.json is un-bumped on upstream HEAD too (last touched in 368fcf1ff, still 0.15.1); it's a version-label lag, not stale code.

Root Cause Analysis (optional)

Backend is exonerated, so this is on the Desktop frontend fetch/render path:

  • apps/desktop/src/hermes.ts:536 getCronJobRuns() → GET /api/cron/jobs/{id}/runs?limit=20
  • apps/desktop/src/app/cron/index.tsx:643-672 and apps/desktop/src/app/chat/sidebar/cron-jobs-section.tsx:301-333 both do .catch(() => setRuns([])), i.e. any error in the fetch is silently rendered as "No runs yet" with no surfaced error.

The symptom landed with the v0.16.0 multi-profile work (fix(desktop): route profile session reads 7a2d498b9; bb/desktop-profile-fallout #44529 — reworked WS auth + cross-profile session reads). The regression is plausibly in how the desktop now authenticates/routes that request for agent jobs, but the swallowing .catch means the UI can't distinguish "request failed" from "genuinely zero runs".

Proposed Fix (optional)

  1. Don't collapse a failed /runs fetch into "No runs yet" — distinguish error from empty and surface the error (this alone makes the root cause visible).
  2. Verify the desktop's run-history request still authenticates/routes correctly under the v0.16.0 profile changes for agent jobs whose /runs returns a non-empty list.

Activity

  1. added
    type/bugSomething isn't working
    P2Medium — degraded but workaround exists
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    comp/gatewayGateway runner, session dispatch, delivery
    comp/cronCron scheduler and job management
    on Jun 16, 2026
  2. changed the title [-]Desktop Run History empty for agent cron jobs despite /api/cron/jobs/{id}/runs returning runs (v0.16.0 regression)[/-] [+][Bug]: Desktop Run History empty for agent cron jobs despite /api/cron/jobs/{id}/runs returning runs (v0.16.0 regression)[/+] on Jun 16, 2026
  3. szzhoujiarui-sketch commented on Jun 16, 2026

    @szzhoujiarui-sketch

    I took this. Here's the current status:

    PR 1 — Surface the swallowed error ✅ (PR #47018)

    Replaced .catch(() => setRuns(prev => prev ?? [])) with explicit error state + Retry button in both CronJobRuns and CronJobSidebarRuns. On fetch failure, the UI now shows the error message with a Retry button instead of silently falling back to "No runs yet".

    Updates since opening:

    • Added cancelledRef to prevent stale setState after unmount (the useCallback pattern lost the original cancelled flag from the effect cleanup)

    PR 2 — Fix the actual regression ⏳ (on hold)

    After tracing the full request path (renderer → IPC → Electron main → backend), I found that the backend's _find_cron_job_profile() already iterates all profiles to resolve the owning profile correctly. So even though getCronJobRuns doesn't pass a profile, the backend finds the right state.db and returns data — this was confirmed working via direct HTTP.

    This means the original symptom (UI empty, endpoint returns data) was purely caused by the silent .catch() swallowing an intermittent error (likely connection timeout, backend restart, or transient auth hiccup). PR 1 should be sufficient — once it lands, whatever concrete error occurs will be visible with a Retry button.

    I'll reassess PR 2 if the surfaced error reveals a pattern that needs a routing fix.

  4. GottZ commented on Jul 29, 2026

    @GottZ

    This was generated by AI during triage.

    Summary

    One PR references issue #46979. The issue establishes a symptom boundary—Desktop shows no history while the same job's runs API returns a non-empty array—but does not establish whether the defect is in rendering, client-side data consumption, or an API contract mismatch; #62663 instead changes stale-session recovery and session ownership handling.

    Related pull requests

    Suggested consolidation

    Do not merge #62663 as the fix for #46979, and remove its closes linkage to this issue; retain or evaluate it separately for stale-session reliability in line with the keep_open review. Continue #46979 investigation at the Desktop-to-API contract boundary without presupposing whether the eventual correction belongs to the frontend or backend.

    Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 69 kB of PR diffs, 7 kB of issue/PR text, 5 kB of discussion (5 comments), 1 verify verdict. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cronCron scheduler and job managementcomp/gatewayGateway runner, session dispatch, deliverycomp/tuiTerminal UI (ui-tui/ + tui_gateway/)type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions