fix: use OPENCLAW_SERVICE_VERSION for real version and increase agent list timeout

api.version returns plugin API version (0.2.0), not the openclaw release
version. Use OPENCLAW_SERVICE_VERSION env var set by the gateway instead.
Also increase listOpenClawAgents timeout from 15s to 30s since plugin
loading takes ~16s on T2.
This commit is contained in:
operator
2026-04-16 15:12:35 +00:00
parent 58a800a1aa
commit 2088cd12b4
2 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ export interface OpenClawAgentInfo {
export async function listOpenClawAgents(logger?: { debug?: (...args: any[]) => void; warn?: (...args: any[]) => void }): Promise<OpenClawAgentInfo[]> { export async function listOpenClawAgents(logger?: { debug?: (...args: any[]) => void; warn?: (...args: any[]) => void }): Promise<OpenClawAgentInfo[]> {
try { try {
const { stdout } = await execFileAsync('openclaw', ['agents', 'list'], { const { stdout } = await execFileAsync('openclaw', ['agents', 'list'], {
timeout: 15000, timeout: 30000,
maxBuffer: 1024 * 1024, maxBuffer: 1024 * 1024,
}); });
return parseOpenClawAgents(stdout); return parseOpenClawAgents(stdout);

View File

@@ -96,7 +96,7 @@ export default {
avg15: load[2], avg15: load[2],
}, },
openclaw: { openclaw: {
version: api.version || 'unknown', version: process.env.OPENCLAW_SERVICE_VERSION || api.version || 'unknown',
pluginVersion: '0.3.1', // Bumped for PLG-CAL-004 pluginVersion: '0.3.1', // Bumped for PLG-CAL-004
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
@@ -119,7 +119,7 @@ export default {
if (!bridgeClient) return; if (!bridgeClient) return;
const meta: OpenClawMeta = { const meta: OpenClawMeta = {
version: api.version || 'unknown', version: process.env.OPENCLAW_SERVICE_VERSION || api.version || 'unknown',
plugin_version: '0.3.1', plugin_version: '0.3.1',
agents: await listOpenClawAgents(logger), agents: await listOpenClawAgents(logger),
}; };