Run Sentinel-2 vessel detection from a local agent#

Verify the Sentinel-2 vessel-detection and Ship knowledge skills end to end through a local Codex agent: detect on one exact catalog record, retrieve every result page, and build a deterministic draft without publishing to the knowledge base.

The API and MCP connections use separate token audiences. Authentication does not isolate tenants.

Prerequisites#

  • A GeoNeMo deployment at https://geonemo.example.com with the maritime pack, and vessel_detection.available set to true in GET /v1/discovery.

  • Authorization to submit a GPU job.

  • Codex CLI, authenticated.

  • Node.js 22.20.0 or newer, for skills@1.5.22.

  • uv and Python 3.12, for the local report renderer.

  • A Sentinel-2 L2A record: its <collection> and <record-id>.

Steps#

  1. Verify the service. Sign in following the API credential skill (geonemo-api-credentials), then check the login and the advertised MCP URL, which must be https://geonemo.example.com/mcp:

    geonemo --url https://geonemo.example.com whoami
    

    A skill and tool count does not prove readiness: the controller or GPU worker can still be unavailable.

  2. Install the two skills into the agent workspace, from a checkout:

    npx --yes skills@1.5.22 add <checkout>/packs/maritime \
      --skill geonemo-sentinel-2-vessel-detection --agent codex --yes --copy
    npx --yes skills@1.5.22 add <checkout>/packs/maritime \
      --skill geonemo-ship-knowledge --agent codex --yes --copy
    

    On Node.js 18 the installer fails on a missing node:util.styleText export before it reads the skill. Use Node.js 22 or newer.

  3. Add the MCP endpoint and authorize it, following the MCP credential skill (geonemo-mcp-credentials):

    codex mcp add geonemo --url https://geonemo.example.com/mcp
    codex mcp login geonemo
    

    For a headless token, set bearer_token_env_var = "GEONEMO_MCP_TOKEN" in the entry. Reading the configuration does not verify authentication: require a real initialization and tools/list.

  4. Start a fresh task, because skills and MCP connections are read at start:

    codex -C <agent-workspace>
    

    Confirm it lists catalog_get_record, sentinel_2_vessel_detection_start, vessel_detection_get_status, vessel_detection_get_result and vessel_detection_cancel. If one is missing, stop: do not substitute REST calls, a vision model or Sentinel-1.

  5. Run the detection with this prompt:

    Use the GeoNeMo Sentinel-2 vessel-detection skill on this exact record.
    Collection: <collection>
    Record ID: <record-id>
    Exact-read the record first. Start the detector with a new stable
    idempotency key, poll until terminal, retrieve every result page, and
    report counts, candidates, provenance, warnings and limitations. Render
    the visual report and give me the returned HTML link. Do not publish to
    the GKB. Do not use Sentinel-1, a VLM, image inspection or manual
    model, threshold, GPU, band or path settings.
    

    Expected trace: read the skill, catalog_get_record, the start tool, status polling, result pages until next_cursor is null, then download and hash-check the B04, B03 and B02 assets and run the installed render_vessel_report.py locally. The controller owns asset selection, model, thresholds and GPU dispatch; the agent passes only the unchanged collection, record ID and its idempotency key.

  6. Build the no-write Ship knowledge draft in the same task:

    Using the unchanged succeeded run and every result page, use the
    ship-knowledge skill to build and validate a ship-observation draft and
    campaign report. Preserve lineage and limitations. Do not publish.
    

    The skill runs build_ship_observation.py, validate_ship_artifact.py, build_ship_report.py and validate_ship_artifact.py validate-commit-plan. Script success proves the draft and commit plan are valid, not that anything was stored.

Result#

The run ends succeeded with all result pages read, and the agent links a local report.html. Check these:

  • The agent read the sensor-specific skill and exact-read the record as Sentinel-2 L2A.

  • The start request contained no paths, URLs, bands, model settings or GPU settings.

  • Candidate count is not a unique-vessel count. total: 0 on a succeeded run is a valid zero-candidate result; a failed or cancelled run has an unknown count and is never zero.

  • Detector scores are uncalibrated. Nothing was published and no Sentinel-1, vision-model or manual-image fallback ran.

  • The observation draft retains all candidates, source hashes, model and runtime provenance, and limitations, and the report states that campaign completeness is unknown.

Troubleshooting#

Symptom

Cause and action

The host does not resolve

The machine cannot reach the deployment: a connectivity failure, not a skill failure

MODEL_RUNTIME_FAILED

The count is unknown: stop retrieving results. An operator inspects the vessel controller logs for the run ID, fixes the cause (for example a missing worker image) and you submit a new run with a new idempotency key

GPU selection

A deployment setting. Never put a GPU identifier in the prompt or the start request