mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-13 08:15:14 +02:00
fix: tighten codex runtime config ownership
This commit is contained in:
parent
074c9c3d97
commit
f07f3f320b
4 changed files with 11 additions and 19 deletions
|
|
@ -79,6 +79,10 @@ async function mcpForTools(input: {
|
|||
});
|
||||
}
|
||||
|
||||
function runtimeToolNames(toolSet: KtxRuntimeToolSet | undefined): string[] {
|
||||
return Object.values(toolSet ?? {}).map((descriptor) => descriptor.name);
|
||||
}
|
||||
|
||||
export class CodexKtxLlmRuntime implements KtxLlmRuntimePort {
|
||||
private readonly runner: CodexSdkRunner;
|
||||
private readonly logger: KtxLogger;
|
||||
|
|
@ -105,7 +109,7 @@ export class CodexKtxLlmRuntime implements KtxLlmRuntimePort {
|
|||
url: mcp.url,
|
||||
bearerTokenEnvVar: mcp.bearerTokenEnvVar,
|
||||
bearerToken: mcp.bearerToken,
|
||||
toolNames: Object.keys(input.tools ?? {}),
|
||||
toolNames: runtimeToolNames(input.tools),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
|
|
@ -146,7 +150,7 @@ export class CodexKtxLlmRuntime implements KtxLlmRuntimePort {
|
|||
url: mcp.url,
|
||||
bearerTokenEnvVar: mcp.bearerTokenEnvVar,
|
||||
bearerToken: mcp.bearerToken,
|
||||
toolNames: Object.keys(input.tools ?? {}),
|
||||
toolNames: runtimeToolNames(input.tools),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
|
|
@ -187,7 +191,7 @@ export class CodexKtxLlmRuntime implements KtxLlmRuntimePort {
|
|||
url: mcp.url,
|
||||
bearerTokenEnvVar: mcp.bearerTokenEnvVar,
|
||||
bearerToken: mcp.bearerToken,
|
||||
toolNames: Object.keys(params.toolSet),
|
||||
toolNames: runtimeToolNames(params.toolSet),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue