{"record":{"id":"f929fff5818f5b8b","repo":"iflytek/astron-agent","slug":"run-link-url-is-not-set","errorCode":null,"errorMessage":"RUN_LINK_URL is not set","messagePattern":"RUN_LINK_URL is not set","errorType":"exception","errorClass":"RunToolExc","httpStatus":null,"severity":"error","filePath":"core/agent/service/plugin/link.py","lineNumber":151,"sourceCode":"            if query:\n                run_link_payload[\"payload\"][\"message\"][\"query\"] = query\n                callback_payload[\"query\"] = _query\n            if body:\n                run_link_payload[\"payload\"][\"message\"][\"body\"] = body\n                callback_payload[\"body\"] = _body\n            sp.add_info_events(\n                attributes={\n                    \"link-plugin-run-inputs\": json.dumps(\n                        run_link_payload, ensure_ascii=False\n                    )\n                }\n            )\n            # Finished parsing parameters, start calling link\n            result: dict[str, Any] = {}\n            try:\n                run_url = os.getenv(\"RUN_LINK_URL\")\n                if not run_url:\n                    raise RunToolExc(\"RUN_LINK_URL is not set\")\n                timeout = aiohttp.ClientTimeout(\n                    total=int(os.getenv(\"LINK_CALL_TIMEOUT\", \"90\"))\n                )\n                async with aiohttp.ClientSession() as session:\n                    async with session.post(\n                        run_url,\n                        data=json.dumps(run_link_payload),\n                        timeout=timeout,\n                        headers={\"Content-Type\": \"application/json\"},\n                    ) as response:\n                        response.raise_for_status()\n                        if response.status == 200:\n                            result = await response.json()\n                            sp.add_info_events(\n                                attributes={\n                                    \"link-plugin-run-outputs\": json.dumps(\n                                        result, ensure_ascii=False\n                                    )","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/agent/service/plugin/link.py#L133-L169","documentation":"LinkPlugin.run() reads RUN_LINK_URL for the RPA/link execution endpoint. If unset it raises RunToolExc before any HTTP call, failing fast when the link plugin cannot know where to send execution requests.","triggerScenarios":"Executing a link/RPA tool via LinkPlugin.run() when the RUN_LINK_URL env var is missing in the Agent service environment (link.py:151-152).","commonSituations":"Agent deployed without the link service URL env var; environment template drift between dev and prod; the link service intentionally disabled but the tool still invoked by an agent; missing .env in local runs.","solutions":["Set RUN_LINK_URL (e.g. http://link-service:port/run) in the Agent environment and restart","Add RUN_LINK_URL to compose/helm deployment values so it is never absent","Disable/unregister the link tool in environments where the link service is not deployed","Validate required plugin env vars at service startup"],"exampleFix":"// before\ndocker compose up agent   # RUN_LINK_URL undefined\n// after\n# docker-compose.yml\nenvironment:\n  - RUN_LINK_URL=http://link:9000/run","handlingStrategy":"validation","validationCode":"import os\nif not os.getenv(\"RUN_LINK_URL\"):\n    raise RuntimeError(\"RUN_LINK_URL must be set before executing link tools\")","typeGuard":"def link_plugin_ready() -> bool:\n    url = os.getenv(\"RUN_LINK_URL\")\n    return bool(url and url.startswith((\"http://\", \"https://\")))","tryCatchPattern":"try:\n    result = await plugin.run(span)\nexcept RunToolExc as e:\n    if \"RUN_LINK_URL\" in str(e):\n        logger.error(\"link service not configured; set RUN_LINK_URL\")\n    raise","preventionTips":["Set RUN_LINK_URL in every deployment environment's env template","Skip tool registration when the link service is not deployed","Add a startup env-var completeness check for all plugin endpoints"],"tags":["config","env","plugin"],"backgroundTag":"missing-env-var","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}