{"record":{"id":"494f04ca5435a7a0","repo":"iflytek/astron-agent","slug":"generate-workflow-skill-metadata-failed-workflowid","errorCode":null,"errorMessage":"Generate workflow skill metadata failed, workflowId={}","messagePattern":"Generate workflow skill metadata failed, workflowId=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowSkillExportServiceImpl.java","lineNumber":127,"sourceCode":"        } catch (Exception e) {\n            log.warn(\"Parse workflow inputs failed, workflowId={}\", workflow.getId(), e);\n        }\n        return List.of();\n    }\n\n    private SkillMetadata generateSkillMetadata(String workflowName, String workflowDescription, Long workflowId) {\n        SkillMetadata fallback = new SkillMetadata(\n                toSkillName(workflowName, workflowId),\n                toFallbackDescription(workflowName, workflowDescription),\n                false);\n\n        try {\n            String prompt = buildMetadataPrompt(workflowName, workflowDescription);\n            String content = CompletableFuture\n                    .supplyAsync(() -> openAiModelProcessService.processNonStreaming(prompt))\n                    .orTimeout(METADATA_GENERATION_TIMEOUT_SECONDS, TimeUnit.SECONDS)\n                    .exceptionally(ex -> {\n                        log.warn(\"Generate workflow skill metadata failed, workflowId={}\", workflowId, ex);\n                        return null;\n                    })\n                    .join();\n            SkillMetadata generated = parseGeneratedMetadata(content);\n            if (generated != null) {\n                return generated;\n            }\n        } catch (Exception e) {\n            log.warn(\"Generate workflow skill metadata failed, workflowId={}\", workflowId, e);\n        }\n        return fallback;\n    }\n\n    private String buildMetadataPrompt(String workflowName, String workflowDescription) {\n        return String.join(\n                System.lineSeparator(),\n                \"You create Agent Skill metadata for a published workflow API.\",\n                \"Return JSON only, without Markdown fences or explanations.\",","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowSkillExportServiceImpl.java#L109-L145","documentation":"generateSkillMetadata asks an LLM (via openAiModelProcessService) to produce skill metadata (name/description) for the exported workflow. The async call has a timeout (METADATA_GENERATION_TIMEOUT_SECONDS) and an exceptionally() handler: on timeout, error, or empty LLM output it logs this warning and yields null so the caller falls back to generated fallback metadata.","triggerScenarios":"metadata() -> generateSkillMetadata when processNonStreaming(prompt) throws, exceeds METADATA_GENERATION_TIMEOUT_SECONDS, or the exceptionally handler fires (model 4xx/5xx, missing API key, network failure, rate limit).","commonSituations":"LLM service overloaded or rate-limited during bulk exports; METADATA_GENERATION_TIMEOUT_SECONDS set too low for large prompts; model credentials not configured in the environment; prompt length exceeding model context.","solutions":["Check the logged exception for the root cause (timeout vs HTTP error) and fix model connectivity/credentials","Increase METADATA_GENERATION_TIMEOUT_SECONDS if timeouts occur on large workflow descriptions","Retry the export when the model service recovers to get real generated metadata","Rely on the fallback metadata if acceptable, or preconfigure better name/description on the workflow so fallback quality is fine"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// pre-flight check that the LLM service is configured/reachable\nif (!openAiModelProcessService.isAvailable()) {\n    log.info(\"LLM unavailable; skill export will use fallback metadata\");\n}","typeGuard":null,"tryCatchPattern":"String content;\ntry {\n    content = CompletableFuture\n        .supplyAsync(() -> openAiModelProcessService.processNonStreaming(prompt))\n        .orTimeout(METADATA_GENERATION_TIMEOUT_SECONDS, TimeUnit.SECONDS)\n        .join();\n} catch (CompletionException | InterruptedException e) {\n    log.warn(\"Generate workflow skill metadata failed, workflowId={}\", workflowId, e);\n    content = null;\n}","preventionTips":["Configure and health-check model credentials before export operations","Tune METADATA_GENERATION_TIMEOUT_SECONDS to p99 model latency plus margin","Retry transient LLM failures with backoff before falling back","Cache generated metadata per workflowId to avoid repeat generations"],"tags":["java","llm","timeout","fallback"],"backgroundTag":"upstream-api-error","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}