Skip to content

fix(ui): prevent non-string model formatter crash - #78

Merged
kalinon merged 1 commit into
mainfrom
fix/nonstring-model-shape-guard
Apr 1, 2026
Merged

fix(ui): prevent non-string model formatter crash#78
kalinon merged 1 commit into
mainfrom
fix/nonstring-model-shape-guard

Conversation

@moltar-bot

Copy link
Copy Markdown
Contributor

Summary

  • Fixes runtime crash when model values are not strings (for example object-shaped payloads from newer OpenClaw versions)
  • Adds defensive model normalization in shared UI formatters
  • Prevents TypeError: d.includes is not a function

Changes

Updated model formatter logic in:

  • web/src/components/SessionRow.jsx
  • web/src/components/SessionDetailPanel.jsx
  • web/src/pages/Log.jsx
  • web/src/pages/CronJobs.jsx
  • web/src/components/CronJobList.jsx
  • web/src/components/CronRunHistoryPanel.jsx

Each formatter now:

  • accepts strings as before
  • safely unwraps object-shaped models (id, model, or name)
  • bails out cleanly when no string model can be derived

Validation

  • npm run -w ./web lint

@kalinon
kalinon merged commit bac869d into main Apr 1, 2026
9 checks passed
@kalinon
kalinon deleted the fix/nonstring-model-shape-guard branch April 1, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants