MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / readConfigFileForUpdate

Function readConfigFileForUpdate

packages/agent-core/src/config/toml.ts:79–92  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

77 * UIs surface it directly — instead of the raw validation details.
78 */
79export function readConfigFileForUpdate(filePath: string): KimiConfig {
80 try {
81 return readConfigFile(filePath);
82 } catch (error) {
83 if (error instanceof KimiError && error.code === ErrorCodes.CONFIG_INVALID) {
84 throw new KimiError(
85 ErrorCodes.CONFIG_INVALID,
86 `Cannot change settings while ${filePath} is invalid — fix it first (run \`kimi doctor\` for details).`,
87 { cause: error },
88 );
89 }
90 throw error;
91 }
92}
93
94/**
95 * Load the config for runtime consumption: the on-disk config plus any model

Callers 3

constructorMethod · 0.90
configs.test.tsFile · 0.90
readConfigForWriteMethod · 0.90

Calls 1

readConfigFileFunction · 0.85

Tested by

no test coverage detected