A run says whether the dashboard, the CLI or a script asked for it

`POST /runs/flows/{name}` hardcoded `cause: "api"`, so every row in the
history claimed the same origin. The body now carries an optional `cause`,
closed to the values the column knows — the dashboard sends nothing and stays
"api", `fluksio run` says "cli", and the SDK client says "sdk".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Gf7WaExcJ9bs3kfJXB3nK
This commit is contained in:
2026-08-25 22:06:29 +02:00
co-authored by Claude Opus 5
parent b194071ca5
commit 1148e54c9e
9 changed files with 83 additions and 9 deletions
+5 -1
View File
@@ -459,7 +459,11 @@ def cmd_run(args: argparse.Namespace, rest: list[str]) -> int:
):
params = _ask_params(definition)
handle = client.submit(
args.flow, params, seed=args.seed, no_cache=args.no_cache
args.flow,
params,
seed=args.seed,
no_cache=args.no_cache,
cause="cli",
)
_say(f"{handle.id} queued {json.dumps(params)}")
if not wait:
+9 -1
View File
@@ -226,11 +226,19 @@ class Client:
params: dict[str, Any] | None = None,
seed: int | None = None,
no_cache: bool = False,
cause: str = "sdk",
) -> RunHandle:
"""Queue a run. ``cause`` is what the history records it as coming
from — a script is the default, `fluksio run` says so itself."""
row = self._call(
"POST",
f"/runs/flows/{flow}",
json={"params": params or {}, "seed": seed, "no_cache": no_cache},
json={
"params": params or {},
"seed": seed,
"no_cache": no_cache,
"cause": cause,
},
)
return RunHandle(self, row["id"], row)