Consolidate AWF command building logic across all agentic engines#15810
Consolidate AWF command building logic across all agentic engines#15810
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ove pathSetup from WrapCommandInShell Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Completed the refactoring! All three main engines (Claude, Codex, and Copilot) now use the consolidated AWF helper functions. Latest commits:
Total impact:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
✅ Changeset Generator completed successfully! |
|
🧪 Smoke Temporary ID is now testing temporary ID functionality... |
|
🧪 Smoke Project is now testing project operations... |
|
❌ Smoke Copilot SDK failed. Please review the logs for details. |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
Agent Container Tool Check ✅
Result: 12/12 tools available ✅ All common development tools are accessible in the agent container environment.
|
|
✅ Smoke Temporary ID completed successfully. Temporary ID validation passed. |
|
✅ Smoke Project completed successfully. All project operations validated. |
|
Merged PRs:
|
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude for issue #15810
Smoke Test ResultsPRs Reviewed:
Test Results:
Overall: PASS ✅
|
There was a problem hiding this comment.
Excellent refactoring - consolidates AWF command building into shared helpers and extracts AWF constants. All engines now use consistent configuration.
📰 BREAKING: Report filed by Smoke Copilot for issue #15810
| awfCommand, | ||
| shellJoinArgs(awfArgs), | ||
| shellWrappedCommand, | ||
| shellEscapeArg(config.LogFile)) |
There was a problem hiding this comment.
Good consolidation! BuildAWFCommand nicely unifies AWF setup across all engines.
| const AWFProxyLogsDir = "/tmp/gh-aw/sandbox/firewall/logs" | ||
|
|
||
| // AWFDefaultLogLevel is the default log level for AWF | ||
| const AWFDefaultLogLevel = "info" |
There was a problem hiding this comment.
Nice extraction of AWF constants - much cleaner than hardcoded values.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
There was a problem hiding this comment.
Pull request overview
This PR consolidates duplicated AWF (Agentic Workflow Firewall) command building logic from Claude, Codex, and Copilot engines into a shared helper module. The refactoring reduces ~275 lines of duplicated code across three engines while extracting common constants for maintainability.
Changes:
- Created new
pkg/workflow/awf_helpers.gowith reusable AWF command building functions - Extracted AWF-related constants to
pkg/constants/constants.go - Refactored Claude, Codex, and Copilot engines to use the shared helpers
- Recompiled 113 workflow lock files with consistent command wrapping (
/bin/bash -cwrapper andtee -aflag)
Reviewed changes
Copilot reviewed 119 out of 119 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/constants/constants.go | Added 7 environment variable constants and 3 AWF configuration constants |
| pkg/workflow/awf_helpers.go | New module with AWF command building helpers (248 lines) |
| .github/workflows/*.lock.yml | 113 workflow lock files updated with consistent AWF command format |
| .changeset/patch-consolidate-awf-command.md | Changeset documenting the refactoring |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AWF (Agentic Workflow Firewall) command construction was duplicated across Claude, Codex, and Copilot engines with ~110-130 lines of identical logic per engine. This consolidates the logic into reusable helpers.
Changes
New module:
pkg/workflow/awf_helpers.goBuildAWFCommand()- Constructs complete AWF-wrapped command from configurationBuildAWFArgs()- Assembles AWF arguments (mounts, domains, image tag, API proxy, SSL bump)GetAWFCommandPrefix()- Resolves custom vs. standard AWF commandWrapCommandInShell()- Shell escapes and wraps engine commandAWFCommandConfig- Type-safe configuration structConstants extraction:
pkg/constants/constants.goEngine refactoring
Before (per engine):
After:
Impact
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Changeset