fix(pi-extension): guard theme access with try-catch for pi-web compatibility (#336)
pi-coding-agent 0.80.x uses a Proxy for the theme object that throws 'Theme not initialized' when accessed before initTheme(). In pi-web, the session_start event fires before the theme is ready, causing the optional chaining guard to fail (Proxy is truthy, ?. can't catch Proxy get-trap throws). Wrap theme access in try-catch so the extension degrades gracefully. Co-authored-by: huantian666 <huantian666@gmail.com> Co-authored-by: Emeriko <dietrich.gebert@gmail.com>
H
Hrqz committed
6165b7011a40bfd909dcb4d54e25c9ef667abc8f
Parent: 1715abc
Committed by GitHub <noreply@github.com>
on 7/9/2026, 3:27:28 PM