{"record":{"id":"f097b9eeabfe28b7","repo":"iflytek/astron-agent","slug":"toolbox-not-exist","errorCode":"TOOLBOX_NOT_EXIST","errorMessage":"BusinessException(ResponseEnum.TOOLBOX_NOT_EXIST)","messagePattern":"BusinessException\\(ResponseEnum\\.TOOLBOX_NOT_EXIST\\)","errorType":"error_code","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/tool/ToolBoxService.java","lineNumber":463,"sourceCode":"        if (modelListCount > 0) {\n            throw new BusinessException(ResponseEnum.TOOLBOX_CANNOT_DELETE_RELATED);\n        }\n\n        toolBoxMapper.update(null, new UpdateWrapper<ToolBox>().lambda()\n                .set(ToolBox::getDeleted, true)\n                .set(ToolBox::getUpdateTime, new Timestamp(System.currentTimeMillis()))\n                .eq(ToolBox::getToolId, toolBox.getToolId()));\n\n        String paramStr = \"?app_id=\" + commonConfig.getAppId() + \"&tool_ids=\" + toolBox.getToolId();\n        ToolResp toolDelResp = toolServiceCallHandler.toolDelete(paramStr);\n        toolServiceCallHandler.dealResult(toolDelResp);\n        return ApiResult.success();\n    }\n\n    public Object debugTool(Long id, JSONObject reqData) {\n        ToolBox toolBox = getById(id);\n        if (toolBox == null) {\n            throw new BusinessException(ResponseEnum.TOOLBOX_NOT_EXIST);\n        }\n\n        // Add permission validation\n        dataPermissionCheckTool.checkToolBelong(toolBox);\n        ToolProtocolDto request = new ToolProtocolDto();\n\n        ToolHeader header = new ToolHeader();\n        header.setUid(toolBox.getUserId());\n        header.setAppId(commonConfig.getAppId());\n        request.setHeader(header);\n\n        ToolParameter parameter = new ToolParameter();\n        parameter.setToolId(toolBox.getToolId());\n        parameter.setOperationId(toolBox.getOperationId());\n\n        request.setParameter(parameter);\n\n        ToolPayload payload = new ToolPayload();","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/tool/ToolBoxService.java#L445-L481","documentation":"ToolBoxService.debugTool throws TOOLBOX_NOT_EXIST when getById(id) returns null for the tool being debugged. The debug call is aborted before building the ToolProtocolDto and invoking the tool runtime. This guards the debug endpoint against executing calls on behalf of tools that no longer exist.","triggerScenarios":"POSTing to the tool debug endpoint with a nonexistent or soft-deleted tool id; debugging a tool after it was deleted in another tab; stale debug panel state after list refresh; id from a different tenant/space.","commonSituations":"Playground/debug UI kept open while the tool was removed; API clients replaying recorded debug requests with old ids; sharing debug URLs between users without access to the tool.","solutions":["Fetch a valid tool id from the tool list and retry the debug request.","Refresh the debug UI so it reloads the current tool set before retrying.","Confirm the tool was not deleted; recreate it if debug testing is still needed.","Verify tenant/space headers — the tool may exist under another space context."],"exampleFix":"// before\nToolBox tb = toolBoxService.getById(id);\nif (tb == null) { /* tool gone */ }\n// after\nif (toolBoxService.getById(id) == null) {\n    // skip debug or prompt user to select a valid tool\n    return;\n}\ndebugTool(id, reqData);","handlingStrategy":"validation","validationCode":"if (toolBoxService.getById(id) == null) { /* skip debug: tool no longer exists */ }","typeGuard":null,"tryCatchPattern":"try {\n    toolBoxService.debugTool(id, reqData);\n} catch (BusinessException e) {\n    if (\"TOOLBOX_NOT_EXIST\".equals(e.getCode())) {\n        // reload debug panel with current tool list\n    }\n}","preventionTips":["Refresh the debug/playground panel whenever the tool list changes.","Validate the id against the list API before debug calls.","Avoid persisting tool ids in debug URLs; look them up at load time."],"tags":["tool-management","debugging","not-found"],"backgroundTag":"record-not-found","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"}