@kyun.si/codex-polish 0.0.1-beta.2 → 0.0.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/CONTRIBUTING.en.md +6 -6
  3. package/CONTRIBUTING.md +6 -6
  4. package/README.en.md +53 -18
  5. package/README.md +53 -18
  6. package/SECURITY.en.md +5 -3
  7. package/SECURITY.md +4 -2
  8. package/docs/technical.en.md +61 -39
  9. package/docs/technical.md +58 -32
  10. package/evaluation/README.en.md +4 -4
  11. package/evaluation/README.md +4 -4
  12. package/package.json +1 -1
  13. package/plugins/codex-polish/.codex-plugin/plugin.json +1 -1
  14. package/plugins/codex-polish/hooks/editor_prompt.mjs +51 -0
  15. package/plugins/codex-polish/hooks/history.mjs +107 -66
  16. package/plugins/codex-polish/hooks/preferences.mjs +140 -117
  17. package/plugins/codex-polish/hooks/project_setting.mjs +40 -30
  18. package/plugins/codex-polish/hooks/recovery.mjs +2 -69
  19. package/plugins/codex-polish/hooks/rewrite_mode.mjs +19 -0
  20. package/plugins/codex-polish/skills/codex-polish/SKILL.md +3 -31
  21. package/plugins/codex-polish/skills/codex-polish/WORKFLOW.md +47 -0
  22. package/plugins/codex-polish/skills/codex-polish/references/acp.md +30 -18
  23. package/plugins/codex-polish/skills/codex-polish/references/codex-polish-editor.md +4 -2
  24. package/plugins/codex-polish/skills/codex-polish/scripts/acp_models.mjs +31 -6
  25. package/plugins/codex-polish/skills/codex-polish/scripts/acp_payload.mjs +55 -30
  26. package/plugins/codex-polish/skills/codex-polish/scripts/cli_io.mjs +2 -2
  27. package/plugins/codex-polish/skills/codex-polish/scripts/decisions.mjs +49 -58
  28. package/plugins/codex-polish/skills/codex-polish/scripts/editor_role.mjs +48 -0
  29. package/plugins/codex-polish/skills/codex-polish/scripts/format_reply.mjs +171 -0
  30. package/plugins/codex-polish/skills/codex-polish/scripts/previous_reply.mjs +31 -0
  31. package/plugins/codex-polish/skills/codex-polish/scripts/rewrite_material.mjs +28 -0
  32. package/plugins/codex-polish/skills/codex-polish/scripts/text_guard.mjs +65 -154
  33. package/plugins/codex-polish/skills/codex-polish-setup/SKILL.md +39 -11
  34. package/plugins/codex-polish/skills/codex-polish-setup/references/credentials.en.md +8 -6
  35. package/plugins/codex-polish/skills/codex-polish-setup/references/credentials.md +3 -3
  36. package/scripts/install.mjs +389 -123
  37. package/scripts/native_cache.mjs +5 -5
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: codex-polish-setup
3
- description: Set up Codex Polish, view or change project settings, choose a Gemini model, or troubleshoot installation. 设置回复润色、选择模型、调整语言,或排查插件问题。
3
+ description: Set up Codex Polish, manage a project's polishing prompt and default rewrite mode, choose a Gemini model or troubleshoot installation. 配置回复润色,查看、设置或恢复项目润色提示词,更改项目默认改写模式、选择模型、调整语言或排查安装。
4
4
  ---
5
5
 
6
6
  # Codex Polish setup · 配置回复润色
@@ -9,18 +9,34 @@ Run helpers with Node.js 22.16+ on the machine running Codex.
9
9
 
10
10
  Use the [project settings script](../../hooks/preferences.mjs). Run `node "<preferences.mjs>" check --cwd "<absolute project directory>"` in the environment that runs Codex. Use the project the user named, or their current project. Settings persist there across chats. Run the relevant setter directly when the user has already made a choice. Read back the effective value after saving.
11
11
 
12
+ Use the [rewrite skill](../codex-polish/SKILL.md) when someone asks for Turbo on a particular answer, including an earlier one. A request such as “上一条绕得我没看懂,让 Gemini 换个说法” or “Use Turbo for this answer” applies once. Use the settings commands when the user asks to change the project's default.
13
+
12
14
  ## Language
13
15
 
14
- Use one language for the conversation, including menus, status, examples and recovery steps. A direct request for a response in a particular language applies to that response. Otherwise use the project's `language_mode` when it is `zh` or `en`. In `auto`, follow the user's current Chinese or English message. For a bare “Setup”, a click, a number, or unclear text, use the language established in the chat, then `check.ui_language` from the local environment. Change the saved language only when the user asks to change the plugin's language. Keep model names, paths, variable names and commands intact. The language of polished replies follows the draft.
16
+ Use one language for the conversation, including menus, status, examples and recovery steps. A direct request for a response in a particular language applies to that response. Otherwise use the project's `language_mode` when it is `zh` or `en`. In `auto`, follow the user's current Chinese or English message. For a bare “Setup”, a click, a number, or unclear text, use the language established in the chat, then `check.ui_language` from the local environment. Change the saved language only when the user asks to change the plugin's language. Keep model names, paths, variable names and commands intact.
15
17
 
16
18
  ## First use
17
19
 
18
20
  Opening **Setup** or saying “配置回复润色” / “Set up Codex Polish” starts with local checks. Keep the first answer short. Skip the general tour if the user asked about a particular setting.
19
21
 
20
- Use the effective project mode from the local check. A project without a saved mode starts in automatic mode. Before inviting the user to trust Codex Polish’s `UserPromptSubmit`, explain what polishing shares. Google receives the current question and draft with fixed details masked, plus up to the configured number of eligible earlier exchanges as written (two by default). If OpenAI checks are enabled, OpenAI receives the protected current question and draft, plus the candidate on the final check.
22
+ For general setup, if `check.rewrite_mode_configured` is false, use the host's single-select control to offer these two named options in the conversation's language. Show Normal first as the default. If the host has no selection control, present the mode names and accept a natural-language choice such as “用普通模式” or “Use Turbo”. Wait for the user's choice.
23
+
24
+ | 中文 | English |
25
+ | --- | --- |
26
+ | 普通(Normal,默认)。可让 OpenAI 先判断草稿是否需要改写。 | Normal (default). Optionally ask OpenAI whether the draft needs editing. |
27
+ | Turbo。跳过 OpenAI,直接让 Gemini 改写符合条件的草稿。 | Turbo. Skip OpenAI and send eligible drafts directly to Gemini for rewriting. |
28
+
29
+ Save the selection with `set-rewrite-mode normal` or `set-rewrite-mode turbo` and `--cwd "<project>"`, then recheck and continue setup. If a valid mode is already saved, continue with it. A request that names a setting goes straight to that setting. Automatic, manual and off control when polishing runs, independently of this choice.
30
+
31
+ During first setup, once agy is available and `check.gemini_model_configured` is false, offer Gemini 4 Hydrogen (default) and “Choose from my account”. Save an explicit default locally with `set-model --reset`. For the account option, follow the live model lookup below.
32
+
33
+ Before inviting the user to trust Codex Polish’s `UserPromptSubmit`, explain what polishing shares. In normal mode, the optional OpenAI style check receives only the current question, draft and any custom polishing prompt. When Gemini rewrites, Google receives the question and draft as written, including any code, commands and paths, and up to the configured number of eligible earlier exchanges as written (two by default). Use the installation notice in the user's language for the custom prompt disclosure.
21
34
 
22
- - **A required step is missing.** Lead with the next step from the [中文指南](references/credentials.md) or [English guide](references/credentials.en.md). For `agy_missing`, explain that Gemini needs the Antigravity CLI. The user can run `node scripts/install.mjs setup --install-agy` from the extracted package on the machine running Codex, then ask to check setup again. Offer Google's installation guide if the package is unavailable. Use the existing sign-in and suggest opening `agy` to sign in only if Antigravity requests authentication. When a saved model or optional OpenAI key is invalid, offer the relevant recovery choice.
23
- - **Ready to try.** For automatic mode, direct the user to Codex **Settings → Hooks** (`/hooks` in the CLI) to trust `UserPromptSubmit`. Have them start a fresh chat and ask an ordinary question such as “用一句话解释 DNS。” / “Explain what DNS does in one sentence.” For manual mode, show the explicit request “把这轮回复润色一下” / “Polish this reply”. Explicit requests work before trusting the hook and use only the current question and draft then. If the project is off, explain that the user can choose automatic or manual mode to try polishing.
35
+ - 中文:如果你写了自己的润色提示词,插件会把它和草稿一起发给 Google。开了 OpenAI 检查的话,OpenAI 只在判断草稿要不要改时用到这段提示词。
36
+ - English: If you set a custom polishing prompt, it is also sent to Google when rewriting. If the OpenAI style check is on, it also uses that prompt to decide whether the draft needs editing.
37
+
38
+ - **A required step is missing.** Lead with the next step from the [中文指南](references/credentials.md) or [English guide](references/credentials.en.md). For `agy_missing`, explain that Gemini needs the Antigravity CLI. The user can run `node scripts/install.mjs setup --install-agy` from the extracted package on the machine running Codex, then ask to check setup again. Offer Google's installation guide if the package is unavailable. Use the existing sign-in and suggest opening `agy` to sign in only if Antigravity requests authentication. If the saved model is invalid, offer the live picker. An unavailable optional OpenAI check routes eligible drafts to Gemini.
39
+ - **Ready to try.** For automatic mode, direct the user to Codex **Settings → Hooks** (`/hooks` in the CLI) to trust `UserPromptSubmit`. Have them start a fresh chat and ask an ordinary question such as “用一句话解释 DNS。” / “Explain what DNS does in one sentence.” For manual mode, show the explicit request “把这轮回复润色一下” / “Polish this reply”. Explicit requests work before trusting the hook and omit earlier exchanges then. If the project is off, explain that the user can choose automatic or manual mode to try polishing.
24
40
  - **Offer a short path onward.** For example, in automatic mode offer “只在我要求时润色 · 关闭回复润色 · 更多设置” / “Only polish when I ask · Turn off Codex Polish · More settings”. Keep the user's current settings until they choose. “More settings” leads to the choices below, including the model picker. A local check does not open a provider session or ask for API keys. Run the model lookup only when the user chooses it or explicitly asks to verify available models.
25
41
 
26
42
  ## Project settings
@@ -30,23 +46,35 @@ When asked to show settings, describe the current values in plain language. Offe
30
46
  | What the user can change | What to do |
31
47
  | --- | --- |
32
48
  | **什么时候润色 / When to polish** | “自动润色 / Polish automatically” → `set-mode auto` (default). “只在我要求时 / Only when I ask” → `set-mode manual`. “关闭 / Turn off” → `set-mode off`. Off also skips explicit requests. For auto, explain the sharing and hook steps above. |
49
+ | **改写模式 / Rewrite mode** | “切换到 Turbo 模式 / Switch to turbo mode” → `set-rewrite-mode turbo`. Turbo sends every eligible draft directly to Gemini over ACP, even with an OpenAI key. Its built-in prompt asks for an active rewrite every time. “恢复普通模式 / Switch back to normal mode” → `set-rewrite-mode normal` (default). Normal resumes the project's saved OpenAI preference. Each choice leaves the trigger setting in effect. |
33
50
  | **改写模型 / Rewrite model** | “选择改写模型 / Choose a rewrite model” opens the account's live Gemini list below. Default is Gemini 4 Hydrogen. “恢复默认模型 / Restore the default model” → `set-model --reset`. |
34
- | **带多少对话历史 / Conversation history** | “带最近 5 轮 / Include the last 5 exchanges” → `set-history-turns 5`. Accept 0–10, default 2. Zero sends just the current question and draft. One exchange is one earlier completed user input and final Codex reply. History needs a trusted hook and readable transcript. Up to 16 KiB can be attached, so fewer exchanges may fit. For “no history just this time”, omit `--cwd` from the ACP prompt formatter for this rewrite only. |
35
- | **额外检查 / Extra OpenAI checks** | Explain what the choice does in ordinary words. With an OpenAI key, OpenAI checks whether editing is worthwhile and whether the result keeps the meaning. “这个项目只用 Gemini 改写 / Use only Gemini for rewrites in this project” → `set-decisions off`. “有密钥时使用 OpenAI 检查 / Use OpenAI checks when a key is available” → `set-decisions auto` (default). Without a key, Gemini can handle eligible rewrites. OpenAI receives current material only. |
51
+ | **润色提示词 / Polishing prompt** | “查看润色提示词 / Show the polishing prompt”, “设置润色提示词 / Set the polishing prompt”, and “恢复默认润色提示词 / Restore the default polishing prompt” use the local prompt commands below. |
52
+ | **Gemini 改写时带多少历史 / History for Gemini rewrites** | “带最近 5 轮 / Include the last 5 exchanges” → `set-history-turns 5`. Accept 0–10, default 2. Zero omits earlier exchanges. One exchange is one earlier completed user input and final Codex reply. History needs a trusted hook and readable transcript. For “no history just this time”, pass `--no-history` to the ACP prompt formatter with the original project’s `--cwd`. |
53
+ | **OpenAI 风格检查 / OpenAI style check** | In normal mode with an OpenAI key, the plugin can ask OpenAI whether the draft needs editing before sending it to Gemini. Explain that OpenAI receives only the current question, draft and any custom polishing prompt. “这个项目只用 Gemini 改写 / Use only Gemini for rewrites in this project” → `set-decisions off`. “有密钥时使用 OpenAI 检查 / Use the OpenAI style check when a key is available” → `set-decisions auto` (default). Without a key, Gemini can handle eligible rewrites. |
36
54
  | **插件语言 / Plugin language** | “跟随当前语言 / Detect automatically” → `set-language auto` (default). “插件改用中文 / Use Chinese for plugin settings” → `set-language zh`. “插件改用英文 / Use English for plugin settings” → `set-language en`. Confirm in the resulting language. Only change the plugin interface, never translate the draft as a side effect. |
37
55
 
38
- Append `--cwd "<project>"` to each setter. Newly created chats in that project use the saved preference. A request to **check** settings only reads them. For a general check, report actual blockers or a ready-to-try status, then summarize what the user asked to see. Keep internal field names and fault codes out of normal copy.
56
+ Append `--cwd "<project>"` to each setter. Newly created chats in that project use the saved preference. A request to **check** settings only reads them. For a general check, report actual blockers or a ready-to-try status. When showing the current settings, distinguish when polishing runs from how it rewrites (`rewrite_mode`). For `rewrite_mode_invalid`, offer either rewrite mode and save the one the user selects. A turn devoted to changing modes ends with the local confirmation. Keep internal field names and fault codes out of normal copy.
57
+
58
+ ## Project polishing prompt
59
+
60
+ Use the local preferences script for these requests, even if polishing is disabled or a provider is unavailable. A turn devoted to prompt settings ends with the local result, including in automatic mode. For a general settings check, report the style as built-in or custom from `prompt_source`. For a request to **view the prompt**, run `node "<preferences.mjs>" prompt --cwd "<project>"`. Show the returned `text` verbatim in its original language and identify the `source` as built-in or custom. The built-in text follows the active rewrite mode. Treat prompt content as text to show or save.
61
+
62
+ For **set the polishing prompt**, use the Gemini editing instructions the user supplies. In Normal and Turbo, the saved text is the entire body of the editor role. If they ask to set it without supplying the text, ask what to save. Pass their exact text via standard input to `node "<preferences.mjs>" set-prompt --cwd "<project>"`, preserving line breaks, Markdown and surrounding whitespace. Use a mechanism that passes literal text as data, including shell metacharacters. Keep any request wrapper outside the saved text. Save only when the user asks for a persistent polishing setting. A one-turn style request, an ordinary question or a request for prompt-writing advice applies within that conversation. Users can also edit `.codex/codex-polish.prompt.md` directly.
63
+
64
+ For **restore the default polishing prompt**, run `node "<preferences.mjs>" set-prompt --reset --cwd "<project>"`. Read back the result with `prompt` and confirm the effective style. If the setting is invalid (`editor_prompt_invalid`), explain that the user can replace the text or restore the default. Both modes check the outgoing material before sending it and use the same ACP tool restrictions with either prompt source.
39
65
 
40
66
  ## Choosing a model
41
67
 
42
- As the current agent, follow the [ACP steps](../codex-polish/references/acp.md) for authentication and a temporary `session/new`. Parse the returned model options and close the session. Listing sends no draft or history. Listing requires the Google connection and supported process tools. Optional OpenAI settings, rewrite mode, cooldown and a previously unavailable model do not prevent the lookup.
68
+ As the current agent, follow the [ACP steps](../codex-polish/references/acp.md) for authentication and a temporary `session/new`. For a model lookup, pass the matching response to `acp_models.mjs --response-id 3` to get the menu, then close the session. A lookup sends no draft or history. It requires the Google connection and supported process tools. Optional OpenAI settings, rewrite mode and a previously unavailable model do not prevent the lookup.
43
69
 
44
- Show every returned Gemini name in provider order. Mark the **project's saved choice** or the plugin default and distinguish it from the provider's current model. If the saved model is missing, say so. Show IDs only to disambiguate duplicate names. Use a single-select control if it can show all options. Otherwise show a numbered list and accept a number. Hold the number-to-ID mapping from the list the user saw. Save the exact chosen ID with `set-model "<id>"`. An unambiguous named choice can be saved directly after the lookup. If the earlier menu is no longer available, show a fresh list before accepting a number. Viewing, cancellation, lookup failure or an empty result leaves project settings alone. Users can return to default without an online lookup.
70
+ Show every returned Gemini name in provider order. Mark the project’s saved model or default, and identify a missing selection. Use the native single-select control, paging choices if needed. In text-only chat, show the names and accept the model name. Show IDs for duplicate names. Save the chosen ID with `set-model "<id>"`. Viewing, cancellation, failed lookup or an empty result leaves settings alone. Restoring the default works offline.
45
71
 
46
72
  ## Troubleshooting
47
73
 
48
74
  Use the guide in the conversation's language for Antigravity sign-in, optional OpenAI key creation, or enterprise identities. Never ask users to paste keys in chat. `existing-session` uses Antigravity's own login. If ACP reports authentication required, ask the user to open `agy` in a terminal on the machine running Codex and sign in. Google AI Studio keys apply only when the user explicitly selects `gemini-api-key`. Offer the English or Chinese guide for that exact case.
49
75
 
50
- For “为什么没改写 / Why wasn't my reply polished?”, distinguish local setup issues, manual/off mode, deliberate fixed-format output and later provider failures. If OpenAI checks are active, an already clear draft or a change in meaning can also keep the original. Use actionable wording for the actual cause. For a cooldown, give the remaining time and remedy. A request to **test the connection** authorizes the ACP initialize handshake and cleanup without a draft. A successful handshake establishes connectivity. Successfully opening a session and reading the model menu also checks the signed-in account. Do not use a writing request to test setup without the user asking.
76
+ For “为什么没改写 / Why wasn't my reply polished?”, use the status and available trace for that turn. Use the reason recorded before sending if the plugin skipped polishing, or the ACP outcome if the request ended without a complete reply. When Gemini returns a complete reply, both modes format its text for display. A changed reply shows Gemini’s text first. In clients that support folding, users can expand “查看 GPT 原稿” or “View original GPT draft” below it for the full original. If Gemini returns the original text, the reply says so and shows it once. A user who requests only the polished text sees one body, and exact-output requests keep their required format.
77
+
78
+ A request to **test the connection** authorizes the ACP initialize handshake and cleanup without a draft. A successful handshake establishes connectivity. Successfully opening a session and reading the model menu also checks the signed-in account. Do not use a writing request to test setup without the user asking.
51
79
 
52
80
  Use `project-hook` only when the host has not loaded the plugin hook and the user asks for a project hook. Merge it into `.codex/hooks.json` without duplicating an existing handler. The user trusts it in Codex.
@@ -2,19 +2,21 @@
2
2
 
3
3
  [简体中文](credentials.md)
4
4
 
5
+ Run interactive `setup` from your project directory. Use **↑ / ↓** to select a rewrite mode and press **Enter** to confirm. **Normal** is selected by default and allows the optional OpenAI style check below. **Turbo** skips OpenAI and sends eligible drafts directly to Gemini. You can also say **“Set up Codex Polish”** in a project chat and select a mode there. In a text-only chat, reply with the mode name. The project remembers your choice. Setup also offers Gemini 4 Hydrogen or a list from your Antigravity account. Only the second choice starts a Codex session to look up the models.
6
+
5
7
  ## Use your Antigravity sign-in
6
8
 
7
9
  1. Install the plugin on the machine that runs Codex, using the same system account. It looks for `agy` on the Codex process’s PATH and then at `~/.local/bin/agy`. On a first install from Finder or an interactive terminal, you can accept the offer to install Google’s official CLI or skip it. For an unattended install or to add the CLI later, run `node scripts/install.mjs setup --install-agy` from the extracted package. You can also install it directly from Google. [Antigravity installation guide](https://antigravity.google/docs/getting-started/?tab=cli)
8
10
  2. The plugin uses your existing Antigravity sign-in. If Antigravity requests authentication, run `agy` in your terminal and sign in. If your shell can’t find the installed CLI, open `~/.local/bin/agy` directly.
9
- 3. Projects default to automatic polishing. On a rewrite, Google receives your current question and draft with fixed details such as code, commands, and paths masked. Up to two earlier completed exchanges are included as written by default. In Codex **Settings → Hooks** (`/hooks` in the CLI), trust the plugin’s `UserPromptSubmit` hook. Start a fresh project chat and ask **“Explain what DNS does in one sentence.”**
11
+ 3. Projects default to automatic polishing. On a rewrite, Google receives your current question and draft as written, including any code, commands, and paths. Gemini also receives any custom polishing prompt and, by default, up to two earlier completed exchanges as written. In Codex **Settings → Hooks** (`/hooks` in the CLI), trust the plugin’s `UserPromptSubmit` hook. Start a fresh project chat and ask **“Explain what DNS does in one sentence.”**
10
12
 
11
- Say **“Only polish when I ask”** for manual mode or **“Turn off Codex Polish”** to disable polishing. Before trusting the hook, you can still ask explicitly to polish a reply using just the current question and draft. The default setup works without API keys. If Codex runs on a remote machine, follow these steps there.
13
+ Say **“Only polish when I ask”** for manual mode or **“Turn off Codex Polish”** to disable polishing. Before trusting the hook, you can still ask explicitly to polish a reply without including earlier exchanges. The default setup works without API keys. If Codex runs on a remote machine, follow these steps there.
12
14
 
13
15
  Say **“Check Codex Polish setup”** to inspect the local configuration or **“Choose a rewrite model”** to see the Gemini models your account can use.
14
16
 
15
- ## Optional OpenAI checks
17
+ ## Optional OpenAI style check
16
18
 
17
- When `OPENAI_API_KEY` is set, the default configuration uses OpenAI to check whether the draft needs editing and whether the edit keeps its meaning. These checks send the protected current question and draft to OpenAI, plus the candidate for the final check. The OpenAI project linked to the key covers the Decisions API usage for `gpt-6-luna`. [Decisions API](https://developers.openai.com/api/docs/guides/decisions)
19
+ In normal mode, when `OPENAI_API_KEY` is set, the plugin by default asks OpenAI whether the draft needs editing before sending it to Gemini. OpenAI receives only the current question, draft, and any custom polishing prompt. Say **“Switch to turbo mode”** to send every eligible draft directly to Gemini. Turbo skips OpenAI even with a key. Say **“Switch back to normal mode”** to resume the project’s saved style-check setting. The project’s history setting applies only to Gemini rewrites. The OpenAI project linked to the key covers the Decisions API usage for `gpt-6-luna`. [Decisions API](https://developers.openai.com/api/docs/guides/decisions)
18
20
 
19
21
  1. Open your OpenAI project’s **API keys** page. Choose **Create new secret key**, name it something like `codex-polish`, and save it in a password manager. For restricted keys, allow `POST /v1/decisions` and make sure the project can use `gpt-6-luna`. [Create a project key](https://platform.openai.com/api-keys)
20
22
  2. Pass the key as `OPENAI_API_KEY` to the process running Codex. In a bash or zsh terminal, run these commands. Paste the key when prompted, then press Return. The terminal hides it while you type.
@@ -26,9 +28,9 @@ When `OPENAI_API_KEY` is set, the default configuration uses OpenAI to check whe
26
28
  export OPENAI_API_KEY
27
29
  ```
28
30
 
29
- 3. Start `codex` from that same terminal. In the project, say **“Use OpenAI checks when a key is available.”** Then say **“Check Codex Polish setup.”** The local check confirms the setting and can catch a missing or malformed key. API access and quota are checked on a real request. [OpenAI billing](https://platform.openai.com/account/billing/overview)
31
+ 3. Start `codex` from that same terminal. In the project, say **“Use the OpenAI style check when a key is available.”** Then say **“Check Codex Polish setup.”** The local check confirms the setting and can catch a missing or malformed key. API access and quota are checked on a real request. [OpenAI billing](https://platform.openai.com/account/billing/overview)
30
32
 
31
- To turn the checks off for one project, say **“Use Gemini only.”** Other projects can keep using the key. Keep the key out of chat and project files.
33
+ To turn the check off for one project, say **“Use Gemini only.”** Other projects can keep using the key. Keep the key out of chat and project files.
32
34
 
33
35
  ### Desktop apps and remote Codex sessions
34
36
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](credentials.en.md)
4
4
 
5
- 插件默认沿用 Antigravity 登录,普通登录不用额外申请密钥。如果想让 OpenAI 判断什么时候值得润色、改稿有没有保留原意,可以配置下面的可选服务。
5
+ 在项目目录交互运行 `setup`,用 **↑ / ↓** 选择改写模式,按 **回车** 确认。默认选中 **普通(Normal)**,可使用下文的 OpenAI 风格检查。**Turbo** 跳过 OpenAI,直接让 Gemini 改写符合条件的草稿。也可以在项目聊天里说 **“配置回复润色”**,然后点选模式。如果聊天只支持文字,回复模式名即可。项目会记住你的选择。Gemini 默认沿用 Antigravity 登录。 接着可以选默认的 Gemini 4 Hydrogen,或让 Codex 查询你的 Antigravity 账号可用的模型。只有查询账号模型才会启动 Codex 会话。
6
6
 
7
7
  ## 准备 Antigravity
8
8
 
@@ -10,11 +10,11 @@
10
10
 
11
11
  只有 Antigravity 提示需要登录时,才需要在自己的终端运行 `agy` 登录。如果终端找不到命令,可以直接运行 `~/.local/bin/agy`。登录后回 Codex 再试一次改写。[ACP 认证说明](https://antigravity.google/docs/ide/extensions/acp#authentication)
12
12
 
13
- 项目默认自动润色。改写时,Google 会收到本轮问题和草稿,代码、命令、路径等固定内容会先替换成占位符。默认最多附带之前 2 轮完整问答,历史按原文发送。在 Codex 的 **设置 → Hooks**(CLI 输入 `/hooks`)里信任插件的 `UserPromptSubmit`,再开一个项目聊天,问 **“用一句话解释 DNS。”** 如果想自己决定何时润色,可以说 **“只在我要求时润色”**。信任 hook 前也可以点名润色本轮问答。想停用就说 **“关闭回复润色”**。
13
+ 项目默认自动润色。改写时,Google 会收到本轮问题和草稿的原文,其中的代码、命令和路径也按原样发送。Gemini 还会收到自定义润色提示词(如有),默认最多附带之前 2 轮完整问答的原文。在 Codex 的 **设置 → Hooks**(CLI 输入 `/hooks`)里信任插件的 `UserPromptSubmit`,再开一个项目聊天,问 **“用一句话解释 DNS。”** 如果想自己决定何时润色,可以说 **“只在我要求时润色”**。信任 hook 前也可以点名润色本轮问答。想停用就说 **“关闭回复润色”**。
14
14
 
15
15
  ## 选配 OpenAI Decisions
16
16
 
17
- 默认有 `OPENAI_API_KEY` 时启用 Decisions,没有时直接走 ACP。OpenAI 会收到用占位符保护了固定内容的本轮问题和草稿,最后一次检查还会收到候选改稿。在项目里说 **“有 key 时用 Decisions”** 可以恢复这个默认设置。想保留现有 OpenAI key、只关掉本项目的两次判定,就说 **“这个项目只用 ACP”**。
17
+ 普通模式默认有 `OPENAI_API_KEY` 时启用 Decisions,没有时直接走 ACP。要把每份符合条件的草稿直接交给 Gemini,可以说 **“切换到 Turbo 模式”**。Turbo 跳过 OpenAI,即使配了密钥也一样。说 **“恢复普通模式”** 即可重新使用项目的 Decisions 设置。OpenAI 只收到本轮问题、草稿和项目已设置的自定义润色提示词,用来判断是否需要改写。项目的历史轮数仅用于 Gemini 改写。在项目里说 **“有 key 时用 Decisions”** 可以恢复这个默认设置。想保留现有 OpenAI key、只关掉本项目的风格检查,就说 **“这个项目只用 ACP”**。
18
18
 
19
19
  要启用 Decisions,可以直接用自己已有的项目密钥,也可以按下面的步骤新建一个。
20
20