docs(i18n): translate secrets.md to Chinese (zh-CN)#42064
docs(i18n): translate secrets.md to Chinese (zh-CN)#42064missshang-hero wants to merge 6 commits intoopenclaw:mainfrom
Conversation
- Complete translation of gateway/secrets.md to Simplified Chinese - Follow existing zh-CN documentation style - Related to issue openclaw#3460 Internationalization (i18n) & Localization Support
There was a problem hiding this comment.
💡 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".
docs/zh-CN/gateway/secrets.md
Outdated
| 表面状态: | ||
|
|
||
| - `active`:SecretRef 是有效认证表面的一部分,必须解析。 | ||
| - `active`:SecretRef 在该运行时被忽略,因为另一个认证表面获胜,或 |
There was a problem hiding this comment.
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 SummaryThis PR adds a complete Chinese (Simplified) translation of The translation is overall accurate and well-structured, with all code examples, CLI commands, JSON5 snippets, and technical identifiers (e.g.
Confidence Score: 3/5
Last reviewed commit: d4dea3f |
docs/zh-CN/gateway/secrets.md
Outdated
| - `active`:SecretRef 在该运行时被忽略,因为另一个认证表面获胜,或 | ||
| 因为远程认证被禁用/未激活。 |
There was a problem hiding this 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.
| - `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.There was a problem hiding this comment.
Thanks for the review! I've fixed the translation error on line 59 - changed the second 'active' to 'inactive' as suggested.
There was a problem hiding this comment.
💡 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$/); |
There was a problem hiding this comment.
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"]); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
💡 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".
| import { | ||
| trimToOptionalString, | ||
| redactWebhookUrl, | ||
| resolveCronWebhookTarget, | ||
| buildCronWebhookHeaders, |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
💡 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".
| defaults: { | ||
| "my-password": "resolved-password", | ||
| }, |
There was a problem hiding this comment.
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 👍 / 👎.
| content: "Hello [envelope:123] world", | ||
| }; | ||
| const result = stripEnvelopeFromMessage(message) as { content: string }; | ||
| expect(result.content).toBe("Hello world"); |
There was a problem hiding this comment.
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 👍 / 👎.
| avatar: "default-avatar", | ||
| agentId: "agent-123", | ||
| })).toBe("/avatar/agent-123"); |
There was a problem hiding this comment.
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 👍 / 👎.
| const result = formatError(error); | ||
| expect(result).toBe("Custom error"); |
There was a problem hiding this comment.
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"; | |||
There was a problem hiding this comment.
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 👍 / 👎.
Summary
This PR adds a complete Chinese (Simplified) translation of the gateway/secrets.md documentation.
Changes
Related Issue
Closes #3460 (Internationalization (i18n) & Localization Support)
Checklist