As my knowledge, the visa automatically expires once the work permit does, technically. But they sometimes doesn’t find out. But if you don’t wanna face later visa complications, you better cancel you visa at the immigration with your work permit cancellation letter provided from your work. And better to go out before Aug 1st.
In my case, I didn’t cancel my work permit and my visa was still opening when I left out the country and I didn’t pay any overstaying fees but later I was coming in again with different visa, that opening date was an issue
The ask:thailand community, consisting of multiple Q/A groups with over 100,000 members, powers this platform. It is not an official government resource. Our members actively contribute to this resource, and while we strive for accuracy, we cannot guarantee its complete reliability. Assistance to travelers is provided as a community service.