- Fix potential crash during tool permission prompts: added optional chaining (
?.) when accessinggetAppState()andtoolPermissionContext.modein the permission request handler. Previously, ifgetAppStatereturnednullorundefined(e.g., during teardown or an edge-case race condition), the application could throw aTypeError. The fix changesgetAppState().toolPermissionContext.modetogetAppState?.()?.toolPermissionContext.mode, gracefully handling the null case. (search for"tengu_tool_use_show_permission_request"in functionQyat line ~573815)