Clients take a flow's id or key: one resolver in the SDK, id first, explicit id:/key:, a warning for reads and a refusal for changes when a name means two flows, deleted flows found by their last key; sync creates by POST, retries a create race through the drift checks and reports the id; MCP gets create_flow and resolves every flow argument with the caller's token; displays show flow_name; an engine from before ids is named as such

This commit is contained in:
2026-11-02 19:39:14 +01:00
parent fd637e0f1e
commit 53916d869b
20 changed files with 816 additions and 147 deletions
+12 -2
View File
@@ -264,6 +264,13 @@ def test_an_agent_cannot_write_code_its_person_may_not(
).json()
assert me["is_superuser"] is False
token = mcp_token(uuid.UUID(me["id"]), agent)
# One they may create: the tool only reaches the route for a listed flow.
flows = f"{settings.API_V1_STR}/flows"
made = client.post(
f"{flows}/", headers=normal_user_token_headers, json={"name": "agent_gate"}
)
assert made.status_code == 201, made.text
flow_id = made.json()["definition"]["id"]
async def block(http: httpx.AsyncClient) -> httpx.Response:
return await http.post(
@@ -272,11 +279,14 @@ def test_an_agent_cannot_write_code_its_person_may_not(
token,
"tools/call",
name="save_node_source",
arguments={"name": "any", "node_id": "fn", "code": "import os"},
arguments={"flow": "agent_gate", "node_id": "fn", "code": "import os"},
),
)
answer = json.loads(over_mcp(block).json()["result"]["content"][0]["text"])
try:
answer = json.loads(over_mcp(block).json()["result"]["content"][0]["text"])
finally:
client.delete(f"{flows}/{flow_id}", headers=normal_user_token_headers)
assert answer == {"error": CODE_IS_SUPERUSERS, "status": 403}