-
Notifications
You must be signed in to change notification settings - Fork 3
Add error/404/500 page detection to Researcher #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Skip full AI-powered research when navigating to error pages by detecting them early. Uses a two-layer approach: 1. Fast heuristic check (zero cost): - Checks title, h1, h2 for error patterns (404, 500, 502, 503, 403) - Detects empty body HTML - Catches very small pages (< 500 chars in body) 2. AI prompt instruction as fallback: - Instructs AI to detect custom error pages semantically - Returns standardized error format instead of normal research Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. |
Sequence DiagramThe PR adds a fast heuristic error-page check before running full AI research and includes an AI prompt fallback to detect custom error pages. The diagram shows the short-circuiting behavior when an error is detected and the normal research path when it is not. sequenceDiagram
participant Client
participant Researcher
participant ErrorDetector
participant AI
Client->>Researcher: Request research for URL / state
Researcher->>ErrorDetector: Heuristic check (title, h1, h2, body size/empty)
alt Heuristic detects error
ErrorDetector-->>Researcher: isError (e.g., 404/500/empty)
Researcher-->>Client: "Error Page Detected" (skip AI research)
else Heuristic passes
ErrorDetector-->>Researcher: not an error
Researcher->>AI: Start conversation with research prompt (includes error_detection fallback)
AI-->>Researcher: Research report (or semantic error if AI identifies it)
Researcher-->>Client: Return research result
Generated by CodeAnt AI |
Nitpicks 🔍
|
|
CodeAnt AI finished reviewing your PR. |
- Simplify return type to boolean (no type field needed) - Require error context for numeric codes (e.g., "404 error", "error 500") to prevent false positives like "Room 404" or "Order #500" - Add text-based patterns: "Page Not Found", "Server Error", "Access Denied" - Add comprehensive unit tests (41 tests covering detection and false positives) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Just match standard HTTP error strings like "404 Not Found", "500 Internal Server Error" - no regex guessing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
User description
Summary
Test plan
🤖 Generated with Claude Code
CodeAnt-AI Description
Detect error pages and stop research when a page is an error
What Changed
Impact
✅ Fewer wasted AI calls on error pages✅ Faster response when navigating to broken or empty pages✅ Clearer feedback that research was skipped due to an error page💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.