Skip to content

[fix] Use transient workflows for draft previews#8

Draft
rishabh-chawla-glean wants to merge 1 commit into
mainfrom
cursor/transient-preview-links-41fc
Draft

[fix] Use transient workflows for draft previews#8
rishabh-chawla-glean wants to merge 1 commit into
mainfrom
cursor/transient-preview-links-41fc

Conversation

@rishabh-chawla-glean

Copy link
Copy Markdown

Problem

Replicate the preview-link/transient-workflow portion of https://github.com/askscio/scio/pull/245939/changes. Draft previews were being created through the normal agent sync path and PR comments linked to the real agent edit URL, so preview comments could point at the wrong workflow instead of the server-created transient preview.

Solution

  • Add preview request builders for workflow and automode agents that create transient workflows via POST /rest/api/v1/agents.
  • Link transient previews back to the real agent using parentWorkflowId and force workflowNamespace: "AGENT".
  • Keep staged/published syncs on POST /rest/api/v1/agents/{id}.
  • Capture the server-assigned transient workflow id as previewId.
  • Update PR comments to link to /chat/agents/{previewId}/preview, falling back to the agent id if no preview id is present.

Tests

  • bash -n scripts/sync-agents.sh scripts/comment-pr.sh scripts/comment-merge.sh scripts/detect-changes.sh scripts/github_output.sh
  • Mocked workflow-agent preview sync verifying request URL, transient request body, and previewId result.
  • Mocked PR comment rendering verifying /preview link uses the transient preview id.
Open in Web Open in Cursor 

Co-authored-by: rishabh-chawla-glean <rishabh-chawla-glean@users.noreply.github.com>
@harshita-boonlia-glean

Copy link
Copy Markdown
Contributor

@rishabh-chawla-glean can we test this with a git agent post merge

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.

3 participants