Summary
AskableContext.resolveExplicitHierarchyParent() in packages/core/src/context.ts (line 161) passed a user-supplied data-askable-parent attribute value directly to querySelector() without a try/catch. An invalid CSS selector (e.g. data-askable-parent=":invalid(") throws a DOMException: SyntaxError, which propagates out of the focus tracking callback and disrupts all subsequent interaction tracking for that element.
The identical bug was previously fixed in observer.ts, but the context.ts copy of the same function was missed.
Impact
Any element with a malformed data-askable-parent attribute silently breaks focus tracking for that element — no focus events fire, and the error may propagate to window.onerror.
Fix
Wrap the querySelector call in a try/catch that returns null on error, matching the existing fix in observer.ts.
Fixed in: claude/create-agents-md-fqfEf
Summary
AskableContext.resolveExplicitHierarchyParent()inpackages/core/src/context.ts(line 161) passed a user-supplieddata-askable-parentattribute value directly toquerySelector()without a try/catch. An invalid CSS selector (e.g.data-askable-parent=":invalid(") throws aDOMException: SyntaxError, which propagates out of the focus tracking callback and disrupts all subsequent interaction tracking for that element.The identical bug was previously fixed in
observer.ts, but the context.ts copy of the same function was missed.Impact
Any element with a malformed
data-askable-parentattribute silently breaks focus tracking for that element — no focus events fire, and the error may propagate towindow.onerror.Fix
Wrap the
querySelectorcall in a try/catch that returnsnullon error, matching the existing fix inobserver.ts.Fixed in:
claude/create-agents-md-fqfEf