Skip to content

revert(API): remove commit/patch router changes from #4936 - #4975

Closed
mmabrouk wants to merge 1 commit into
big-agentsfrom
revert/commit-revision-router-4936
Closed

revert(API): remove commit/patch router changes from #4936#4975
mmabrouk wants to merge 1 commit into
big-agentsfrom
revert/commit-revision-router-4936

Conversation

@mmabrouk

Copy link
Copy Markdown
Member

What

#4936 put patch/merge/validation semantics into the core workflows router. It added a WorkflowRevisionData import, registered a forked POST /workflows/revisions/commit/patch endpoint, added a commit_workflow_revision_patch handler plus a _deep_merge_revision_data helper, and added two 400 checks (missing data / missing variant id) inside the existing commit_workflow_revision. On the SDK side it tightened the commit_revision op schema (typed data sub-properties, additionalProperties: false, data required) and pointed the op at /commit/patch.

A follow-up commit on big-agents (4ae6289d68 "[fix] patch > delta ?") then reworked that into a data-vs-delta model: it removed the forked /patch route/handler/helper but left a data-vs-delta validation block in the same core handler, and switched the SDK op to a delta.set / delta.remove schema.

This PR reverts both of those layers in the two affected files and restores them to their pre-#4936 state:

  • api/oss/src/apis/fastapi/workflows/router.py — the commit_workflow_revision handler no longer validates/merges; it commits the supplied revision directly.
  • sdks/python/agenta/sdk/agents/platform/op_catalog.pycommit_revision goes back to the looser workflow_revision.data object schema (no additionalProperties: false, no typed sub-properties, data not required) and the plain /api/workflows/revisions/commit path.

Why

That validation/merge/patch logic does not belong in the core workflows router. commit_revision will be redesigned as a proper agenta tool. Until that lands, commit_revision returns to its pre-#4936 replace behavior.

Scope

Exactly two files are touched, and both are byte-identical to their pre-#4936 content (74755ebc^1). The $ctx.workflow.variant.id context binding on the commit_revision op is unchanged.

Out of scope by design: 4ae6289d68's sibling changes to core/workflows/dtos.py, core/workflows/service.py, the generated clients, and sdks/.../test_op_catalog.py are left in place. The reviewer should confirm that leaving the delta plumbing in the DTOs/service while the router no longer uses it (and the op no longer emits it) is acceptable for this interim revert, and note that test_op_catalog.py still asserts the delta schema.

https://claude.ai/code/session_014emxsaD8EFiNP3m3f56nhD

#4936 added patch/merge/validation logic to the core /workflows/revisions/commit
router and forked a /commit/patch endpoint. A follow-up ([fix] patch > delta) then
replaced that with a data-vs-delta validation block in the same core handler. Both put
patch/merge/validation semantics into the core workflows router.

Restore api/oss/src/apis/fastapi/workflows/router.py and
sdks/python/agenta/sdk/agents/platform/op_catalog.py to their pre-#4936 state:
commit_revision returns to plain replace behavior with the looser data schema, until
the tool-based redesign lands.

Claude-Session: https://claude.ai/code/session_014emxsaD8EFiNP3m3f56nhD
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 30, 2026
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 30, 2026 3:48pm

Request Review

@dosubot dosubot Bot added the refactoring A code change that neither fixes a bug nor adds a feature label Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dce92f48-328f-4a84-a54f-2f3ffc7cb0a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/commit-revision-router-4936

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mmabrouk mmabrouk added the needs-review Agent updated; awaiting Mahmoud's review label Jun 30, 2026
@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Please review two things specifically:

  1. Revert scope is correct. Both files are restored byte-for-byte to their pre-[fix] Harden agent round-trip QA paths #4936 state (74755ebc^1): the core commit_workflow_revision handler drops all the patch/merge/validation logic and commits the supplied revision directly, and the SDK commit_revision op goes back to the looser workflow_revision.data object schema on the plain /api/workflows/revisions/commit path. The $ctx.workflow.variant.id context binding is unchanged. ruff format + ruff check are clean.

  2. Nothing else regressed. This intentionally reverts only the two named files. Note that it also unwinds the later 4ae6289d68 ("[fix] patch > delta ?") changes in these two files, because that commit layered a delta model onto the same regions. Its sibling changes are left in place by design: core/workflows/dtos.py, core/workflows/service.py, the generated clients, and sdks/.../test_op_catalog.py still carry delta plumbing. In particular test_op_catalog.py still asserts the delta schema and will likely fail against this op revert — please confirm that interim mismatch is acceptable, or whether the test should move in this PR.

Do not merge until confirmed.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Closing this revert without merging. JP reworked commit_revision into a delta model directly on big-agents (commit 4ae6289d68, "[fix] patch > delta ?"). We are keeping JP's delta version and will build the agent-facing commit_revision logic as a tool on top of it. With that approach, reverting router.py and op_catalog.py back to their pre-#4936 state is no longer needed, so this PR is being dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Agent updated; awaiting Mahmoud's review refactoring A code change that neither fixes a bug nor adds a feature size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant