Skip to content

fix(review): print review reject/apply output in English (#836) - #859

Merged
jeff-r2026 merged 2 commits into
Tencent:mainfrom
Dev-next-gen:fix/review-cmd-english-output
Sep 28, 2026
Merged

jeff-r2026 merged 2 commits into
Tencent:mainfrom
Dev-next-gen:fix/review-cmd-english-output

Conversation

@Dev-next-gen

@Dev-next-gen Dev-next-gen commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

teamai review --reject and teamai review --apply print Chinese strings in their console output: 已拒绝 for "rejected", 应用失败 for "apply failed", and Chinese error reasons (target.section 缺失, payload.content 为空, 目标文件不存在, 不支持自动应用). Issue #836 established that CLI output must be English, and #840 fixed the same class of bug in cache-cmd.ts and import-local.ts; review-cmd.ts was missed.

Before:

[review] 已拒绝:test-item
[review] 应用失败:no-section — target.section 缺失

After:

[review] rejected: test-item
[review] apply failed: no-section — target.section is missing

Changes

  • Translate the six user-facing strings in applyOne's error reasons and reviewCmd's reject/apply messages
  • Code comments are left as-is — they are not user-facing

Test

Three tests assert the English text and the absence of CJK characters in the output, following the same pattern as the cache-cmd tests added in #840. All three fail before this fix:

× reject prints English, not Chinese
  → expected '[review] 已拒绝:test-item' to contain 'rejected'
× apply-failure reason is English when target.section is missing
  → expected '[review] 应用失败:no-section — target.sec…' to contain 'apply failed'
× apply-failure reason is English when payload.content is empty
  → expected '[review] 应用失败:empty-payload — payload…' to contain 'apply failed'

Real-CLI verification

Built with npm run build (tsup, Node 22), then ran three teamai review invocations against seeded .teamai/pending-review.jsonl fixtures:

$ node dist/index.js review demo-reject --reject
[review] rejected: demo-reject

$ node dist/index.js review no-sec --apply
[review] apply failed: no-sec — target.section is missing

$ node dist/index.js review empty-p --apply
[review] apply failed: empty-p — payload.content is empty

All three paths print English. No CJK characters in the output.

Found by a defect-hunting pipeline I build and run (Dev-next-gen), using Claude Code with Anthropic's Claude Opus 5.

teamai review --reject and --apply printed Chinese strings in their
console output: 已拒绝 for rejected, 应用失败 for apply failed, and
Chinese error reasons (缺失, 为空, 不存在, 不支持自动应用). Issue Tencent#836
established that CLI output must be English, and Tencent#840 fixed the same
class of bug in cache-cmd and import-local; review-cmd was missed.

Translate the six user-facing strings in applyOne's error reasons and
reviewCmd's reject/apply messages. Code comments are left as-is — they
are not user-facing. Add three tests that assert the English text and
no CJK characters in the output; all three fail before this fix.
The domain-drift apply test in review-cmd.test.ts still asserted the
Chinese string '不支持' which was translated in the previous commit.
Update the assertion to match the English output.
@jeff-r2026 jeff-r2026 self-assigned this Sep 27, 2026
@github-actions

Copy link
Copy Markdown
  • [P1 blocking] Add a representative real-CLI verification record. This PR changes runtime output in src/review-cmd.ts:239, but the PR description documents only Vitest assertions and their pre-fix failures. The repository’s Code Review Rules explicitly require an end-to-end/real-CLI record for runtime behavior changes before merge.

@jeff-r2026
jeff-r2026 merged commit 78477fa into Tencent:main Sep 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants