Skip to content

fix: actionable error message for chat worker TLS failures#70

Merged
giswqs merged 5 commits into
mainfrom
fix/chat-worker-tls-error-message
May 2, 2026
Merged

fix: actionable error message for chat worker TLS failures#70
giswqs merged 5 commits into
mainfrom
fix/chat-worker-tls-error-message

Conversation

@giswqs

@giswqs giswqs commented May 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Format chat worker exceptions into a clear UI message that distinguishes provider TLS/connection failures from NASA OPERA tool errors.
  • Log the full traceback to the QGIS message log so debug detail is preserved without dumping it into the chat error pane.
  • Add provider-specific guidance for openai-codex (suggesting provider=openai, disabling streaming, or the direct submit_nasa_opera_search_task helper).

Test plan

  • pytest qgis_geoagent/tests/test_chat_tool_inputs.py::test_format_chat_worker_error_explains_codex_tls_failure
  • pre-commit run --all-files
  • Manual: trigger a provider TLS error in the QGIS plugin and confirm the chat dock shows the new actionable message while the full traceback appears in the QGIS log panel.

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.
Copilot AI review requested due to automatic review settings May 2, 2026 20:10
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request May 2, 2026 20:11 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for openai-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-codex TLS 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.

Comment thread qgis_geoagent/open_geoagent/dialogs/chat_dock.py Outdated
Comment thread qgis_geoagent/open_geoagent/dialogs/chat_dock.py Outdated
- 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.
@github-actions github-actions Bot temporarily deployed to pull request May 2, 2026 20:18 Inactive
giswqs and others added 3 commits May 2, 2026 16:31
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.
@github-actions github-actions Bot temporarily deployed to pull request May 2, 2026 20:44 Inactive
@giswqs giswqs merged commit dd64f85 into main May 2, 2026
9 checks passed
@giswqs giswqs deleted the fix/chat-worker-tls-error-message branch May 2, 2026 20:52
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.

2 participants