官方教程中文版团队与集成
从 Slack 使用 Codex
你可以在 Slack 中使用 Codex,从 channels 和 threads 直接启动 coding tasks。
你可以在 Slack 中使用 Codex,从 channels 和 threads 直接启动 coding tasks。
mention @Codex 并附上 prompt,Codex 会创建 cloud task,并回复结果。
截图:
https://developers.openai.com/images/codex/integrations/slack-example.png
设置 Slack App
- 设置 Codex cloud tasks。你需要 Plus、Pro、Business、Enterprise 或 Edu plan,见 ChatGPT pricing;还需要 connected GitHub account,以及至少一个 environment。
- 打开 Codex settings,为你的 workspace 安装 Slack app。根据 Slack workspace policies,可能需要 admin approve install。
- 把
@Codex添加到 channel。如果还没有添加,当你 mention 它时,Slack 会提示你。
启动任务
- 在 channel 或 thread 中 mention
@Codex,并写入 prompt。Codex 可以 reference thread 中较早的 messages,所以通常不需要重复上下文。 - 可选:在 prompt 中指定 environment 或 repository,例如
@Codex fix the above in openai/codex。 - 等 Codex reaction(👀),并回复 task link。完成后,Codex 会发布 result,并根据你的 settings,可能在 thread 中附上 answer。
Codex 如何选择环境和仓库
- Codex 会 review 你有 access 的 environments,并选择最匹配 request 的 environment。如果 request ambiguous,则 fallback 到你最近使用过的 environment。
- task 会基于该 environment repo map 中列出的第一个 repository default branch 运行。如果你需要不同 default 或更多 repositories,请在 Codex 中更新 repo map。
- 如果没有 suitable environment 或 repository,Codex 会在 Slack 中回复修复说明,你处理后再 retry。
企业数据控制
默认情况下,Codex 会在 thread 中回复 answer,answer 可能包含它运行环境中的信息。
如果要避免这种情况,Enterprise admin 可以在 ChatGPT workspace settings 中取消 Allow Codex Slack app to post answers on task completion。
admin 关闭 answers 后,Codex 只会回复 task link。
数据使用、隐私和安全
当你 mention @Codex 时,Codex 会接收你的 message 和 thread history,用来理解 request 并创建 task。
data handling 遵循 OpenAI 的 Privacy Policy、Terms of Use 以及其他适用 policies。
更多 security 信息,见 Codex security documentation。
Codex 使用 large language models,可能出错。始终 review answers 和 diffs。
使用建议和排错
- Missing connections:如果 Codex 无法确认你的 Slack 或 GitHub connection,它会回复一个 reconnect link。
- Unexpected environment choice:在 thread 中回复你希望使用的 environment,例如
Please run this in openai/openai (applied),然后再次 mention@Codex。 - Long or complex threads:在最新 message 中 summarize key details,避免 Codex 漏掉 thread 早期隐藏的 context。
- Workspace posting:部分 Enterprise workspaces 会限制发布 final answers。遇到这种情况,请打开 task link 查看 progress 和 results。
- More help:见 OpenAI Help Center。