Skip to content

Fix weekly upstream sync agentic workflow prompt#50

Merged
brunoborges merged 2 commits intomainfrom
copilot/debug-weekly-upstream-sync-failure
Apr 6, 2026
Merged

Fix weekly upstream sync agentic workflow prompt#50
brunoborges merged 2 commits intomainfrom
copilot/debug-weekly-upstream-sync-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

Resolves #41


Before the change?

  • The weekly-upstream-sync.md prompt was written as documentation ("This document describes the workflow..."), not as agent instructions. The agent misinterpreted it, invoked the agentic-merge-upstream skill, attempted to actually merge upstream changes, failed to push from the AWF sandbox (no git credentials), and never called any safe-output tools — causing the workflow to fail with no output.

After the change?

  • Prompt rewritten as clear imperative instructions: clone upstream, compare commits against .lastmerge, use safe-output tools (create_issue, close_issue, assign_to_agent, noop) to report results.
  • Explicit constraints added: do not invoke skills, do not edit files, do not push code.
  • Concrete bash commands provided for each detection step.
  • Frontmatter unchanged — no lock file recompilation needed (prompt content is runtime-imported via {{#runtime-import}}).

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • mvn spotless:apply has been run to format the code
  • mvn clean verify passes locally

Does this introduce a breaking change?

  • Yes
  • No

Rewrite the prompt from documentation-style to clear imperative
instructions. The agent previously misinterpreted the documentation
as instructions to perform the merge itself (invoking the
agentic-merge-upstream skill), then failed because it couldn't
push code from the sandbox.

The new prompt:
- Gives explicit step-by-step instructions
- Provides bash commands for upstream change detection
- Directs the agent to use safe-output tools (create_issue,
  close_issue, assign_to_agent, noop)
- Explicitly prohibits invoking skills, editing files, or pushing code

Only the markdown content changed; frontmatter is unchanged so no
lock file recompilation is needed.

Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/945e9454-9363-45bc-b281-0fe3d6c87019

Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix weekly upstream sync agentic workflow failure Fix weekly upstream sync agentic workflow prompt Apr 3, 2026
Copilot AI requested a review from brunoborges April 3, 2026 18:37
@brunoborges brunoborges marked this pull request as ready for review April 6, 2026 17:04
Copilot AI review requested due to automatic review settings April 6, 2026 17:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the agentic workflow prompt for weekly upstream sync checks so the automation agent reliably detects upstream changes and reports results via safe-output tools (without attempting merges).

Changes:

  • Rewrites the prompt from descriptive documentation into imperative agent instructions.
  • Adds explicit constraints to prevent invoking skills, editing files, or pushing code.
  • Specifies concrete commands/steps for comparing .lastmerge to upstream and creating/closing issues via safe outputs.
Show a summary per file
File Description
.github/workflows/weekly-upstream-sync.md Reworks the workflow prompt into actionable instructions and adds guardrails for safe-output-only reporting.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

│ port changes → PR │
└──────────────────────────┘
```
Follow the [agentic-merge-upstream](.github/prompts/agentic-merge-upstream.prompt.md) prompt to port these changes to the Java SDK.
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The link target (.github/prompts/agentic-merge-upstream.prompt.md) is relative to this file’s directory, so on GitHub it resolves to .github/workflows/.github/prompts/... and is broken. Use a correct relative path (e.g., ../prompts/agentic-merge-upstream.prompt.md) or an absolute GitHub URL so the referenced prompt can be opened reliably from the created issue body/instructions.

Suggested change
Follow the [agentic-merge-upstream](.github/prompts/agentic-merge-upstream.prompt.md) prompt to port these changes to the Java SDK.
Follow the [agentic-merge-upstream](../prompts/agentic-merge-upstream.prompt.md) prompt to port these changes to the Java SDK.

Copilot uses AI. Check for mistakes.
```
Follow the [agentic-merge-upstream](.github/prompts/agentic-merge-upstream.prompt.md) prompt to port these changes to the Java SDK.
```
4. After creating the issue, use the `assign_to_agent` safe-output tool to assign Copilot to the newly created issue.
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

Step 3b instructs calling assign_to_agent but doesn’t specify which identifier to pass. The safe-output assign_to_agent tool requires one of issue_number or pull_number (no default in this workflow), so the instructions should explicitly say to use the created issue’s number (from create_issue output) or to set a temporary_id on create_issue and pass that to assign_to_agent.

Suggested change
4. After creating the issue, use the `assign_to_agent` safe-output tool to assign Copilot to the newly created issue.
4. After creating the issue, use the `assign_to_agent` safe-output tool to assign Copilot to the newly created issue, passing the created issue's number from the `create_issue` output as `issue_number`.

Copilot uses AI. Check for mistakes.
@edburns
Copy link
Copy Markdown
Collaborator

edburns commented Apr 6, 2026

Net effect
No code, tests, or build behavior changes. This is purely a prompt engineering fix for the weekly upstream sync GitHub Actions workflow. The workflow's YAML definition and frontmatter are untouched — only the markdown body (which gets runtime-imported as the agent's instructions) was rewritten so the agent stays in its lane: detect changes → create/close issues → stop.

@brunoborges you are clear to merge this.

@brunoborges brunoborges merged commit 3a74e47 into main Apr 6, 2026
9 checks passed
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.

[aw] Weekly Upstream Sync Agentic Workflow failed

4 participants