Skip to content

fix: surface openclaw:prompt-error events in overview banner#918

Open
vivekchand wants to merge 1 commit intomainfrom
auto/issue-601-prompt-error-alerts
Open

fix: surface openclaw:prompt-error events in overview banner#918
vivekchand wants to merge 1 commit intomainfrom
auto/issue-601-prompt-error-alerts

Conversation

@vivekchand
Copy link
Copy Markdown
Owner

Closes #601

Summary

  • routes/overview.py — new GET /api/prompt-errors?since=<ISO8601> endpoint; scans the 20 most-recently-modified session JSONL files for customType: 'openclaw:prompt-error' events, returns up to 50 sorted newest-first. Handles fields at both top-level and nested under data.
  • dashboard.py (HTML) — dismissable red #prompt-error-banner div inserted after the existing velocity-alert banner, same visual style.
  • dashboard.py (JS)loadPromptErrors() function called non-blocking from loadAll(), same pattern as loadTokenVelocity; shows provider, model, error message for up to 5 most recent failures.

Test plan

  • With no session JSONL files present, GET /api/prompt-errors returns {"errors":[],"count":0} and no banner appears.
  • Inject a JSONL line {"type":"custom","customType":"openclaw:prompt-error","provider":"anthropic","model":"claude-3","error":"rate_limit_exceeded"} into a session file; Overview tab banner appears with provider/model/error.
  • Banner dismiss button (×) hides it without a page reload.
  • ?since=<future ISO timestamp> filters out older events correctly.
  • Pre-existing lint errors unchanged (109 pre-existing, 0 new).

Generated by Claude Code

Adds /api/prompt-errors endpoint that scans the 20 most-recently-modified
session JSONL files for `customType: 'openclaw:prompt-error'` events and
returns up to 50 sorted newest-first.  Adds a dismissable red banner to
the Overview tab (loadPromptErrors, same non-blocking pattern as
loadTokenVelocity) that shows provider, model, and error message for the
5 most recent failures.  Supports optional ?since=<ISO8601> for future
incremental polling.

Closes #601

Co-Authored-By: Claude <noreply@anthropic.com>
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.

[P0] Wire openclaw:prompt-error events into alerts stream

2 participants