Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(session): reject an unknown configured provider before unbound routing (#2976)

Aaditya64041e3072e9
diff --git a/src/application/binary/AnalysisProviderRegistry.test.ts b/src/application/binary/AnalysisProviderRegistry.test.ts
index 8eae6c9c9..fde2f6718 100644
--- a/src/application/binary/AnalysisProviderRegistry.test.ts
+++ b/src/application/binary/AnalysisProviderRegistry.test.ts
@@ -186,6 +186,28 @@ describe("analysis provider registry: binding failures and cancellation", () =>
expect(explicit.error.reason).toBe("target_unsupported");
});
+ it("rejects an unknown environment preference even when every candidate rejects the target", async () => {
+ const alpha = candidate("alpha");
+ const misconfigured = new AnalysisProviderRegistry(
+ [alpha.provider],
+ "missing",
+ );
+
+ for (const selected of [
+ await misconfigured.select(ARTIFACT_TARGET),
+ await misconfigured.select(ARTIFACT_TARGET, "missing"),
+ ]) {
+ if (selected.ok) throw new Error("expected unknown provider rejection");
+ expect(projectAnalysisError(selected.error)).toMatchObject({
+ details: {
+ selection_reason: "unknown_provider",
+ requested_provider_id: "missing",
+ candidate_ids: ["alpha"],
+ },
+ });
+ }
+ });
+
it("does not bind a profile with unresolved version or adapter failure", async () => {
const unresolved = candidate("unresolved", { profile: "missing" });
const failed = candidate("failed", { profile: "error" });
diff --git a/src/application/binary/AnalysisProviderRegistry.ts b/src/application/binary/AnalysisProviderRegistry.ts
index 5b7e78813..033677881 100644
--- a/src/application/binary/AnalysisProviderRegistry.ts
+++ b/src/application/binary/AnalysisProviderRegistry.ts
@@ -176,7 +176,7 @@ export class AnalysisProviderRegistry {
return err(new AnalysisCancelledError("open_binary"));
if (
request === undefined &&
- selector !== "auto" &&
+ this.#byId.has(selector) &&
baseline.length > 0 &&
baseline.every(
({ targetSupport }) => targetSupport.status === "unsupported",