Skip to content

update awf to v0.2.0#4693

Merged
Mossaka merged 5 commits intomainfrom
update-to-awf-v0.2.0
Nov 24, 2025
Merged

update awf to v0.2.0#4693
Mossaka merged 5 commits intomainfrom
update-to-awf-v0.2.0

Conversation

@Mossaka
Copy link
Copy Markdown
Collaborator

@Mossaka Mossaka commented Nov 24, 2025

fixed the issue with the wrapping command in a string and the issue with not able to mount GITHUB_WORKSPACE (#4427)

Signed-off-by: Jiaxiao (mossaka) Zhou duibao55328@gmail.com

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 24, 2025

❌ Agentic Changeset Generator failed and wasn't able to produce a result.

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

This PR updates the AWF (Agent Workflow Framework) integration to version 0.2.0, which changes how commands are passed to the AWF wrapper and adds filesystem mount support for workspace access.

Key Changes

  • Updated AWF command invocation to use -- separator between AWF arguments and the wrapped command (v0.2.0 syntax)
  • Removed shellEscapeCommandString() wrapping since AWF v0.2.0 no longer requires the command as a single escaped string
  • Added /tmp:/tmp:rw and ${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:ro mount arguments to AWF
  • Added ${GITHUB_WORKSPACE} to Copilot CLI's --add-dir arguments to enable workspace file discovery

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/workflow/copilot_engine.go Updated AWF command generation: added mount arguments, added workspace to --add-dir, changed command separator to --, removed shellEscapeCommandString() wrapping, updated comments
.github/workflows/weekly-issue-summary.lock.yml Generated workflow with updated AWF syntax: added mount arguments, added -- separator, removed escaped quotes, added workspace to --add-dir
.github/workflows/test-assign-to-agent.lock.yml Added trailing comma to JavaScript object (cosmetic fix)
.github/workflows/technical-doc-writer.lock.yml Generated workflow with updated AWF syntax
.github/workflows/smoke-copilot.lock.yml Generated workflow with updated AWF syntax
.github/workflows/research.lock.yml Generated workflow with updated AWF syntax
.github/workflows/release-highlights.lock.yml Generated workflow with updated AWF syntax
.github/workflows/python-data-charts.lock.yml Generated workflow with updated AWF syntax
.github/workflows/mcp-inspector.lock.yml Generated workflow with updated AWF syntax
.github/workflows/issue-monster.lock.yml Added trailing comma to JavaScript object (cosmetic fix)
.github/workflows/glossary-maintainer.lock.yml Generated workflow with updated AWF syntax
.github/workflows/firewall.lock.yml Generated workflow with updated AWF syntax
.github/workflows/docs-noob-tester.lock.yml Generated workflow with updated AWF syntax
.github/workflows/daily-repo-chronicle.lock.yml Generated workflow with updated AWF syntax
.github/workflows/daily-news.lock.yml Generated workflow with updated AWF syntax
.github/workflows/copilot-pr-prompt-analysis.lock.yml Generated workflow with updated AWF syntax
.github/workflows/copilot-pr-nlp-analysis.lock.yml Generated workflow with updated AWF syntax
.github/workflows/cli-version-checker.lock.yml Generated workflow with updated AWF syntax
.github/workflows/cli-consistency-checker.lock.yml Generated workflow with updated AWF syntax
.github/workflows/changeset.lock.yml Generated workflow with updated AWF syntax
.github/workflows/artifacts-summary.lock.yml Generated workflow with updated AWF syntax
.github/workflows/ai-triage-campaign.lock.yml Added trailing comma to JavaScript object (cosmetic fix)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +241 to +242
// AWF v0.2.0 uses -- to separate AWF args from the actual command
// The command arguments should be passed as individual shell arguments, not as a single string
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The comment states "The command arguments should be passed as individual shell arguments, not as a single string," but this is misleading. The command (copilotCommand) is still a single string constructed using shellJoinArgs() - it's not passed as individual arguments.

The key change is that AWF v0.2.0 uses -- as a separator, and the command no longer needs to be wrapped with shellEscapeCommandString() (which would have added extra quotes and escaping). The command is now passed directly after -- without the double-escaping that was needed before.

Consider revising the comment to be more accurate:

// Build the full AWF command with proper argument separation
// AWF v0.2.0 uses -- to separate AWF args from the command to execute
// The command is passed as a single shell-escaped string after the separator
Suggested change
// AWF v0.2.0 uses -- to separate AWF args from the actual command
// The command arguments should be passed as individual shell arguments, not as a single string
// AWF v0.2.0 uses -- to separate AWF args from the command to execute
// The command is passed as a single shell-escaped string after the separator

Copilot uses AI. Check for mistakes.
Comment thread pkg/workflow/copilot_engine.go Outdated
awfArgs = append(awfArgs, "--mount", "/tmp:/tmp:rw")

// Always mount the workspace directory so Copilot CLI can access it
awfArgs = append(awfArgs, "--mount", "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:ro")
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

The workspace mount argument will not work as intended. The value "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:ro" will be wrapped in single quotes by shellEscapeArg() (line 40-46 in shell.go), resulting in:

--mount '${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:ro'

In bash, single quotes prevent variable expansion, so AWF will receive the literal string ${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:ro instead of the actual workspace path like /home/runner/work/repo/repo:/home/runner/work/repo/repo:ro.

Solution: Use an environment variable reference that won't be quoted, or construct the mount path differently. For example:

// Use GitHub Actions expression syntax which will be substituted before shell execution
awfArgs = append(awfArgs, "--mount", "${{ github.workspace }}:${{ github.workspace }}:ro")

Or if you need shell expansion:

// Build mount arg without triggering shellEscapeArg quoting
// by pre-quoting strategically or using a different approach

The same issue affects line 117 where --add-dir "${GITHUB_WORKSPACE}" is added to copilotArgs.

Suggested change
awfArgs = append(awfArgs, "--mount", "${GITHUB_WORKSPACE}:${GITHUB_WORKSPACE}:ro")
awfArgs = append(awfArgs, "--mount", "${{ github.workspace }}:${{ github.workspace }}:ro")

Copilot uses AI. Check for mistakes.

// Always add workspace directory to --add-dir so Copilot CLI can access it
// This allows Copilot CLI to discover agent files and access the workspace
copilotArgs = append(copilotArgs, "--add-dir", "${GITHUB_WORKSPACE}")
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

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

Same issue as with the mount argument on line 229. The --add-dir argument with "${GITHUB_WORKSPACE}" will be single-quoted by shellEscapeArg(), preventing shell variable expansion. Copilot CLI will receive the literal string ${GITHUB_WORKSPACE} instead of the actual workspace path.

Solution: Use GitHub Actions expression syntax instead:

copilotArgs = append(copilotArgs, "--add-dir", "${{ github.workspace }}")

This way, GitHub Actions will substitute the workspace path before the shell command runs, and shellEscapeArg() will not quote it (since ${{ }} doesn't contain shell special characters).

Suggested change
copilotArgs = append(copilotArgs, "--add-dir", "${GITHUB_WORKSPACE}")
copilotArgs = append(copilotArgs, "--add-dir", "${{ github.workspace }}")

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 24, 2025

❌ Agentic Changeset Generator failed and wasn't able to produce a result.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 24, 2025

✅ Agentic Changeset Generator completed successfully.

@Mossaka Mossaka force-pushed the update-to-awf-v0.2.0 branch from 1a006ee to 0462440 Compare November 24, 2025 22:44
fixed the issue with the wrapping command in a string and the issue with not able to mount GITHUB_WORKSPACE

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
@Mossaka Mossaka force-pushed the update-to-awf-v0.2.0 branch from 0462440 to bf3d431 Compare November 24, 2025 22:44
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
@Mossaka Mossaka merged commit eec263a into main Nov 24, 2025
87 of 127 checks passed
@Mossaka Mossaka deleted the update-to-awf-v0.2.0 branch November 24, 2025 23:06
mnkiefer pushed a commit that referenced this pull request Nov 25, 2025
* update awf to v0.2.0

fixed the issue with the wrapping command in a string and the issue with not able to mount GITHUB_WORKSPACE

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>

* change default version of awf to v0.2.0

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>

* allow bash variable expansion

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>

* mount the right path to the container

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>

* bump copilot CLI version

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>

---------

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants