Skip to content

feat: add patch-style draft updates for agents#5732

Merged
forestileao merged 3 commits into
mainfrom
feat/agent-patch-draft-5726
Jun 29, 2026
Merged

feat: add patch-style draft updates for agents#5732
forestileao merged 3 commits into
mainfrom
feat/agent-patch-draft-5726

Conversation

@forestileao

Copy link
Copy Markdown
Collaborator

Summary

  • add patch_draft to superplane_app so agents can send small graph operations instead of full canvas_yaml
  • apply patches through the internal canvas changeset patcher, validate against existing rules, and stage canonical canvas YAML
  • default patch_draft auto-layouts affected connected components, with explicit auto_layout overrides for full canvas or custom seeds
  • update agent tool schema, access reporting, and prompts to prefer patch updates for large apps

Closes #5726

Validation

  • make test PKG_TEST_PACKAGES=./pkg/agents/...
  • make format.go
  • make lint && make check.build.app

@superplanehq-integration

Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

Comment thread pkg/agents/agent_tools/actions/patch_draft.go
Comment thread pkg/agents/agent_tools/actions/patch_draft.go Outdated
@superplane-gh-integration-9000

superplane-gh-integration-9000 Bot commented Jun 27, 2026

Copy link
Copy Markdown

Risk: 45/100 (medium)

Summary

Replaces the full-YAML update_draft agent action with a structured patch_draft action that accepts ordered graph operations (add/update/delete nodes and edges), applies them through the internal canvas changeset patcher, and defaults auto-layout to affected connected components.

Concerns

  • patchChangeNode does not validate node id is non-empty after the NodeID fallback — empty ID passed silently to patcher.
  • patchChangeEdge does not validate source_id or target_id are non-empty before building the edge.
  • update_node schema exposes component and integration_id fields that are silently ignored by the implementation.
  • Hard rename update_draft → patch_draft with no backward-compat shim breaks in-flight agent sessions at deploy time.
  • normalizePatchOp aliases (replace_node, remove_node, remove_edge) are untested.
  • customToolResultsLogFields logic is duplicated between anthropic/provider.go and agent_stream_worker.go.

Recommended reviewers: lucaspin, re-pixel

@forestileao forestileao force-pushed the feat/agent-patch-draft-5726 branch from fb67dfd to dd40e47 Compare June 27, 2026 01:01

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dd40e47. Configure here.

Comment thread pkg/agents/agent_tools/actions/patch_draft.go Outdated
@forestileao forestileao force-pushed the feat/agent-patch-draft-5726 branch 3 times, most recently from b923eb5 to 06fef2f Compare June 27, 2026 02:38
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@forestileao forestileao force-pushed the feat/agent-patch-draft-5726 branch from 06fef2f to 87f5013 Compare June 27, 2026 14:52
@forestileao forestileao force-pushed the feat/agent-patch-draft-5726 branch 2 times, most recently from 23af32e to 299f27b Compare June 29, 2026 15:28
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@forestileao forestileao force-pushed the feat/agent-patch-draft-5726 branch from 299f27b to baf74c3 Compare June 29, 2026 16:16
@forestileao

Copy link
Copy Markdown
Collaborator Author

👍

@forestileao forestileao merged commit 8b3dd90 into main Jun 29, 2026
7 checks passed
@forestileao forestileao deleted the feat/agent-patch-draft-5726 branch June 29, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add patch-style draft updates for large agent canvas edits

1 participant