Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions github-run-opencode/run-github-opencode.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,25 +455,29 @@ def _main() -> int:
# language instructions since there is nothing to respond to.
language = get_env("GITHUB_RUN_OPENCODE_LANGUAGE", "zh").strip().lower()
existing_prompt = get_env("PROMPT", "")
zh_instruction = (
"\n\n请使用中文回复。所有分析和说明均使用中文。"
"对于 prompt 中列出的判定关键词,使用其中文版本。"
"\n请勿使用 #N 格式(如 #1、#2)编号,GitHub 会自动将其转换为 issue/PR 引用。"
# Hash-number avoidance — keep in sync with multi-review/src/reviewers.ts.
hash_avoid_zh = (
"\n请勿使用 #N 格式(如 #1、#2)编号,"
"GitHub 会自动将其转换为 issue/PR 引用。"
"请使用 1. 2. 3. 或 - 的列表格式。"
)
en_hash_instruction = (
" Never use #N format (e.g. #1, #2) to number items — "
hash_avoid_en = (
"\nNever use #N format (e.g. #1, #2) to number items — "
"GitHub auto-converts #N to issue/PR references. "
"Use 1. 2. 3. or - list format instead."
)
zh_instruction = (
"\n\n请使用中文回复。所有分析和说明均使用中文。"
"对于 prompt 中列出的判定关键词,使用其中文版本。"
) + hash_avoid_zh
if existing_prompt:
if language == "en":
set_env("PROMPT", (
existing_prompt
+ "\n\nIMPORTANT: Respond entirely in English. "
"Use English for all analysis, explanations, and output. "
"For any verdict keywords listed in the prompt, use their English equivalents."
+ en_hash_instruction
+ hash_avoid_en
))
elif language == "zh":
set_env("PROMPT", existing_prompt + zh_instruction)
Expand Down
Loading