Skip to content

feat(cli): add a TUI locale authority - #2691

Merged
Astro-Han merged 1 commit into
apache:mainfrom
me2seeks:feat/2554-tui-locale
Aug 18, 2026
Merged

feat(cli): add a TUI locale authority#2691
Astro-Han merged 1 commit into
apache:mainfrom
me2seeks:feat/2554-tui-locale

Conversation

@me2seeks

@me2seeks me2seeks commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • resolve the interactive TUI locale from MAKA_LOCALE=zh|en|auto, with auto following LC_ALL, LC_MESSAGES, then LANG
  • pass one resolved locale through first-run and normal TUI startup, so the welcome surface, slash autocomplete, and /help share the same CLI-owned catalog
  • keep the top-level CLI grammar and non-interactive output unchanged; unsupported explicit values fail before TUI startup

No global --locale option is added.

Testing

  • npm --workspace maka-agent run typecheck
  • npm --workspace maka-agent test (358 tests)
  • scoped Biome format and lint checks
  • process smoke checks for invalid MAKA_LOCALE and locale-independent --help

Fixes #2554
Part of #2672

中文对照

摘要

  • 交互式 TUI 从 MAKA_LOCALE=zh|en|auto 解析语言;auto 依次遵循 LC_ALLLC_MESSAGESLANG
  • 在首次配置和正常启动路径中传递同一个已解析 locale,使欢迎页、斜杠补全与 /help 共用 CLI 自己维护的 catalog
  • 顶层 CLI 语法和非交互输出保持不变;不支持的显式值会在 TUI 启动前给出配置错误

本 PR 不新增全局 --locale 参数。

验证

  • npm --workspace maka-agent run typecheck
  • npm --workspace maka-agent test(358 项测试)
  • 对改动文件执行 Biome format 与 lint
  • 进程级验证非法 MAKA_LOCALE 以及不受 locale 影响的 --help

@me2seeks
me2seeks force-pushed the feat/2554-tui-locale branch 2 times, most recently from 670248d to 2a008dd Compare August 12, 2026 14:04

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex automated review

I reviewed exact head 2a008dda1900e12ae8e2b7109c1a0a261620754f against #2554 and the stated CLI/TUI locale boundary. I found no specific, reproducible P0–P3 issues.

The CLI resolves the locale once for the interactive TUI and passes the same value through first-run and normal startup. The welcome surface, slash autocomplete, and /help share one typed catalog and command registry, while command tokens, non-interactive output, protocol behavior, and exit semantics remain unchanged. The focused CI checks for this head are green. This is a single coherent CLI/TUI slice; I did not find a useful deletion or split that would make it easier to verify.

Disclosure: This is an automated review performed by Codex using delegated adversarial review passes and a final evidence check. It has not been independently verified by Astro-Han or another human reviewer, does not constitute human approval, and does not represent the final judgment of a human reviewer.

@me2seeks
me2seeks force-pushed the feat/2554-tui-locale branch from 2a008dd to b2ba4bf Compare August 17, 2026 13:44
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.


Comment @coderabbitai help to get the list of available commands.

@me2seeks
me2seeks force-pushed the feat/2554-tui-locale branch from b2ba4bf to f3e9712 Compare August 17, 2026 14:25

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed exact head f3e9712738f99aa2af957f6193092733d227f092, including the full diff, CI, merge state, prior reviews, replies, and review threads. I found no specific, reproducible P0–P3 issues.

The problem definition is sound: the TUI previously had no single locale authority, allowing the welcome message, slash autocomplete, and /help to use inconsistent languages. This change gives the CLI ownership of locale resolution, applies the POSIX environment precedence consistently, and passes one resolved locale through both normal and first-run TUI startup.

The implementation is also the smallest complete solution. The CLI owns its catalog, the command registry remains authoritative for command tokens, and Desktop settings are not introduced as a parallel source. Protocol values, machine-readable output, logs, and exit semantics remain unchanged. I did not find useful code or tests to delete, or a reason to split the PR.

Approved.

Disclosure: Codex performed the read-only source, lifecycle, test, CI, and prior-feedback analysis for this review. The human contributor remains responsible for independently verifying the final diff and owns the approval decision.

中文

最新 head 未发现 P0–P3。CLI locale authority 的归属、生命周期和测试都合理,没有引入 Desktop 依赖或平行状态;这是最小完整方案,可以 Approve。

@Astro-Han
Astro-Han merged commit bfb1841 into apache:main Aug 18, 2026
12 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.

feat(cli): add a locale authority for primary TUI guidance

2 participants