Fix AgentInstance schema to match backend API (id not agentId)
All checks were successful
CI / build (push) Successful in 1m0s
CI / docker (push) Successful in 45s
CI / deploy (push) Successful in 26s

Backend AgentInfo record uses 'id' but UI schema had 'agentId',
causing undefined property access crash in command palette.
Regenerated openapi.json and aligned all UI types with live spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-13 17:50:08 +01:00
parent 4253751ef1
commit d78b283567
5 changed files with 78 additions and 6 deletions

View File

@@ -91,6 +91,30 @@
"type": "string"
}
},
{
"name": "routeId",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "agentId",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "processorType",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "offset",
"in": "query",
@@ -633,6 +657,27 @@
}
}
},
"/api/v1/search/stats": {
"get": {
"tags": [
"Search"
],
"summary": "Aggregate execution stats (P99 latency, active count)",
"operationId": "stats",
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/ExecutionStats"
}
}
}
}
}
}
},
"/api/v1/executions/{executionId}": {
"get": {
"tags": [
@@ -882,6 +927,15 @@
"textInErrors": {
"type": "string"
},
"routeId": {
"type": "string"
},
"agentId": {
"type": "string"
},
"processorType": {
"type": "string"
},
"offset": {
"type": "integer",
"format": "int32"
@@ -972,6 +1026,19 @@
}
}
},
"ExecutionStats": {
"type": "object",
"properties": {
"p99LatencyMs": {
"type": "integer",
"format": "int64"
},
"activeCount": {
"type": "integer",
"format": "int64"
}
}
},
"ExecutionDetail": {
"type": "object",
"properties": {

View File

@@ -198,9 +198,14 @@ export interface ExecutionStats {
}
export interface AgentInstance {
agentId: string;
id: string;
name: string;
group: string;
version: string;
routeIds: string[];
capabilities: Record<string, boolean>;
state: 'LIVE' | 'STALE' | 'DEAD';
lastHeartbeat: string;
registeredAt: string;
lastHeartbeat: string;
staleTransitionTime: string | null;
}

View File

@@ -30,7 +30,7 @@ export function CommandPalette() {
} else if (result.type === 'agent') {
const agent = result.data as AgentInstance;
execSearch.setStatus(['COMPLETED', 'FAILED', 'RUNNING']);
execSearch.setAgentId(agent.agentId);
execSearch.setAgentId(agent.id);
execSearch.setText('');
execSearch.setRouteId('');
execSearch.setProcessorType('');

View File

@@ -91,7 +91,7 @@ function AgentResult({ data, query }: { data: AgentInstance; query: string }) {
</div>
<div className={styles.resultBody}>
<div className={styles.resultTitle}>
<HighlightedText text={data.agentId} query={query} />
<HighlightedText text={data.id} query={query} />
<span className={stateBadgeClass(data.state)}>{data.state}</span>
</div>
<div className={styles.resultMeta}>

View File

@@ -70,12 +70,12 @@ export function usePaletteSearch() {
const filteredAgents = (agentsQuery.data ?? []).filter((a) => {
if (!debouncedQuery) return true;
const q = debouncedQuery.toLowerCase();
return a.agentId.toLowerCase().includes(q) || a.group.toLowerCase().includes(q);
return a.id.toLowerCase().includes(q) || a.group.toLowerCase().includes(q);
});
const agentResults: PaletteResult[] = filteredAgents.slice(0, 10).map((a) => ({
type: 'agent' as const,
id: a.agentId,
id: a.id,
data: a,
}));