Skip to content

feat: add HyperCoast hyperspectral tools#98

Merged
giswqs merged 3 commits into
mainfrom
feat/add-hypercoast-tools
May 13, 2026
Merged

feat: add HyperCoast hyperspectral tools#98
giswqs merged 3 commits into
mainfrom
feat/add-hypercoast-tools

Conversation

@giswqs

@giswqs giswqs commented May 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Add for_hypercoast agent factory and a dedicated system prompt for HyperCoast workflows (EMIT, PACE OCI).
  • Introduce geoagent/tools/hypercoast.py covering search, download, footprint display, and RGB/variable visualization, and wire it into the QGIS chat dock.
  • Add tests/test_hypercoast_tools.py plus expanded coverage in qgis_geoagent/tests/test_chat_tool_inputs.py.

Test plan

  • pytest tests/ -q
  • pre-commit run --all-files
  • Smoke-test the HyperCoast agent inside QGIS: search EMIT/PACE, display footprints, download a selected granule, and load RGB and BGC variables.

Adds a `for_hypercoast` agent factory that exposes HyperCoast search,
download, and visualization tools for EMIT and PACE hyperspectral data,
along with a system prompt tailored to ocean color and reflectance
workflows. Wires the integration into the QGIS chat dock and adds tests
for the new tool module.
Copilot AI review requested due to automatic review settings May 13, 2026 03:06
@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request May 13, 2026 03:07 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 introduces a new “HyperCoast” workflow mode to GeoAgent/QGIS, adding a dedicated agent factory + system prompt and a new tool surface to search, download, and visualize hyperspectral datasets (EMIT, PACE OCI), along with corresponding tests and QGIS chat-dock wiring.

Changes:

  • Added for_hypercoast agent factory and HYPERCOAST_SYSTEM_PROMPT, plus tool assembly wiring to include HyperCoast tools and exclude add_raster_layer in this mode.
  • Implemented geoagent/tools/hypercoast.py with search (HyperCoast/earthaccess/CMR), footprint display, downloads, dataset preview, and visualization loaders.
  • Updated QGIS chat dock + tests to expose the new agent mode and improve error unwrapping/reporting.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/test_hypercoast_tools.py Adds unit tests for HyperCoast tool behaviors, fallbacks, and factory integration.
qgis_geoagent/tests/test_chat_tool_inputs.py Adds coverage for new error-unwrapping behavior and HyperCoast mode availability/permissions.
qgis_geoagent/open_geoagent/dialogs/chat_dock.py Adds HyperCoast agent mode prompt wiring, exception unwrapping, and tool availability toggles.
geoagent/tools/hypercoast.py New HyperCoast tool implementation for search/download/preview/load workflows with QGIS-safe lazy imports.
geoagent/tools/__init__.py Exports hypercoast_tools from the tools package.
geoagent/core/factory.py Adds HyperCoast system prompt + for_hypercoast factory; wires HyperCoast tool assembly and excludes add_raster_layer in HyperCoast mode.
geoagent/__init__.py Exposes for_hypercoast at package top level.

💡 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
Comment thread qgis_geoagent/open_geoagent/dialogs/chat_dock.py Outdated
Comment thread geoagent/tools/hypercoast.py
Comment thread geoagent/tools/hypercoast.py Outdated
Comment thread geoagent/tools/hypercoast.py
- Restore DEFAULT_PERMISSION_PROFILE to "Inspect only" so chat sessions
  do not auto-approve destructive or long-running tools by default.
- Make the streaming ReadError/RemoteProtocolError attribution generic
  ("OpenGeoAgent tools were not the source") instead of hardcoding
  HyperCoast, which was misleading for other agent modes.
- Replace the broad sys.modules purge of geoagent.* on factory-miss with
  a targeted importlib.reload of geoagent.core.factory and geoagent, so
  shared module state and other importers are not invalidated.
- Reject non-HTTPS URLs in _is_data_download_url (and double-check the
  scheme before opening in _download_data_links) to keep file:// and
  http:// targets out of the downloader.
- Place mkstemp output files under ~/.qgis_hypercoast/cache by passing
  dir=cache_dir, and accept a suffix argument on _ensure_output_path so
  load_hypercoast_variable produces variable-tagged paths instead of
  reusing the "rgb" tag.
@github-actions github-actions Bot temporarily deployed to pull request May 13, 2026 03:17 Inactive
@giswqs giswqs merged commit b978635 into main May 13, 2026
7 of 8 checks passed
@giswqs giswqs deleted the feat/add-hypercoast-tools branch May 13, 2026 03:23
@github-actions github-actions Bot temporarily deployed to pull request May 13, 2026 03:24 Inactive
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