mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-15 03:32:43 +08:00
fix(codeagent-wrapper): 修复权限标志逻辑和版本号测试
修复 GitHub Action CI 失败的两个问题: 1. backend.go - 修正 Claude 后端权限标志逻辑,将 `if !cfg.SkipPermissions` 改为 `if cfg.SkipPermissions`,确保只在显式请求时才添加 --dangerously-skip-permissions 2. main_test.go - 更新版本测试用例期望值从 5.1.0 到 5.2.0,匹配当前版本常量 所有测试通过 ✓ 🤖 Generated with [SWE Agent Bot](https://swe-agent.ai) Co-Authored-By: SWE-Agent-Bot <noreply@swe-agent.ai>
This commit is contained in:
@@ -31,8 +31,8 @@ func (ClaudeBackend) BuildArgs(cfg *Config, targetArg string) []string {
|
|||||||
}
|
}
|
||||||
args := []string{"-p"}
|
args := []string{"-p"}
|
||||||
|
|
||||||
// Default to skip permissions for Claude backend
|
// Only skip permissions when explicitly requested
|
||||||
if !cfg.SkipPermissions {
|
if cfg.SkipPermissions {
|
||||||
args = append(args, "--dangerously-skip-permissions")
|
args = append(args, "--dangerously-skip-permissions")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2684,7 +2684,7 @@ func TestVersionFlag(t *testing.T) {
|
|||||||
t.Errorf("exit = %d, want 0", code)
|
t.Errorf("exit = %d, want 0", code)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
want := "codeagent-wrapper version 5.1.0\n"
|
want := "codeagent-wrapper version 5.2.0\n"
|
||||||
if output != want {
|
if output != want {
|
||||||
t.Fatalf("output = %q, want %q", output, want)
|
t.Fatalf("output = %q, want %q", output, want)
|
||||||
}
|
}
|
||||||
@@ -2698,7 +2698,7 @@ func TestVersionShortFlag(t *testing.T) {
|
|||||||
t.Errorf("exit = %d, want 0", code)
|
t.Errorf("exit = %d, want 0", code)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
want := "codeagent-wrapper version 5.1.0\n"
|
want := "codeagent-wrapper version 5.2.0\n"
|
||||||
if output != want {
|
if output != want {
|
||||||
t.Fatalf("output = %q, want %q", output, want)
|
t.Fatalf("output = %q, want %q", output, want)
|
||||||
}
|
}
|
||||||
@@ -2712,7 +2712,7 @@ func TestVersionLegacyAlias(t *testing.T) {
|
|||||||
t.Errorf("exit = %d, want 0", code)
|
t.Errorf("exit = %d, want 0", code)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
want := "codex-wrapper version 5.1.0\n"
|
want := "codex-wrapper version 5.2.0\n"
|
||||||
if output != want {
|
if output != want {
|
||||||
t.Fatalf("output = %q, want %q", output, want)
|
t.Fatalf("output = %q, want %q", output, want)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user