chore: merge origin/main into main

This commit is contained in:
Peter Steinberger
2026-02-22 13:42:52 +00:00
304 changed files with 17041 additions and 5502 deletions

View File

@@ -116,6 +116,40 @@ describe("buildBootstrapContextFiles", () => {
expect(result[0]?.content.length).toBeLessThanOrEqual(20);
expect(result[0]?.content.startsWith("[MISSING]")).toBe(true);
});
it("skips files with missing or invalid paths and emits warnings", () => {
const malformedMissingPath = {
name: "SKILL-SECURITY.md",
missing: false,
content: "secret",
} as unknown as WorkspaceBootstrapFile;
const malformedNonStringPath = {
name: "SKILL-SECURITY.md",
path: 123,
missing: false,
content: "secret",
} as unknown as WorkspaceBootstrapFile;
const malformedWhitespacePath = {
name: "SKILL-SECURITY.md",
path: " ",
missing: false,
content: "secret",
} as unknown as WorkspaceBootstrapFile;
const good = makeFile({ content: "hello" });
const warnings: string[] = [];
const result = buildBootstrapContextFiles(
[malformedMissingPath, malformedNonStringPath, malformedWhitespacePath, good],
{
warn: (msg) => warnings.push(msg),
},
);
expect(result).toHaveLength(1);
expect(result[0]?.path).toBe("/tmp/AGENTS.md");
expect(warnings).toHaveLength(3);
expect(warnings.every((warning) => warning.includes('missing or invalid "path" field'))).toBe(
true,
);
});
});
type BootstrapLimitResolverCase = {