fix: actionable error message for chat worker TLS failures#70
Merged
Conversation
Surface a clear, actionable message when the chat worker fails on a provider TLS or connection error, so the failure is not mistaken for a NASA OPERA tool problem. Logs the full traceback to QGIS and offers provider-specific guidance for openai-codex.
|
🚀 Deployed on https://69f66215ecbd5faef6e12b1a--opengeos.netlify.app |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the QGIS plugin’s chat error UX by turning low-level chat worker exceptions (especially TLS/connection failures) into actionable, user-facing guidance while preserving full debugging detail in the QGIS log.
Changes:
- Add
_format_chat_worker_error()to convert common TLS/connection failures into clearer UI messages with provider-specific hints (notably foropenai-codex). - Move full exception traceback details out of the chat error pane and into the QGIS message log (Critical level) for debugging.
- Add a pytest covering the
openai-codexTLS failure guidance path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| qgis_geoagent/open_geoagent/dialogs/chat_dock.py | Adds error formatter and logs full traceback to QGIS log while returning a user-friendly message to the UI. |
| qgis_geoagent/tests/test_chat_tool_inputs.py | Adds a unit test ensuring codex TLS failures produce actionable guidance text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Detect provider connection failures via class name (ConnectError / ConnectionError / SSL) and broader substring "connecterror" instead of fully-qualified module paths and an exact "connection error" match, so real httpx/httpcore exceptions actually trigger the guidance branch. - Make the NASA OPERA tool attribution conditional on agent_mode; fall back to a generic "OpenGeoAgent tools were not the source" line for General QGIS, STAC, and other modes to avoid misleading UI text. - Add a test that covers the class-name detection path and the non-OPERA generic phrasing.
for more information, see https://pre-commit.ci
count_water_pixels and analyze_categorical_raster require osgeo, which the factory filters out when GDAL is unavailable (as in CI). The tools remain covered by direct nasa_opera_tools() tests.
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
Test plan