in reply to MediaWiki::API badtoken every now and then
This sounds like Bug #122928 for MediaWiki-API: repeated edits fail with "Invalid CSRF token". No solution yet.