关于 windows 系统中 powershell7 不兼容 codex-cli 沙盒的问题

使用 pwsh 打开 codex-cli,AI 在调用 powershell 工具链的时候可能会报错:

windows sandbox: runner error: CreateProcessAsUserW failed

并且在修改 config.toml 配置后无果:

[windows]
sandbox = "unelevated"

解决方式:

如果你安装过微软商店中下载的 powershell7,需要先卸载,然后再安装官方 msi 版本:

# 卸载微软商店中的 powershell7
winget uninstall --id Microsoft.PowerShell --exact
# 安装官方 msi 应用程序
winget install --id Microsoft.PowerShell --source winget --installer-type wix --scope machine

注意:官方 msi 的安装包位于 github 中,所以可能需要科学上网。

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容