fix(onboarding): log skill scan failures instead of silent swallow
This commit is contained in:
1 parent
1b11b53f84
commit
6ce4fd1fe4
1 file changed
+7
-1
@@ -37,6 +37,8 @@ interface OnboardingDependencies {
|
|||||||
publishDomainChanged: () => void;
|
publishDomainChanged: () => void;
|
||||||
/** Scan workspace directories for skills and import them. Best-effort — may be undefined during early init. */
|
/** Scan workspace directories for skills and import them. Best-effort — may be undefined during early init. */
|
||||||
scanAndAssignSkills?: (companyId: string, agentId: string) => Promise<void>;
|
scanAndAssignSkills?: (companyId: string, agentId: string) => Promise<void>;
|
||||||
|
/** Optional logger for non-fatal errors from best-effort operations (skill seeding, etc.). */
|
||||||
|
logger?: { warn: (...args: unknown[]) => void };
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFERRABLE_RUN_ERRORS = new Set([
|
const DEFERRABLE_RUN_ERRORS = new Set([
|
||||||
@@ -75,6 +77,7 @@ export function createOnboardingService({
|
|||||||
queueTaskRun,
|
queueTaskRun,
|
||||||
publishDomainChanged,
|
publishDomainChanged,
|
||||||
scanAndAssignSkills,
|
scanAndAssignSkills,
|
||||||
|
logger,
|
||||||
}: OnboardingDependencies) {
|
}: OnboardingDependencies) {
|
||||||
function updateAgentWorkspaceBinding(agentId: string, workspaceId: string | null) {
|
function updateAgentWorkspaceBinding(agentId: string, workspaceId: string | null) {
|
||||||
if (!workspaceId) return;
|
if (!workspaceId) return;
|
||||||
@@ -260,7 +263,10 @@ export function createOnboardingService({
|
|||||||
seedDefaultAutomationRules(companyId);
|
seedDefaultAutomationRules(companyId);
|
||||||
|
|
||||||
if (scanAndAssignSkills) {
|
if (scanAndAssignSkills) {
|
||||||
void scanAndAssignSkills(companyId, ceoId).catch(() => {});
|
void scanAndAssignSkills(companyId, ceoId).catch((error) => {
|
||||||
|
const message = error instanceof Error ? error.message : String(error);
|
||||||
|
logger?.warn(`[onboarding] skill scan failed for agent ${ceoId}: ${message}`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const kickoff = createInitialExecutionLoop(companyId, workspaceId);
|
const kickoff = createInitialExecutionLoop(companyId, workspaceId);
|
||||||
|
|||||||
Reference in new issue
Block a user