fix: preserve native UI failure reasons and dedupe version literals (#854)

Keep adapter/OS helper failures in diagnostics instead of replacing them
with a canned remediation sentence. Share browserVersionSchema, Node
support prose, and JADX heap/remediation constants so release pins stay
authoritative.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
morluto
2026-10-07 13:00:24 +08:00
committed by GitHub
co-authored by Cursor Agent
parent 166dcd21d0
commit 2d4a910fcd
17 changed files with 67 additions and 46 deletions
+18
View File
@@ -223,6 +223,24 @@ describe("native UI target and cancellation failures", () => {
expect(result.ok).toBe(false);
if (!result.ok) expect(result.error.message).toContain(code);
});
it("preserves the underlying helper failure reason in diagnostics", async () => {
const result = await observeNativeUi(target, "observe_native_ui", scope, {
invoke: async () => {
throw new Error(
"Native helper returned invalid JSON: Unexpected token",
);
},
});
expect(result.ok).toBe(false);
if (result.ok) return;
expect(result.error).toMatchObject({
diagnostics: {
reason: "Native helper returned invalid JSON: Unexpected token",
remediation:
"Native helper failed, timed out, or returned malformed capture data; install compatible Xcode command-line tools and inspect local OS permissions",
},
});
});
it("stops on a failed action and returns ordered before/capture-gap evidence", async () => {
const calls: Readonly<Record<string, unknown>>[] = [];
const result = await observeNativeUi(
+2 -1
View File
@@ -153,7 +153,8 @@ const observeWithHelper = async (
cause,
diagnostics: {
helper_path: helper,
reason:
reason: cause instanceof Error ? cause.message : String(cause),
remediation:
"Native helper failed, timed out, or returned malformed capture data; install compatible Xcode command-line tools and inspect local OS permissions",
},
}),