codex在win的奇怪问题解决办法

https://linux.do/t/topic/999965

上次说codex巨慢,原来是win上面的各种奇特bug,现在巨好用!!!

如果有需要的佬可以留言,我出个教程(codex你一点也不乘,完全没有考虑win用户)

65专属

image
我上次吐槽的帖子居然有65耶


1.使用各种奇怪的编辑方式进行编辑的解决办法(codex慢的罪魁祸首)

Codex CLI问题

  1. 命令包裹
    这其实是两者共性的问题,你可以看到一堆命令是用 pwsh -nologo 这种方式转义执行的,效率非常低,这也是codex执行慢的一部分原因,这个可以通过 AGENTS.md 中强制让其直接执行命令,把这行加到 AGENTS.md 可以解决这个问题
Hard Requirement: call binaries directly in functions.shell, always set workdir, and avoid shell wrappers such as `bash -lc`, `sh -lc`, `zsh -lc`, `cmd /c`, `pwsh.exe -NoLogo -NoProfile -Command`, and `powershell.exe -NoLogo -NoProfile -Command`.
  1. 使用 python 编辑文件
    这是 codex 模型的特有问题,有大佬分析出来,codex模型不会调用系统工具 apply_patch,把下面这段放到 AGENTS.md 中可以使用系统的编辑工具
- Text Editing Priority: Use the `apply_patch` tool for all routine text edits; fall back to `sed` for single-line substitutions only if `apply_patch` is unavailable, and avoid `python` editing scripts unless both options fail.
- `apply_patch` Usage: Invoke `apply_patch` with the patch payload as the second element in the command array (no shell-style flags). Provide `workdir` and, when helpful, a short `justification` alongside the command.

- Example invocation:

```bash
{"command":["apply_patch","*** Begin Patch\n*** Update File: path/to/file\n@@\n- old\n+ new\n*** End Patch\n"],"workdir":"<workdir>","justification":"Brief reason for the change"}

2.终端的中文乱码

方案一(最最简单的)

添加提示词

**对话开始前,判断当前系统环境,如果是`windows`系统,则先执行如下指令,在进行其他操作:**

   [Console]::InputEncoding  = [Text.UTF8Encoding]::new($false)
   [Console]::OutputEncoding = [Text.UTF8Encoding]::new($false)
   chcp 65001 > $null```

方案二

直接使用git-bash

方案三(还是不能解决看这个佬的)

https://linux.do/t/topic/974813

方案四(不推荐,会导致某些旧软件无法使用)

1.打开 Windows 设置 → 时间和语言 → 语言和区域。
2.在右侧找到并点击 “管理语言设置”。
3.在弹出的新窗口中,切换到 “管理” 选项卡。
4.点击 “更改系统区域设置…” 按钮。
5.在弹出的窗口中,勾选最下方的 “Beta: 使用 Unicode UTF-8 提供全球语言支持”。
6.点击“确定”,然后在重启电脑即可。

3.codex在终端/插件需要一直手动确认

在终端:

codex插件问题求助 - #5,来自 pluto233
在/approve 选择 full access

在插件

codex插件问题求助 - #6,来自 orangelckc

42 个赞

确实好用!

还是不水了 :saluting_face:

2 个赞

你怎么那么水啊!!!

现在换系统了?还是codex升级了?

codex没有适配终端导致的巨慢无比

现在是啥方案,等你的手把手教程

1 个赞

w 感谢分享喵~(瘫

@6512345 提前等待65呢(逃

1 个赞

可以啦,你瞅瞅叭

1 个赞

我瞅瞅啦

所以能直接在线使用不,体验怎么样

难道不是在终端或者插件用的咩

嘿嘿,轻量使用,有时候用pad

1 个赞

要是在线用,好像也没啥门槛吧

codex 今天更新 0.44 当输入时在我这边出现了删除或空格键导致前一个字不可见的情况,如果有同样问题的可以选择降级

1 个赞

感谢大佬 !

1 个赞

还是不好使只能是缓解

我再补充个奇怪问题,vscode 无法打开 codex 插件(windows 或 remote ssh 都无法打开),提示

command ‘chatgpt.openSidebar’ not found

我还没找到解决方案,因为我现在在蹬 claude code ,不用担心编码等问题:tieba_013:

我在本地没有复现这个问题欸

来啦www

win的bug