Skip to content

docs(i18n): translate secrets.md to Chinese (zh-CN)#42064

Open
missshang-hero wants to merge 6 commits intoopenclaw:mainfrom
missshang-hero:main
Open

docs(i18n): translate secrets.md to Chinese (zh-CN)#42064
missshang-hero wants to merge 6 commits intoopenclaw:mainfrom
missshang-hero:main

Conversation

@missshang-hero
Copy link
Copy Markdown

Summary

This PR adds a complete Chinese (Simplified) translation of the gateway/secrets.md documentation.

Changes

  • Translated docs/gateway/secrets.md to docs/zh-CN/gateway/secrets.md
  • Followed existing zh-CN documentation style and terminology
  • Maintained all code examples and technical references

Related Issue

Closes #3460 (Internationalization (i18n) & Localization Support)

Checklist

  • Translation is complete and accurate
  • Technical terms are properly translated
  • Code examples remain unchanged
  • Links are preserved

- Complete translation of gateway/secrets.md to Simplified Chinese
- Follow existing zh-CN documentation style
- Related to issue openclaw#3460 Internationalization (i18n) & Localization Support
@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation size: XS labels Mar 10, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4dea3f776

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

表面状态:

- `active`:SecretRef 是有效认证表面的一部分,必须解析。
- `active`:SecretRef 在该运行时被忽略,因为另一个认证表面获胜,或
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use inactive for ignored auth surface state

The second state bullet is mislabeled as active even though the description says the SecretRef is ignored when another auth surface wins or remote auth is disabled, which is the inactive state. In this zh-CN translation, both states now appear as active, so operators cannot distinguish required refs from ignored refs when reading startup/reload diagnostics and may misinterpret whether a reference must resolve.

Useful? React with 👍 / 👎.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 10, 2026

Greptile Summary

This PR adds a complete Chinese (Simplified) translation of docs/gateway/secrets.md to docs/zh-CN/gateway/secrets.md, following the existing zh-CN documentation structure and style.

The translation is overall accurate and well-structured, with all code examples, CLI commands, JSON5 snippets, and technical identifiers (e.g. SECRETS_REF_IGNORED_INACTIVE_SURFACE, SECRETS_GATEWAY_AUTH_SURFACE) left intact. One copy-paste error needs to be corrected:

  • In the "网关认证表面诊断" section (line 59), the second state bullet is labeled `active` when it should be `inactive`. The English source explicitly defines two mutually exclusive states (active and inactive), so this mistaken label inverts the meaning for Chinese readers.

Confidence Score: 3/5

  • Safe to merge after fixing the inactive label copy-paste error on line 59.
  • The translation is complete, accurate, and consistent with existing zh-CN documentation. One clear factual error needs correction: the second bullet in the Gateway Auth Surface Diagnostics section (line 59) is labeled active when it should be inactive per the English source. This is not a minor style issue—it inverts the meaning of a key definition and will mislead readers. The fix is straightforward (one-word correction).
  • docs/zh-CN/gateway/secrets.md — line 59, change second active label to inactive

Last reviewed commit: d4dea3f

Comment on lines +59 to +60
- `active`:SecretRef 在该运行时被忽略,因为另一个认证表面获胜,或
因为远程认证被禁用/未激活。
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.

The second bullet here is labeled `active` but the English source clearly uses `inactive`:

- `inactive`: the SecretRef is ignored for this runtime because another auth surface wins, or
  because remote auth is disabled/not active.

Since these two bullet points define mutually exclusive states (active vs. inactive), having both labeled `active` is factually incorrect and will confuse readers trying to understand when a credential is active vs. ignored.

Suggested change
- `active`:SecretRef 在该运行时被忽略,因为另一个认证表面获胜,或
因为远程认证被禁用/未激活。
- `inactive`:SecretRef 在该运行时被忽略,因为另一个认证表面获胜,或
因为远程认证被禁用/未激活。
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/zh-CN/gateway/secrets.md
Line: 59-60

Comment:
The second bullet here is labeled `` `active` `` but the English source clearly uses `` `inactive` ``:

```
- `inactive`: the SecretRef is ignored for this runtime because another auth surface wins, or
  because remote auth is disabled/not active.
```

Since these two bullet points define mutually exclusive states (`active` vs. `inactive`), having both labeled `` `active` `` is factually incorrect and will confuse readers trying to understand when a credential is active vs. ignored.

```suggestion
- `inactive`:SecretRef 在该运行时被忽略,因为另一个认证表面获胜,或
  因为远程认证被禁用/未激活。
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the review! I've fixed the translation error on line 59 - changed the second 'active' to 'inactive' as suggested.

@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime size: L and removed size: XS labels Mar 10, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb93c940e3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

user: "john",
prefix: "test",
});
expect(result).toMatch(/^test-agent:main:test-user:john$/);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Match session-key assertions to agent-prefixed format

resolveSessionKey builds keys via buildAgentMainSessionKey, which formats them as agent:<agentId>:<mainKey>, so the regex expecting test-agent:main:... can never match. This makes the new tests fail immediately in CI and blocks the PR despite no runtime regression in the implementation.

Useful? React with 👍 / 👎.

describe("normalizeVoiceWakeTriggers", () => {
it("should return default triggers when input is undefined", () => {
const result = normalizeVoiceWakeTriggers(undefined);
expect(result).toEqual(["hey claw", "okay claw"]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Assert voice wake defaults from current runtime values

normalizeVoiceWakeTriggers falls back to defaultVoiceWakeTriggers(), whose current defaults are openclaw/claude/computer, not hey claw/okay claw. The hard-coded expectation here causes deterministic test failures for undefined/empty/invalid input cases, so this commit introduces a broken test suite rather than validating behavior.

Useful? React with 👍 / 👎.

Add complete test coverage for http-utils, server-utils, server-discovery, and server-cron.
Total 60+ test cases covering normal flow, edge cases, and error handling.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae8a11d73b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +2 to +6
import {
trimToOptionalString,
redactWebhookUrl,
resolveCronWebhookTarget,
buildCronWebhookHeaders,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Stop importing non-exported cron helpers

server-cron.test.ts imports trimToOptionalString, redactWebhookUrl, resolveCronWebhookTarget, and buildCronWebhookHeaders, but src/gateway/server-cron.ts does not export these symbols. In ESM this causes a module-link error (does not provide an export named ...), so the test file cannot execute and CI fails before any assertions run.

Useful? React with 👍 / 👎.

expect(value).toBe("studio.tailnet.ts.net");
expect(getTailnetHostname).not.toHaveBeenCalled();
it("should call exec when env is not set", async () => {
const mockExec = vi.fn().mockResolvedValue("tailnet-hostname.ts.net");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Mock tailnet exec with the expected stdout shape

resolveTailnetDnsHint forwards exec into getTailnetHostname, which reads stdout from the exec result object. This mock resolves to a plain string, so stdout is undefined and the function falls into the error path, making the hostname expectation fail deterministically.

Useful? React with 👍 / 👎.

const result = resolveCronWebhookTarget({
delivery: { mode: "webhook", to: "HTTP://EXAMPLE.COM/WEBHOOK" },
});
expect(result?.url).toBe("http://example.com/WEBHOOK");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Match webhook URL assertion to actual normalization behavior

resolveCronWebhookTarget uses normalizeHttpWebhookUrl, and that helper currently returns the trimmed input string (it does not lowercase scheme/host). With input HTTP://EXAMPLE.COM/WEBHOOK, the result stays uppercase, so this assertion is guaranteed to fail.

Useful? React with 👍 / 👎.


it("should format undefined", () => {
const result = formatError(undefined);
expect(result).toBe("undefined");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fix undefined-format expectation in formatError test

formatError returns JSON.stringify(err, null, 2) for non-error/non-string values, and JSON.stringify(undefined) returns undefined (not the string "undefined"). This expectation cannot pass with the current implementation, so it introduces a deterministic test failure.

Useful? React with 👍 / 👎.

…d-scopes, channel-health-policy

Add 70+ test cases covering security path canonicalization, message sanitization,
method authorization scopes, and channel health evaluation.
…ared

Add test coverage for authentication config utilities and control UI helpers:

1. auth-config-utils.test.ts (108 lines)
   - withGatewayAuthPassword: 4 test cases
   - resolveGatewayPasswordSecretRef: 9 test cases

2. control-ui-shared.test.ts (133 lines)
   - normalizeControlUiBasePath: 9 test cases
   - buildControlUiAvatarUrl: 3 test cases
   - resolveAssistantAvatarUrl: 12 test cases
Add test coverage for authorizeGatewayBearerRequestOrReply:
- Successful authorization flow
- Failed authorization with proper error handling
- Rate limiting scenarios
- Token extraction and passing
- Optional parameters (trusted proxies, rate limiter, etc.)
Fix copy-paste error: change second 'active' to 'inactive' on line 59
as per Greptile review feedback.

The English source defines two mutually exclusive states (active/inactive),
so the mistaken label inverted the meaning for Chinese readers.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91026dd17e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +147 to +149
defaults: {
"my-password": "resolved-password",
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Configure SecretRef provider defaults correctly in test setup

This setup puts "my-password": "resolved-password" under secrets.defaults, but that field only defines provider aliases (env/file/exec), not secret values. As a result, ${SECRET:my-password} still resolves through the env provider and, with env: {}, resolveGatewayPasswordSecretRef rejects instead of returning "resolved-password", so the new resolution tests fail deterministically.

Useful? React with 👍 / 👎.

Comment on lines +24 to +27
content: "Hello [envelope:123] world",
};
const result = stripEnvelopeFromMessage(message) as { content: string };
expect(result.content).toBe("Hello world");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use supported envelope fixtures in sanitize assertions

stripEnvelopeFromMessage only strips recognized leading envelope headers via stripEnvelope (channel/timestamp forms), not inline tokens like [envelope:123] embedded in content. With this fixture the content remains unchanged, so expecting "Hello world" fails and the same pattern causes multiple added cases in this suite to fail.

Useful? React with 👍 / 👎.

Comment on lines +109 to +111
avatar: "default-avatar",
agentId: "agent-123",
})).toBe("/avatar/agent-123");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass an avatar-path value when expecting avatar URL rewrite

resolveAssistantAvatarUrl rewrites to /avatar/<agentId> only when looksLikeAvatarPath(avatar) is true (contains a path separator or image extension). "default-avatar" does not satisfy that predicate, so the function returns the original string and this assertion fails.

Useful? React with 👍 / 👎.

Comment on lines +133 to +134
const result = formatError(error);
expect(result).toBe("Custom error");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Assert formatError object fallback using JSON output

For non-Error, non-string inputs, formatError first returns JSON.stringify(err, null, 2) when serialization succeeds; it does not call custom toString() methods on plain objects. This object serializes to {}, so expecting "Custom error" is a deterministic mismatch.

Useful? React with 👍 / 👎.

@@ -1,8 +1,10 @@
import { describe, it, expect, vi } from "vitest";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Import beforeEach from vitest before invoking it

The suite calls beforeEach(...) but the symbol is no longer imported from vitest. In this repo’s Vitest setup, test APIs are imported rather than globally enabled, so this leaves beforeEach undefined at runtime and the file fails before assertions execute.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internationalization (i18n) & Localization Support

1 participant