diff --git a/.changeset/fix-agent-directory-visibility.md b/.changeset/fix-agent-directory-visibility.md new file mode 100644 index 0000000000..5c7b29047e --- /dev/null +++ b/.changeset/fix-agent-directory-visibility.md @@ -0,0 +1,4 @@ +--- +--- + +Fix agent directory visibility - registered agents now appear immediately without approval diff --git a/server/src/db/migrations/017_approve_all_agents.sql b/server/src/db/migrations/017_approve_all_agents.sql new file mode 100644 index 0000000000..76f9e56f9f --- /dev/null +++ b/server/src/db/migrations/017_approve_all_agents.sql @@ -0,0 +1,9 @@ +-- Approve all pending agents +-- Now that approval is no longer required, approve any existing pending agents + +UPDATE registry_entries +SET approval_status = 'approved', + approved_at = NOW(), + updated_at = NOW() +WHERE entry_type = 'agent' + AND approval_status = 'pending'; diff --git a/server/src/http.ts b/server/src/http.ts index 685a575155..bdfcb077b4 100644 --- a/server/src/http.ts +++ b/server/src/http.ts @@ -5959,7 +5959,7 @@ export class HTTPServer { contact_name, contact_email, contact_website, - approval_status: 'pending', // New agents need approval + approval_status: 'approved', workos_organization_id: targetOrgId, }); @@ -5971,7 +5971,7 @@ export class HTTPServer { res.status(201).json({ agent: entry, - message: 'Agent created successfully. It will be visible in the registry once approved.', + message: 'Agent created successfully.', }); } catch (error) { logger.error({ err: error }, 'Create agent error'); @@ -6070,11 +6070,6 @@ export class HTTPServer { allowedUpdates.metadata = metadata; } - // Updates reset approval status to pending (agent needs re-review) - if (Object.keys(allowedUpdates).length > 0) { - allowedUpdates.approval_status = 'pending'; - } - const updatedAgent = await registryDb.updateEntry(existingAgent.slug, allowedUpdates); logger.info({ @@ -6084,7 +6079,7 @@ export class HTTPServer { res.json({ agent: updatedAgent, - message: 'Agent updated successfully. Changes will be visible once approved.', + message: 'Agent updated successfully.', }); } catch (error) { logger.error({ err: error }, 'Update agent error');