fix: clarify daemon status probe target
This commit is contained in:
@@ -25,6 +25,11 @@ export type CallGatewayOptions = {
|
||||
instanceId?: string;
|
||||
minProtocol?: number;
|
||||
maxProtocol?: number;
|
||||
/**
|
||||
* Overrides the config path shown in connection error details.
|
||||
* Does not affect config loading; callers still control auth via opts.token/password/env/config.
|
||||
*/
|
||||
configPath?: string;
|
||||
};
|
||||
|
||||
export type GatewayConnectionDetails = {
|
||||
@@ -36,13 +41,12 @@ export type GatewayConnectionDetails = {
|
||||
};
|
||||
|
||||
export function buildGatewayConnectionDetails(
|
||||
options: { config?: ClawdbotConfig; url?: string } = {},
|
||||
options: { config?: ClawdbotConfig; url?: string; configPath?: string } = {},
|
||||
): GatewayConnectionDetails {
|
||||
const config = options.config ?? loadConfig();
|
||||
const configPath = resolveConfigPath(
|
||||
process.env,
|
||||
resolveStateDir(process.env),
|
||||
);
|
||||
const configPath =
|
||||
options.configPath ??
|
||||
resolveConfigPath(process.env, resolveStateDir(process.env));
|
||||
const isRemoteMode = config.gateway?.mode === "remote";
|
||||
const remote = isRemoteMode ? config.gateway?.remote : undefined;
|
||||
const localPort = resolveGatewayPort(config);
|
||||
@@ -107,6 +111,7 @@ export async function callGateway<T = unknown>(
|
||||
const connectionDetails = buildGatewayConnectionDetails({
|
||||
config,
|
||||
url: opts.url,
|
||||
...(opts.configPath ? { configPath: opts.configPath } : {}),
|
||||
});
|
||||
const url = connectionDetails.url;
|
||||
const token =
|
||||
|
||||
Reference in New Issue
Block a user