Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/famous-moments-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@inkeep/agents-manage-ui": patch
"@inkeep/agents-cli": patch
"@inkeep/agents-manage-api": patch
"@inkeep/agents-run-api": patch
"@inkeep/agents-core": patch
"@inkeep/agents-sdk": patch
"@inkeep/ai-sdk-provider": patch
"@inkeep/create-agents": patch
---

fields for copy trace
2 changes: 1 addition & 1 deletion agents-manage-ui/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export default defineConfig({
setupNodeEvents(_on, _config) {
// implement node event listeners here
},
defaultCommandTimeout: 7_000,
defaultCommandTimeout: 10_000,
},
});
2 changes: 1 addition & 1 deletion agents-manage-ui/cypress/e2e/validation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Validation', () => {
cy.contains('Create agent').click();

// Wait for app to initialize and click to save
cy.contains('Save').click();
cy.contains('Save').should('not.be.disabled').click();

// Check for validation errors
cy.contains('Validation Errors (1)').should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,6 @@ export async function GET(
| 'ai_model_streamed_text'
| 'ai_model_streamed_object'
| 'artifact_processing';
name: string;
description: string;
timestamp: string;
status: 'success' | 'error' | 'pending';
Expand Down Expand Up @@ -1044,7 +1043,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.TOOL_CALL,
name,
toolName: name,
description: hasError && statusMessage ? `Tool ${name} failed` : `Called ${name}`,
timestamp: span.timestamp,
Expand Down Expand Up @@ -1083,7 +1081,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.CONTEXT_RESOLUTION,
name: ACTIVITY_NAMES.CONTEXT_FETCH,
description: `Context fetch ${hasError ? 'failed' : 'completed'}`,
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand Down Expand Up @@ -1113,7 +1110,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.CONTEXT_RESOLUTION,
name: ACTIVITY_NAMES.CONTEXT_FETCH,
description: `Context handle ${hasError ? 'failed' : 'completed'}`,
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand All @@ -1132,7 +1128,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.USER_MESSAGE,
name: ACTIVITY_NAMES.USER_MESSAGE,
description: 'User sent a message',
timestamp: getString(span, SPAN_KEYS.MESSAGE_TIMESTAMP),
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand All @@ -1152,7 +1147,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.AI_ASSISTANT_MESSAGE,
name: ACTIVITY_NAMES.AI_ASSISTANT_MESSAGE,
description: 'AI Assistant responded',
timestamp: getString(span, SPAN_KEYS.AI_RESPONSE_TIMESTAMP),
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand Down Expand Up @@ -1182,7 +1176,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.AI_GENERATION,
name: ACTIVITY_NAMES.AI_TEXT_GENERATION,
description: 'AI model generating text response',
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand Down Expand Up @@ -1211,7 +1204,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.AGENT_GENERATION,
name: 'agent.generate',
description: hasError ? 'Agent generation failed' : 'Agent generation',
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand All @@ -1233,7 +1225,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.AI_MODEL_STREAMED_TEXT,
name: ACTIVITY_NAMES.AI_STREAMING_TEXT,
description: 'AI model streaming text response',
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand All @@ -1258,7 +1249,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.AI_MODEL_STREAMED_OBJECT,
name: ACTIVITY_NAMES.AI_STREAMING_OBJECT,
description: 'AI model streaming object response',
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand All @@ -1282,7 +1272,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: ACTIVITY_TYPES.CONTEXT_FETCH,
name: ACTIVITY_NAMES.CONTEXT_FETCH,
description: '',
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand All @@ -1304,7 +1293,6 @@ export async function GET(
activities.push({
id: getString(span, SPAN_KEYS.SPAN_ID, ''),
type: 'artifact_processing',
name: 'Artifact Processing',
description: 'Artifact processed',
timestamp: span.timestamp,
status: hasError ? ACTIVITY_STATUS.ERROR : ACTIVITY_STATUS.SUCCESS,
Expand Down
41 changes: 37 additions & 4 deletions agents-manage-ui/src/lib/utils/trace-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,41 @@ export interface PrettifiedTrace {
endTime: string ;
durationMs: number;
};
timeline: Omit<ActivityItem, 'id' | 'timestamp'>[];
timeline: Omit<ActivityItem, 'id'>[];
}

/**
* Priority fields that should appear first, in this order
*/
const PRIORITY_FIELDS = ['subAgentId', 'subAgentName', 'type', 'description', 'status', 'timestamp'];

/**
* Orders object keys with priority fields first, then alphabetically
*/
function orderObjectKeys<T extends Record<string, any>>(obj: T): T {
const priorityKeys: string[] = [];
const remainingKeys: string[] = [];

// Separate keys into priority and remaining
for (const key of Object.keys(obj)) {
if (PRIORITY_FIELDS.includes(key)) {
priorityKeys.push(key);
} else {
remainingKeys.push(key);
}
}

priorityKeys.sort((a, b) => {
return PRIORITY_FIELDS.indexOf(a) - PRIORITY_FIELDS.indexOf(b);
});

remainingKeys.sort();
const result = {} as T;
for (const key of [...priorityKeys, ...remainingKeys]) {
result[key as keyof T] = obj[key as keyof T];
}

return result;
}

/**
Expand Down Expand Up @@ -47,9 +81,8 @@ export function formatConversationAsPrettifiedTrace(
timeline: (conversation.activities || []).map((activity) => {
// Destructure to exclude unwanted fields
const { id: _id, ...rest } = activity;
return {
...rest
};
// Order the fields according to hierarchy
return orderObjectKeys(rest);
}),
};

Expand Down