Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions api/oss/src/apis/fastapi/workflows/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -1517,43 +1517,6 @@ async def commit_workflow_revision(
):
return WorkflowRevisionResponse()

workflow_revision_commit = workflow_revision_commit_request.workflow_revision

variant_id = (
workflow_revision_commit.workflow_variant_id
or workflow_revision_commit.variant_id
)
if variant_id is None:
raise HTTPException(
status_code=400,
detail="workflow_revision.workflow_variant_id is required when committing a workflow revision.",
)

# A commit carries data (full replace) or delta (ops merged onto the latest revision),
# never both. Empty is allowed only as the v0 seed (intentionally null data/flags/meta);
# once the variant has a data revision, an empty commit is rejected.
has_data = bool(
workflow_revision_commit.data
and workflow_revision_commit.data.model_dump(mode="json", exclude_none=True)
)
has_delta = workflow_revision_commit.delta is not None
if has_data and has_delta:
raise HTTPException(
status_code=400,
detail="Provide either data or delta for a commit, not both.",
)
if not has_data and not has_delta:
current_revision = await self.workflows_service.fetch_workflow_revision(
project_id=UUID(request.state.project_id),
workflow_variant_ref=Reference(id=variant_id),
include_archived=False,
)
if current_revision and current_revision.data:
raise HTTPException(
status_code=400,
detail="workflow_revision.data is required when committing a workflow revision.",
)

workflow_revision = await self.workflows_service.commit_workflow_revision(
project_id=UUID(request.state.project_id),
user_id=UUID(request.state.user_id),
Expand Down
38 changes: 6 additions & 32 deletions sdks/python/agenta/sdk/agents/platform/op_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,15 @@ def _strip_field(schema: Dict[str, Any], dotted_path: str) -> None:
# and stripped from the model-visible schema, so the agent can only ever target itself, never a
# different variant in the project. Defaults to approval.
_COMMIT_REVISION_DESCRIPTION = (
"Commit a new revision to your own workflow variant (update yourself). Send only the "
"fields you are changing under `workflow_revision.delta.set` (deep-merged onto your "
"current config) and any field paths to drop under `delta.remove`. Put agent-template "
"edits under `delta.set.parameters.agent`. The variant you are running is targeted "
"automatically. This changes the agent and requires approval."
"Commit a new revision to your own workflow variant (update yourself). Supply the new "
"configuration under `workflow_revision.data` and an optional commit message; the variant "
"you are running is targeted automatically. This changes the agent and requires approval."
)
_COMMIT_REVISION_INPUT_SCHEMA: Dict[str, Any] = {
"type": "object",
"additionalProperties": False,
"properties": {
"workflow_revision": {
"type": "object",
"additionalProperties": False,
"description": "The revision to append to your variant's history.",
"properties": {
# Bound from $ctx.workflow.variant.id and stripped before the model sees it.
Expand All @@ -276,34 +272,12 @@ def _strip_field(schema: Dict[str, Any], dotted_path: str) -> None:
"type": "string",
"description": "Commit message describing the change.",
},
"delta": {
"data": {
"type": "object",
"additionalProperties": False,
"description": (
"Change set applied to your current revision. `set` is deep-merged "
"(omitted fields preserved); `remove` deletes the listed paths."
),
"properties": {
"set": {
"type": "object",
"additionalProperties": True,
"description": (
"Partial workflow revision data to merge. For agent-template "
"updates, include parameters.agent with instructions, llm, tools, "
"mcps, skills, harness, runner, or sandbox fields as needed."
),
},
"remove": {
"type": "array",
"items": {"type": "string"},
"description": (
"Dotted field paths to delete, e.g. parameters.agent.tools."
),
},
},
"description": "The new configuration (parameters, inputs) for the revision.",
},
},
"required": ["workflow_variant_id", "delta"],
"required": ["workflow_variant_id"],
},
},
"required": ["workflow_revision"],
Expand Down
Loading