fix(coding-agent): avoid blocking footer branch refresh and isolate invalid extension provider registrations closes #2418 closes #2431

This commit is contained in:
Mario Zechner
2026-03-19 21:39:38 +01:00
parent dc1ceb4dd0
commit e0f85a3b5e
9 changed files with 284 additions and 56 deletions

View File

@@ -607,6 +607,29 @@ describe("ExtensionRunner", () => {
});
describe("provider registration", () => {
it("bindCore ignores invalid queued registrations and reports extension error", () => {
const runtime = createExtensionRuntime();
runtime.registerProvider(
"broken-provider",
{
streamSimple: (() => {
throw new Error("should not run");
}) as any,
},
"/tmp/broken-extension.ts",
);
const runner = new ExtensionRunner([], runtime, tempDir, sessionManager, modelRegistry);
const errors: string[] = [];
runner.onError((error) => errors.push(`${error.extensionPath}: ${error.error}`));
expect(() => runner.bindCore(extensionActions, extensionContextActions)).not.toThrow();
expect(errors).toEqual([
'/tmp/broken-extension.ts: Provider broken-provider: "api" is required when registering streamSimple.',
]);
expect(() => modelRegistry.refresh()).not.toThrow();
});
it("pre-bind unregister removes all queued registrations for a provider", () => {
const runtime = createExtensionRuntime();