mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-24 05:41:40 +00:00
fix(kanban): guard task_age against corrupt created_at values like '%s'
task_age() crashed with ValueError when created_at contained the literal format string '%s' instead of a Unix timestamp, taking down the entire GET /board endpoint with a 500. - Add _safe_int() helper that returns None on non-numeric values - Refactor task_age() to use _safe_int instead of bare int() casts - Wrap task_age() call in _task_dict with try/except fallback so one corrupt row never kills the whole board endpoint
This commit is contained in:
parent
c39168453d
commit
061a183008
2 changed files with 20 additions and 7 deletions
|
|
@ -145,7 +145,10 @@ def _task_dict(
|
|||
d = asdict(task)
|
||||
# Add derived age metrics so the UI can colour stale cards without
|
||||
# computing deltas client-side.
|
||||
d["age"] = kanban_db.task_age(task)
|
||||
try:
|
||||
d["age"] = kanban_db.task_age(task)
|
||||
except Exception:
|
||||
d["age"] = {"created_age_seconds": None, "started_age_seconds": None, "time_to_complete_seconds": None}
|
||||
# Surface the latest non-null run summary so dashboards don't show
|
||||
# blank cards/drawers for tasks where the worker handed off via
|
||||
# ``task_runs.summary`` (the kanban-worker pattern) instead of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue