Skip to content

Add beautiful error page with OpenCode self‑healing#1

Merged
patdeg merged 10 commits intomainfrom
feature/beautiful-error-page
Jan 24, 2026
Merged

Add beautiful error page with OpenCode self‑healing#1
patdeg merged 10 commits intomainfrom
feature/beautiful-error-page

Conversation

@patdeg
Copy link
Copy Markdown
Contributor

@patdeg patdeg commented Jan 24, 2026

Summary

  • Introduced a user‑friendly error page powered by OpenCode self‑healing logic.
  • Added self‑healing analysis, guard, and trigger modules to automatically recover from common errors.
  • Applied go fmt to all Go files for consistent formatting.

Changes

  • cmd/server/main.go: Updated server startup to serve the new error page.
  • internal/handler/error_handler.go: Implemented custom error handling logic.
  • internal/handler/feedback.go: Added feedback endpoint for error reporting.
  • internal/handler/opencode_analyzer.go: Hook for OpenCode analysis.
  • internal/model/feedback.go: New feedback data model.
  • internal/repository/repository.go: Persist feedback and analysis results.
  • internal/selfhealing/analyze.go: Core analysis logic for self‑healing.
  • internal/selfhealing/guards.go: Guard conditions for triggering healing.
  • internal/selfhealing/trigger.go: Execution of self‑healing actions.
  • templates/error.html: New HTML template for the error page.
  • Applied go fmt to all modified Go files.

Test Plan

  1. Manual UI Test

    • Trigger a known error (e.g., invalid route) and verify the error page displays with the correct message and styling.
    • Submit feedback via the form and ensure the data is logged.
  2. Automated Tests

    • Run go test ./... to confirm all existing tests pass.
    • Add a new test that simulates an error, checks that the self‑healing analysis is invoked, and that the appropriate recovery action is taken.
  3. Formatting Check

    • Run go fmt ./... locally to ensure no formatting changes are pending.

PR generated with Demeterics AI

patdeg and others added 9 commits January 23, 2026 18:32
- templates/error.html: Orange-themed error page with pipeline steps
- internal/handler/error_handler.go: Centralized error handling
- internal/handler/opencode_analyzer.go: OpenCode Docker integration
- Routes: /error (preview), /error/trigger (simulate error)

Features:
- Animated pipeline showing self-healing progress
- Error ID tracking for incident correlation
- Async OpenCode analysis trigger via Docker container
- Webhook fallback for n8n integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move widget script to base.html so it loads on all pages.
Add htmx:afterSwap listener to reinitialize widget after
HTMX content swaps.

Previously, navigating via hx-boost links only rendered
the "content" block, skipping the "scripts" block where
the widget was initialized.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Go's html/template sanitizes data URLs to #ZgotmplZ for security.
Add safeURL template function to mark data URLs as safe for img src.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove tool calling from self-healing analysis. The model
(groq/llama-3.3-70b-versatile via Demeterics) outputs function
calls as text (<function=...>) instead of structured JSON,
causing API errors.

Now uses simple single-turn analysis without file reading.
Less powerful but works reliably.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Switch from groq/llama-3.3-70b-versatile to
meta-llama/llama-4-maverick-17b-128e-instruct which
properly supports function calling via Demeterics API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The PROMPT string was closed prematurely on line 110,
causing "Instructions:" to be interpreted as a shell command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove set -e and add || true to git diff | head pipes
to prevent SIGPIPE when head closes the pipe before
git diff finishes writing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

AI Code Review


Powered by Demeterics with openai/gpt-oss-20b

- Add goldmark for proper markdown-to-HTML conversion with GFM support
- Strip ANSI escape codes from LLM analysis output
- Parse JSON wrapper from self-healing analysis response
- Fallback to escaped pre block if markdown conversion fails

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

AI Code Review


Powered by Demeterics with openai/gpt-oss-20b

@patdeg patdeg merged commit 2f04680 into main Jan 24, 2026
1 check passed
@patdeg patdeg deleted the feature/beautiful-error-page branch January 24, 2026 03:45
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.

1 participant