mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-07 02:07:45 +02:00
10 lines
546 B
TypeScript
10 lines
546 B
TypeScript
// Escalate a failed cached-index click to a fresh by-name resolution only when it's
|
|
// safe and possible: the click explicitly ERRORED (so it provably never landed, no
|
|
// double-act risk), it wasn't a text-fill (fills verify themselves), we know the
|
|
// element's name to re-find it, and the A/B toggle is on. Pure so the invariant is testable.
|
|
export function shouldSelfHealClick(
|
|
errored: boolean, wantsText: boolean, name: string | undefined, selfheal: unknown,
|
|
): boolean {
|
|
return errored && !wantsText && !!name && selfheal !== false;
|
|
}
|