MCPcopy Create free account
hub / github.com/github/gh-aw / generateCreateAwInfo

Method generateCreateAwInfo

pkg/workflow/compiler_yaml.go:795–984  ·  view source on GitHub ↗
(yaml *strings.Builder, data *WorkflowData, engine CodingAgentEngine)

Source from the content-addressed store, hash-verified

793}
794
795func (c *Compiler) generateCreateAwInfo(yaml *strings.Builder, data *WorkflowData, engine CodingAgentEngine) {
796 // Engine ID (prefer EngineConfig.ID, fallback to AI field for backwards compatibility)
797 engineID := engine.GetID()
798 if data.EngineConfig != nil && data.EngineConfig.ID != "" {
799 engineID = data.EngineConfig.ID
800 } else if data.AI != "" {
801 engineID = data.AI
802 }
803
804 // Model - explicit config or runtime env var via vars context
805 modelConfigured := data.EngineConfig != nil && data.EngineConfig.Model != ""
806 var modelEnvVar string
807 if !modelConfigured {
808 switch engineID {
809 case "copilot":
810 modelEnvVar = constants.EnvVarModelAgentCopilot
811 case "claude":
812 modelEnvVar = constants.EnvVarModelAgentClaude
813 case "codex":
814 modelEnvVar = constants.EnvVarModelAgentCodex
815 case "opencode":
816 modelEnvVar = constants.EnvVarModelAgentOpenCode
817 case "custom":
818 modelEnvVar = constants.EnvVarModelAgentCustom
819 default:
820 modelEnvVar = constants.EnvVarModelAgentCustom
821 }
822 }
823
824 // Agent version - use the actual installation version (includes defaults)
825 agentVersion := getInstallationVersion(data, engine)
826
827 // Version: prefer explicit engine config version, fall back to the installation version
828 // so the run details always show the version being used rather than "(none)".
829 version := agentVersion
830 if data.EngineConfig != nil && data.EngineConfig.Version != "" {
831 version = data.EngineConfig.Version
832 }
833
834 // Staged value from safe-outputs configuration
835 stagedValue := "false"
836 if data.SafeOutputs != nil && data.SafeOutputs.Staged != nil {
837 stagedValue = data.SafeOutputs.Staged.String()
838 }
839
840 // Network configuration
841 var allowedDomains []string
842 firewallEnabled := false
843 firewallVersion := ""
844 if data.NetworkPermissions != nil {
845 allowedDomains = data.NetworkPermissions.Allowed
846 }
847 if firewallConfig := getFirewallConfig(data); firewallConfig != nil {
848 firewallEnabled = firewallConfig.Enabled
849 firewallVersion = firewallConfig.Version
850 if firewallEnabled && firewallVersion == "" {
851 firewallVersion = string(constants.DefaultFirewallVersion)
852 }

Calls 15

effectiveStrictModeMethod · 0.95
getInstallationVersionFunction · 0.85
getFirewallConfigFunction · 0.85
isFirewallEnabledFunction · 0.85
getDefaultAgentModelFunction · 0.85
IsReleasedVersionFunction · 0.85
hasWorkflowCallTriggerFunction · 0.85
getGitHubLockdownFunction · 0.85