Skip to content

Commit 8079d0f

Browse files
committed
fix:压缩后没有正确找到原始文件merge
1 parent 807fded commit 8079d0f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/extension.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ export async function doUploadCommand(cvbFilePath: string, userPrompt: string, o
6868

6969
let cvbContent = fs.readFileSync(cvbFilePath, 'utf-8');
7070
const CVB_QUERY_LENGTH_LIMIT = 1024 * 2;
71-
if(cvbContent.length > CVB_QUERY_LENGTH_LIMIT) {
72-
const inputCvb = new Cvb(cvbContent);
71+
const inputCvb = new Cvb(cvbContent);
72+
if(cvbContent.length > CVB_QUERY_LENGTH_LIMIT && !inputCvb.getMetaData("compressFrom")) {
7373
if (!inputCvb.getMetaData("compressFrom")) {
7474
currentOutputChannel?.appendLine("输入数据过于巨大,先进行压缩预处理...");
7575
const compressedCvb = await compressCvb(inputCvb, userPrompt);
76+
compressedCvb.setMetaData("compressFrom", cvbFilePath);
7677
cvbContent = compressedCvb.toString();
7778
}
7879
}

0 commit comments

Comments
 (0)