style: oxfmt fixes (import order, markdown wrap)
Made-with: Cursor
This commit is contained in:
parent
01c25d7280
commit
0f8069a677
@ -641,7 +641,13 @@ Set these environment variables:
|
||||
| `NACOS_GROUP` | No | Nacos group (default: `DEFAULT_GROUP`). |
|
||||
| `NACOS_NAMESPACE` | No | Nacos namespace (tenant); omit for default namespace. |
|
||||
|
||||
When `OPENCLAW_CONFIG_SOURCE=nacos`, the gateway fetches the config from Nacos at startup. No config file is written on disk; the in-memory config is updated by Nacos long-polling. Hot reload is driven by Nacos (changes in Nacos are applied without restart). Config read RPC (`config.get`) uses the in-memory config. Config write RPC (`config.apply`, `config.patch`) and CLI `config set` update only the in-memory snapshot (no write to disk or to Nacos). To change config persistently when using Nacos, update the config in Nacos and rely on hot reload.
|
||||
When `OPENCLAW_CONFIG_SOURCE=nacos`, the gateway fetches the config from Nacos at
|
||||
startup. No config file is written on disk; the in-memory config is updated by
|
||||
Nacos long-polling. Hot reload is driven by Nacos (changes in Nacos are applied
|
||||
without restart). Config read RPC (`config.get`) uses the in-memory config. Config
|
||||
write RPC (`config.apply`, `config.patch`) and CLI `config set` update only the
|
||||
in-memory snapshot (no write to disk or to Nacos). To change config persistently
|
||||
when using Nacos, update the config in Nacos and rely on hot reload.
|
||||
|
||||
See [Environment](/help/environment#config-source-nacos) for these variables in the env reference.
|
||||
|
||||
|
||||
@ -121,7 +121,8 @@ When loading config from Nacos instead of a local file (e.g. in Kubernetes pods
|
||||
| `NACOS_GROUP` | No | Nacos group (default: `DEFAULT_GROUP`). |
|
||||
| `NACOS_NAMESPACE` | No | Nacos namespace (tenant); omit for default namespace. |
|
||||
|
||||
Config is kept only in memory; hot reload is driven by Nacos long-polling. See [Configuration: Config source: Nacos](/gateway/configuration#config-source-nacos).
|
||||
Config is kept only in memory; hot reload is driven by Nacos long-polling. See
|
||||
[Configuration: Config source: Nacos](/gateway/configuration#config-source-nacos).
|
||||
|
||||
## Logging
|
||||
|
||||
|
||||
@ -18,15 +18,15 @@ import { VERSION } from "../version.js";
|
||||
import { DuplicateAgentDirError, findDuplicateAgentDirs } from "./agent-dirs.js";
|
||||
import { maintainConfigBackups } from "./backup-rotation.js";
|
||||
import {
|
||||
applyAgentDefaults,
|
||||
applyCompactionDefaults,
|
||||
applyContextPruningDefaults,
|
||||
applyAgentDefaults,
|
||||
applyLoggingDefaults,
|
||||
applyMessageDefaults,
|
||||
applyModelDefaults,
|
||||
applySessionDefaults,
|
||||
applyTalkConfigNormalization,
|
||||
applyTalkApiKey,
|
||||
applyTalkConfigNormalization,
|
||||
} from "./defaults.js";
|
||||
import { restoreEnvVarRefs } from "./env-preserve.js";
|
||||
import {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
||||
import { createFileConfigSource } from "./file.js";
|
||||
import * as path from "node:path";
|
||||
import { mkdtemp, writeFile, rm } from "node:fs/promises";
|
||||
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import * as path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import { createFileConfigSource } from "./file.js";
|
||||
|
||||
describe("createFileConfigSource", () => {
|
||||
let tmpDir: string;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { ConfigSource } from "./types.js";
|
||||
import { createConfigIO } from "../io.js";
|
||||
import type { ConfigSource } from "./types.js";
|
||||
|
||||
export function createFileConfigSource(opts: {
|
||||
configPath: string;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createNacosConfigSource } from "./nacos.js";
|
||||
import type { NacosConfigClient } from "./nacos-client.js";
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
* Nacos config source adapter: ConfigSource backed by Nacos config API.
|
||||
*/
|
||||
|
||||
import type { ConfigSource } from "./types.js";
|
||||
import type { NacosConfigClient } from "./nacos-client.js";
|
||||
import { createNacosConfigClient } from "./nacos-client.js";
|
||||
import { buildSnapshotFromRaw } from "./snapshot-from-raw.js";
|
||||
import type { ConfigSource } from "./types.js";
|
||||
|
||||
export type CreateNacosConfigSourceOptions = {
|
||||
serverAddr: string;
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
import crypto from "node:crypto";
|
||||
import JSON5 from "json5";
|
||||
import {
|
||||
applyTalkApiKey,
|
||||
applyTalkConfigNormalization,
|
||||
applyModelDefaults,
|
||||
applyAgentDefaults,
|
||||
applyCompactionDefaults,
|
||||
applyContextPruningDefaults,
|
||||
applyAgentDefaults,
|
||||
applySessionDefaults,
|
||||
applyLoggingDefaults,
|
||||
applyMessageDefaults,
|
||||
applyModelDefaults,
|
||||
applySessionDefaults,
|
||||
applyTalkApiKey,
|
||||
applyTalkConfigNormalization,
|
||||
} from "../defaults.js";
|
||||
import { applyConfigEnvVars } from "../env-vars.js";
|
||||
import type { EnvSubstitutionWarning } from "../env-substitution.js";
|
||||
import { resolveConfigEnvVars } from "../env-substitution.js";
|
||||
import { parseConfigJson5 } from "../io.js";
|
||||
import { findLegacyConfigIssues } from "../legacy.js";
|
||||
import { normalizeConfigPaths } from "../normalize-paths.js";
|
||||
import { normalizeExecSafeBinProfilesInConfig } from "../normalize-exec-safe-bin.js";
|
||||
import type { ConfigFileSnapshot, LegacyConfigIssue, OpenClawConfig } from "../types.js";
|
||||
import { validateConfigObjectWithPlugins } from "../validation.js";
|
||||
import { parseConfigJson5 } from "../io.js";
|
||||
|
||||
function hashConfigRaw(raw: string | null): string {
|
||||
return crypto.createHash("sha256").update(raw ?? "").digest("hex");
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
// src/config/sources/types.test.ts
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { ConfigSource, ConfigSourceKind } from "./types.js";
|
||||
|
||||
describe("ConfigSource types", () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user