Fix HTTP 500 errors in /ping endpoint#191
Open
plural-copilot[bot] wants to merge 1 commit into
Open
Conversation
Remove conditional exception that caused intermittent 500 errors on the /ping health check endpoint. The endpoint was throwing 'Exception: unknown internal error' approximately 1/3 of the time when int(time.time()) % 3 == 0. Changes: - Removed conditional exception logic from /ping endpoint in app/main.py - Added test coverage for /ping endpoint in app/test_main.py to verify 200 OK response - All tests passing (test_read_root and test_ping) This resolves the HTTP500Errors alert on demo-prod/flow-test/flow-test-stateless.
Author
There was a problem hiding this comment.
This PR was generated by the claude Plural Agent Runtime. Here's some useful information you might want to know to evaluate the ai's perfomance:
| Name | Details |
|---|---|
| 💬 Prompt | Investigate the app-code root cause for the firing HTTP500Errors alert on demo-prod/flow-test/flow-test-stateless and, if feasible, implement a fix as a pull request.... |
| 🔗 Run history | View run history |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the
HTTP500Errorsalert ondemo-prod/flow-test/flow-test-statelessby removing the deliberate exception injection from the/pinghealth check endpoint.Root Cause
The
/pingendpoint inapp/main.pycontained a time-based conditional that raised an exception approximately 1/3 of the time:This caused intermittent 500 Internal Server Error responses, matching the observed logs:
INFO: 127.0.0.1 ... "GET /ping HTTP/1.1" 500 Internal Server ErrorException: unknown internal errorChanges
test_ping()to verify the endpoint returns 200 OK with{"pong": True}Verification
✅ Docker build successful
✅ All tests passing:
test_read_root: PASSEDtest_ping: PASSED (new)Risk Assessment
Risk Level: Very Low
Notes
Per the README, this endpoint was deliberately broken for testing AI-driven fixes. If this behavior should be preserved for demo purposes, consider using an environment variable or separate endpoint for fault injection testing.
🤖 Generated to resolve HTTP500Errors alert on flow-test-stateless