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
1 change: 0 additions & 1 deletion src/tools/structured_output_schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const statsSchema = {
properties: {
totalUsers: { type: 'number', description: 'Total users' },
monthlyUsers: { type: 'number', description: 'Monthly active users' },
successRate: { type: 'number', description: 'Success rate percentage' },
bookmarks: { type: 'number', description: 'Number of bookmarks' },
},
};
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ export type StructuredActorCard = {
stats?: {
totalUsers: number;
monthlyUsers: number;
successRate?: number;
bookmarks?: number;
};
rating?: {
Expand Down
15 changes: 0 additions & 15 deletions src/utils/actor_card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ type ExtractedActorData = {
stats?: {
totalUsers: number;
monthlyUsers: number;
successRate?: number;
bookmarks?: number;
};
rating?: {
Expand Down Expand Up @@ -145,17 +144,6 @@ function extractActorData(actor: Actor | ActorStoreList, options: ActorCardOptio
};
}

if ('publicActorRunStats30Days' in stats && stats.publicActorRunStats30Days) {
const runStats = stats.publicActorRunStats30Days as {
SUCCEEDED: number;
TOTAL: number;
};
if (runStats.TOTAL > 0) {
data.stats ??= { totalUsers: 0, monthlyUsers: 0 };
data.stats.successRate = Number(((runStats.SUCCEEDED / runStats.TOTAL) * 100).toFixed(1));
}
}

const bookmarkCount =
('bookmarkCount' in actor && actor.bookmarkCount) || ('bookmarkCount' in stats && stats.bookmarkCount);
if (bookmarkCount) {
Expand Down Expand Up @@ -230,9 +218,6 @@ export function formatActorToActorCard(
const statsParts = [
`${data.stats.totalUsers.toLocaleString()} total users, ${data.stats.monthlyUsers.toLocaleString()} monthly users`,
];
if (data.stats.successRate !== undefined) {
statsParts.push(`Runs succeeded: ${data.stats.successRate}%`);
}
if (data.stats.bookmarks) {
statsParts.push(`${data.stats.bookmarks} bookmarks`);
}
Expand Down
1 change: 0 additions & 1 deletion src/web/src/utils/mock-actor-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export const MOCK_ACTOR_DETAILS_RESPONSE = {
stats: {
totalUsers: 734,
monthlyUsers: 113,
successRate: 100,
bookmarks: 5,
},
modifiedAt: '2026-01-23T08:11:16.995Z',
Expand Down
14 changes: 0 additions & 14 deletions tests/unit/utils.actor_card.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,6 @@ describe('formatActorToActorCard', () => {
expect(result).not.toContain('- **Pricing');
});

it('should include success rate in stats', () => {
const result = formatActorToActorCard(mockActor, {
includeDescription: false,
includeStats: true,
includePricing: false,
includeRating: false,
includeMetadata: false,
});

// Success rate: 68663/69395 = 98.9%
expect(result).toContain('Runs succeeded: 98.9%');
});

it('should include bookmark count from Actor.stats', () => {
const result = formatActorToActorCard(mockActor, {
includeDescription: false,
Expand Down Expand Up @@ -453,7 +440,6 @@ describe('formatActorToStructuredCard', () => {
expect(result.stats).toBeDefined();
expect(result.stats?.totalUsers).toBe(8594);
expect(result.stats?.monthlyUsers).toBe(904);
expect(result.stats?.successRate).toBe(98.9);
});

it('should include bookmarks from Actor.stats', () => {
Expand Down
Loading