4b6817381b
CI (OpenClaw E2E) / openclaw test (push) Has been cancelled
CI / coverage-report (push) Has been cancelled
CI / test-kubernetes (push) Has been cancelled
CI / should-run-thorough (push) Has been cancelled
CI / test-thorough (cloudwatch-demo) (push) Has been cancelled
CI / test-thorough (flink-ecs) (push) Has been cancelled
CI / test-thorough (upstream-lambda) (push) Has been cancelled
CI / test-thorough (prefect-ecs-fargate) (push) Has been cancelled
Release / build-binaries (zip, opensre.exe, onefile, windows-latest, windows-x64) (push) Has been cancelled
Benchmark image — build + push to ECR (any adapter) / build + push (push) Has been cancelled
CI / quality (ubuntu-latest) (push) Has been cancelled
CI / test (tools-runtime) (push) Has been cancelled
CI / test (e2e-general) (push) Has been cancelled
CI / test (cli-runtime) (push) Has been cancelled
CI / test (e2e-provider-and-openclaw) (push) Has been cancelled
CI / test (integrations-and-misc) (push) Has been cancelled
Release / verify (push) Has been cancelled
Release / build-python-dist (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-15-intel, darwin-x64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-latest, darwin-arm64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04, linux-x64) (push) Has been cancelled
Release / publish-release (push) Has been cancelled
Release / publish-main-release (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-checks (no-LLM) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-live shard ${{ matrix.shard_index }} (push) Has been cancelled
Release / prepare (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04-arm, linux-arm64) (push) Has been cancelled
Synthetic Deterministic Tests / Synthetic offline (deterministic) (push) Has been cancelled
222 lines
6.9 KiB
Python
222 lines
6.9 KiB
Python
# ======== from tools/dagster_assets_tool/ ========
|
|
|
|
"""Dagster assets materialization query tool."""
|
|
|
|
from typing import Any
|
|
|
|
from core.tool_framework.tool_decorator import tool
|
|
from integrations.dagster import (
|
|
DagsterConfig,
|
|
dagster_extract_params,
|
|
dagster_is_available,
|
|
list_assets_with_materialization,
|
|
)
|
|
|
|
|
|
@tool(
|
|
name="list_dagster_assets",
|
|
description="List Dagster assets and their latest materialization status.",
|
|
source="dagster",
|
|
surfaces=("investigation", "chat"),
|
|
is_available=dagster_is_available,
|
|
injected_params=("api_token", "endpoint"),
|
|
extract_params=dagster_extract_params,
|
|
)
|
|
def list_dagster_assets(
|
|
endpoint: str,
|
|
api_token: str = "",
|
|
limit: int = 25,
|
|
) -> dict[str, Any]:
|
|
"""Return assets and the timestamp/status of their most recent materialization."""
|
|
config = DagsterConfig(endpoint=endpoint, api_token=api_token)
|
|
return list_assets_with_materialization(config, limit=limit)
|
|
|
|
|
|
# ======== from tools/dagster_run_logs_tool/ ========
|
|
|
|
"""Dagster run logs query tool."""
|
|
|
|
from typing import Any
|
|
|
|
from core.tool_framework.tool_decorator import tool
|
|
from integrations.dagster import (
|
|
dagster_extract_params,
|
|
dagster_is_available,
|
|
get_run_logs,
|
|
)
|
|
|
|
|
|
@tool(
|
|
name="get_dagster_run_logs",
|
|
description=(
|
|
"Fetch event logs and error details for a specific Dagster run. "
|
|
"IMPORTANT: a single run may contain MULTIPLE step failures if ops "
|
|
"ran in parallel and several failed independently. The response "
|
|
"includes a top-level `summary.failures` list that pre-counts and "
|
|
"pre-classifies each step failure (step_key, exception_class, "
|
|
"cause_message). Always check `summary.failure_count` first; if it "
|
|
"is greater than 1, surface ALL failures in your diagnosis as "
|
|
"distinct root causes, do not pick only one. The underlying "
|
|
"user-code exception lives in `cause_message` (the wrapper is "
|
|
"always a generic DagsterExecutionStepExecutionError). If "
|
|
"`summary.truncated` is true, the run produced more events than "
|
|
"the inspection cap (`summary.events_examined`); treat the "
|
|
"failure_count as a LOWER BOUND and hedge your diagnosis. If "
|
|
"`summary.fetch_error` is set, a mid-pagination error stopped "
|
|
"the fetch early; the failures shown are a partial set."
|
|
),
|
|
source="dagster",
|
|
surfaces=("investigation", "chat"),
|
|
is_available=dagster_is_available,
|
|
injected_params=("api_token", "endpoint"),
|
|
extract_params=dagster_extract_params,
|
|
)
|
|
def get_dagster_run_logs(
|
|
endpoint: str,
|
|
*,
|
|
api_token: str = "",
|
|
run_id: str,
|
|
) -> dict[str, Any]:
|
|
"""Return event logs and any failure error message for the given run id."""
|
|
config = DagsterConfig(endpoint=endpoint, api_token=api_token)
|
|
return get_run_logs(config, run_id=run_id)
|
|
|
|
|
|
# ======== from tools/dagster_runs_tool/ ========
|
|
|
|
"""Dagster runs query tool."""
|
|
|
|
from typing import Any
|
|
|
|
from core.tool_framework.tool_decorator import tool
|
|
from integrations.dagster import (
|
|
dagster_extract_params,
|
|
dagster_is_available,
|
|
list_runs,
|
|
)
|
|
|
|
|
|
@tool(
|
|
name="list_dagster_runs",
|
|
description=(
|
|
"List recent Dagster pipeline/job runs with status and duration. "
|
|
"When the alert specifies a pipeline name (commonly in its "
|
|
"`pipeline`, `alert_name`, or `details.pipeline` field), ALWAYS "
|
|
"pass that as `job_name` to scope results. Dagster instances run "
|
|
"many pipelines and without the filter you get an interleaved mix "
|
|
"from every pipeline that contaminates your evidence. Do not call "
|
|
"this tool multiple times trying different filters; set "
|
|
'`job_name` once and pair it with `status="FAILURE"` for '
|
|
"incident investigations."
|
|
),
|
|
source="dagster",
|
|
surfaces=("investigation", "chat"),
|
|
is_available=dagster_is_available,
|
|
injected_params=("api_token", "endpoint"),
|
|
extract_params=dagster_extract_params,
|
|
)
|
|
def list_dagster_runs(
|
|
endpoint: str,
|
|
api_token: str = "",
|
|
limit: int = 25,
|
|
status: str | None = None,
|
|
job_name: str | None = None,
|
|
) -> dict[str, Any]:
|
|
"""Return summaries of recent Dagster runs from the configured instance."""
|
|
config = DagsterConfig(endpoint=endpoint, api_token=api_token)
|
|
return list_runs(config, limit=limit, status=status, job_name=job_name)
|
|
|
|
|
|
# ======== from tools/dagster_schedules_tool/ ========
|
|
|
|
"""Dagster schedule tick history query tool."""
|
|
|
|
from typing import Any
|
|
|
|
from core.tool_framework.tool_decorator import tool
|
|
from integrations.dagster import (
|
|
dagster_extract_params,
|
|
dagster_is_available,
|
|
list_schedule_ticks,
|
|
)
|
|
|
|
|
|
@tool(
|
|
name="list_dagster_schedule_ticks",
|
|
description=(
|
|
"Fetch recent tick history for a Dagster schedule. The schedule is "
|
|
"identified by all three ScheduleSelector coordinates: repository "
|
|
"location name, repository name, and schedule name."
|
|
),
|
|
source="dagster",
|
|
surfaces=("investigation", "chat"),
|
|
is_available=dagster_is_available,
|
|
injected_params=("api_token", "endpoint"),
|
|
extract_params=dagster_extract_params,
|
|
)
|
|
def list_dagster_schedule_ticks(
|
|
endpoint: str,
|
|
*,
|
|
api_token: str = "",
|
|
repository_name: str,
|
|
repository_location_name: str,
|
|
schedule_name: str,
|
|
limit: int = 25,
|
|
) -> dict[str, Any]:
|
|
"""Return the most recent ticks for the named schedule with status and error."""
|
|
config = DagsterConfig(endpoint=endpoint, api_token=api_token)
|
|
return list_schedule_ticks(
|
|
config,
|
|
repository_name=repository_name,
|
|
repository_location_name=repository_location_name,
|
|
schedule_name=schedule_name,
|
|
limit=limit,
|
|
)
|
|
|
|
|
|
# ======== from tools/dagster_sensors_tool/ ========
|
|
|
|
"""Dagster sensor tick history query tool."""
|
|
|
|
from typing import Any
|
|
|
|
from core.tool_framework.tool_decorator import tool
|
|
from integrations.dagster import (
|
|
dagster_extract_params,
|
|
dagster_is_available,
|
|
list_sensor_ticks,
|
|
)
|
|
|
|
|
|
@tool(
|
|
name="list_dagster_sensor_ticks",
|
|
description=(
|
|
"Fetch recent tick history for a Dagster sensor. The sensor is "
|
|
"identified by all three SensorSelector coordinates: repository "
|
|
"location name, repository name, and sensor name."
|
|
),
|
|
source="dagster",
|
|
surfaces=("investigation", "chat"),
|
|
is_available=dagster_is_available,
|
|
injected_params=("api_token", "endpoint"),
|
|
extract_params=dagster_extract_params,
|
|
)
|
|
def list_dagster_sensor_ticks(
|
|
endpoint: str,
|
|
*,
|
|
api_token: str = "",
|
|
repository_name: str,
|
|
repository_location_name: str,
|
|
sensor_name: str,
|
|
limit: int = 25,
|
|
) -> dict[str, Any]:
|
|
"""Return the most recent ticks for the named sensor with status and error."""
|
|
config = DagsterConfig(endpoint=endpoint, api_token=api_token)
|
|
return list_sensor_ticks(
|
|
config,
|
|
repository_name=repository_name,
|
|
repository_location_name=repository_location_name,
|
|
sensor_name=sensor_name,
|
|
limit=limit,
|
|
)
|