refactor(dify-agent): download Binding files through Agent Stub (#40143)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
盐粒 Yanli
2026-08-07 14:56:52 +00:00
committed by GitHub
co-authored by autofix-ci[bot]
parent c094117ca2
commit 916d7e1c96
71 changed files with 4692 additions and 2484 deletions
@@ -103,14 +103,21 @@ func newFileCommand() *cobra.Command {
Short: "Upload or download workflow files through the Agent Stub.",
}
var noDownloadLink bool
upload := &cobra.Command{
Use: "upload PATH",
Short: "Upload one sandbox-local file as a ToolFile output reference.",
Args: cobra.ExactArgs(1),
RunE: withEnv(func(env *agentcli.Environment, args []string, _ *cobra.Command) error {
return agentcli.RunFileUpload(env, args[0])
return agentcli.RunFileUpload(env, args[0], noDownloadLink)
}),
}
upload.Flags().BoolVar(
&noDownloadLink,
"no-download-link",
false,
"Skip creating a public download link after upload.",
)
var downloadTo string
download := &cobra.Command{
@@ -53,7 +53,12 @@ func TestCommandHelp(t *testing.T) {
{
name: "file upload",
args: []string{"file", "upload", "--help"},
want: []string{"dify-agent file upload", "Upload one sandbox-local file"},
want: []string{
"dify-agent file upload",
"Upload one sandbox-local file",
"--no-download-link",
"Skip creating a public download link after upload.",
},
},
{
name: "file download",