fix(FN-1895): improve companies.sh import error handling and add retry behavior

- Surface companies.sh API errors to frontend instead of returning empty list
- Add 30s timeout to GitHub archive download to prevent hanging
- Prevent infinite retry loop in browse catalog useEffect
- Update retry handler to call fetch directly for better control
- Fix TypeScript error with Response type in timeout code
- Add comprehensive tests for error handling and retry behavior
This commit is contained in:
Fusion
2026-04-16 13:31:47 -07:00
committed by gsxdsm
parent ee72c3e3b2
commit 4e66baf204
6 changed files with 307 additions and 17 deletions

View File

@@ -90,12 +90,15 @@ describe("memory-compaction", () => {
expect(automation.steps![0]).not.toHaveProperty("modelProvider");
expect(automation.steps![0]).not.toHaveProperty("modelId");
expect(automation.steps![0]).not.toHaveProperty("modelProvider");
expect(automation.steps![0]).not.toHaveProperty("modelId");
});
it("should set correct timeout", () => {
const automation = createAutoSummarizeAutomation({});
expect(automation.steps![0].timeoutMs).toBe(120_000);
expect(automation.steps![0].timeoutMs).toBe(120_000);
});
it("should prompt to preserve core sections", () => {
@@ -104,6 +107,9 @@ describe("memory-compaction", () => {
expect(automation.steps![0].prompt).toContain("Architecture");
expect(automation.steps![0].prompt).toContain("Conventions");
expect(automation.steps![0].prompt).toContain("Pitfalls");
expect(automation.steps![0].prompt).toContain("Architecture");
expect(automation.steps![0].prompt).toContain("Conventions");
expect(automation.steps![0].prompt).toContain("Pitfalls");
});
it("should prompt to check threshold and skip when below", () => {
@@ -111,12 +117,15 @@ describe("memory-compaction", () => {
expect(automation.steps![0].prompt).toContain("Below threshold");
expect(automation.steps![0].prompt).toContain("skipped");
expect(automation.steps![0].prompt).toContain("Below threshold");
expect(automation.steps![0].prompt).toContain("skipped");
});
it("should prompt to write compacted content to file", () => {
const automation = createAutoSummarizeAutomation({});
expect(automation.steps![0].prompt).toContain(".fusion/memory.md");
expect(automation.steps![0].prompt).toContain(".fusion/memory.md");
});
});