Skip to content

feat: STAC catalog tools and for_stac factory#60

Merged
giswqs merged 3 commits into
mainfrom
feat/stac-tools
May 1, 2026
Merged

feat: STAC catalog tools and for_stac factory#60
giswqs merged 3 commits into
mainfrom
feat/stac-tools

Conversation

@giswqs

@giswqs giswqs commented May 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Add STAC catalog search, asset selection, and QGIS loading tools, exposed via a new for_stac factory.
  • Add a runnable docs/examples/stac_workflow.ipynb example and tests/test_stac_tools.py covering the new tool surface.
  • Expand QGIS tool coverage and refresh the QGIS plugin chat/settings docks plus the dependency manager.

Test plan

  • pre-commit run --all-files
  • pytest tests/ -q
  • Walk through docs/examples/stac_workflow.ipynb end to end.
  • Smoke test the QGIS plugin chat and settings docks in QGIS.

Adds a STAC tool surface (catalog search, asset selection, QGIS loading)
exposed via a new for_stac factory, an example notebook, and tests. Also
expands QGIS tool coverage and refreshes the QGIS plugin chat/settings
docks and dependency manager.
Copilot AI review requested due to automatic review settings May 1, 2026 03:30
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request May 1, 2026 03:31 Inactive
@github-actions github-actions Bot temporarily deployed to pull request May 1, 2026 03:33 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

Adds a first-class STAC workflow to GeoAgent (search → asset selection → QGIS load), wires it through a new for_stac factory, and updates the QGIS plugin to expose STAC mode plus workflow-aware dependency installation.

Changes:

  • Implement STAC tools (list_stac_collections, search_stac_items, get_stac_item_assets, add_stac_asset_to_qgis) and a for_stac factory with a dedicated system prompt.
  • Expand QGIS tooling for rasters (raster palettes, remote-COG-safe range estimation) and add create_hillshade_layer.
  • Update the QGIS plugin UX and dependency installer to support workflow dependency groups + add tests and a runnable STAC notebook.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_stac_tools.py Adds unit coverage for new STAC tool surface and for_stac wiring.
tests/test_qgis_tools.py Extends QGIS tool tests for raster palettes and create_hillshade_layer.
tests/__init__.py Removes test package init file.
qgis_geoagent/tests/test_whitebox_integration.py Updates plugin integration tests for new dependency grouping and STAC factory mode.
qgis_geoagent/tests/test_startup_performance.py Adjusts startup dependency checks to core-runtime-only and validates grouped optional dependencies.
qgis_geoagent/tests/test_chat_tool_inputs.py Verifies STAC URL formatting and STAC tool-call script generation; asserts new default permission profile.
qgis_geoagent/tests/conftest.py Ensures plugin root is on sys.path for test imports.
qgis_geoagent/tests/__init__.py Removes test package init file.
qgis_geoagent/open_geoagent/metadata.txt Updates plugin metadata to mention workflow dependency status + STAC mode + Python >= 3.11.
qgis_geoagent/open_geoagent/dialogs/settings_dock.py Adds dependency-group selector, grouped status UI, and diagnostics additions (GeoAgent version + per-group checks).
qgis_geoagent/open_geoagent/dialogs/chat_dock.py Adds STAC transcript URL section, STAC “copy script” snippet generation, tool availability UI, and changes permission profile defaults/behavior.
qgis_geoagent/open_geoagent/deps_manager.py Introduces dependency groups, core runtime package set, and Python runtime gating for installer.
qgis_geoagent/README.md Documents workflow-specific dependency installation and STAC capabilities.
pyproject.toml Configures pytest to discover both core and plugin tests.
geoagent/tools/stac.py Implements STAC tools and QGIS raster loading helpers (including background-task loading when available).
geoagent/tools/qgis.py Adds raster palette support, remote-COG-safe behavior, and create_hillshade_layer.
geoagent/tools/__init__.py Exports stac_tools.
geoagent/core/prompts.py Updates system prompts to mention hillshade and raster palette behavior.
geoagent/core/factory.py Adds STAC system prompt, include_stac wiring, tool exclusion by name, and for_stac factory.
geoagent/__init__.py Exports for_stac.
examples/README.md Links the new STAC workflow notebook and install extras.
docs/qgis-plugin.md Documents STAC mode, dependency sets, and trusted auto-approve behavior.
docs/examples/stac_workflow.ipynb Adds an end-to-end runnable example using mock QGIS + Planetary Computer STAC.
README.md Documents the new for_stac factory and STAC notebook.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread geoagent/tools/qgis.py
Comment thread geoagent/tools/stac.py
Comment thread qgis_geoagent/open_geoagent/dialogs/chat_dock.py Outdated
Comment thread qgis_geoagent/open_geoagent/dialogs/chat_dock.py Outdated
Comment thread qgis_geoagent/open_geoagent/dialogs/chat_dock.py
- Validate the active layer is a raster in create_hillshade_layer before
  passing it to GDAL DEMProcessing, raising a clear ValueError otherwise.
- Stop returning the source-CRS extent under the WGS84 bbox key when
  _canvas_extent_to_wgs84_bbox fails to transform; return bbox=None and
  surface the original extent under source_bbox/source_crs so callers
  cannot mistake the result for a STAC-ready bbox.
- Revert DEFAULT_PERMISSION_PROFILE to "Inspect only" so the plugin no
  longer auto-approves confirmation-gated tools out of the box.
- Drop the ChatWorker override that forced auto_approve_tools=True for
  the trusted profile so the explicit flag from the UI is respected.
- Redact bearer-like query parameters (SAS sigs, tokens, signatures)
  from STAC asset URLs printed in the transcript and add a leakage
  warning so signed Planetary Computer URLs are no longer copied
  verbatim into chat logs.
@github-actions github-actions Bot temporarily deployed to pull request May 1, 2026 03:43 Inactive
@giswqs giswqs merged commit 401b602 into main May 1, 2026
9 checks passed
@giswqs giswqs deleted the feat/stac-tools branch May 1, 2026 03:47
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