Find the engine containers with docker container list filtered on the dagger-engine name prefix, then stop and remove them. Optionally run docker volume prune and docker system prune to clear container state, at the cost of a slow first run when the engine is re-provisioned. If you custom-provisioned the engine, adapt the container names to your setup. Re-run the function afterwards; the engine comes back clean.

Context: Official Dagger troubleshooting docs: a Dagger Function may hang or become unresponsive, eventually failing with BuildKit errors like buildkit failed to respond or container state improper. The documented fix is to stop and remove the Dagger Engine container and optionally clear its state.