Update: compress/hard constrained token usage (#136)

* setup truncation & folder structure

* fix: xml in prompt; qwen code in stats page

* fix: clear & continue logic

* preflight

* add maxSessionLimit in README
This commit is contained in:
Fan
2025-07-30 18:14:24 +08:00
committed by GitHub
parent a08bcb2f41
commit df5c4e8079
29 changed files with 1117 additions and 386 deletions

View File

@@ -115,7 +115,7 @@ describe('getFolderStructure', () => {
it('should return basic folder structure', async () => {
const structure = await getFolderStructure('/testroot/subfolderA');
const expected = `
Showing up to 200 items (files + folders).
Showing up to 20 items (files + folders).
/testroot/subfolderA/
├───fileA1.ts
@@ -129,7 +129,7 @@ Showing up to 200 items (files + folders).
it('should handle an empty folder', async () => {
const structure = await getFolderStructure('/testroot/emptyFolder');
const expected = `
Showing up to 200 items (files + folders).
Showing up to 20 items (files + folders).
/testroot/emptyFolder/
`.trim();
@@ -139,7 +139,7 @@ Showing up to 200 items (files + folders).
it('should ignore folders specified in ignoredFolders (default)', async () => {
const structure = await getFolderStructure('/testroot');
const expected = `
Showing up to 200 items (files + folders). Folders or files indicated with ... contain more items not shown, were ignored, or the display limit (200 items) was reached.
Showing up to 20 items (files + folders). Folders or files indicated with ... contain more items not shown, were ignored, or the display limit (20 items) was reached.
/testroot/
├───.hiddenfile
@@ -160,7 +160,7 @@ Showing up to 200 items (files + folders). Folders or files indicated with ... c
ignoredFolders: new Set(['subfolderA', 'node_modules']),
});
const expected = `
Showing up to 200 items (files + folders). Folders or files indicated with ... contain more items not shown, were ignored, or the display limit (200 items) was reached.
Showing up to 20 items (files + folders). Folders or files indicated with ... contain more items not shown, were ignored, or the display limit (20 items) was reached.
/testroot/
├───.hiddenfile
@@ -177,7 +177,7 @@ Showing up to 200 items (files + folders). Folders or files indicated with ... c
fileIncludePattern: /\.ts$/,
});
const expected = `
Showing up to 200 items (files + folders).
Showing up to 20 items (files + folders).
/testroot/subfolderA/
├───fileA1.ts