Pretext
PS: If you missed it, baileys 7.0.2, alongside libsignal 6.0.1, are critical security updates that were published days before this article. Learn more. Hey everyone! I’m Rajeh, you may know me under the handle @purpshell. It has been 3 months since we shipped the last release candidate (rc14) of what would’ve been Baileys v7.0.0. I know, I know, that wasn’t the prettiest time in the recent history of Baileys, and it certainly left a lot of you confused and worried about the future of this project. The popular opinion circulating in WhatsApp and Telegram groups and among the community is that “Baileys has been abandoned by the WhiskeySockets team”. That is categorically false. I made an announcement in August about the future of Baileys, in this statement, I explained that Baileys will enter a short-term high-speed development cycle and then wrap off with around a year of LTS (long-term support), meaning Baileys will continue to receive security, stability and existing feature updates till the end of 2028. That is a very long horizon that we were committed to. I would like to retract that statement, and replace it with another statement in the next section. For the last 6 months, under Polymorfa, I’ve been building an Avengers-level team of WhatsApp nerds. I have hired people that are seasoned veterans in Meta Cloud API solutions, and I have hired legends like João Lucas (@jlucaso1) to work with me directly on the future of WhatsApp automation. We shipped daily in these 6 months. Polymorfa (currently in a whitelist due to high demand), is now a proven platform with a breadth-and-depth that drives existing solutions out of the water. We also made a lot of OSS tools. These include Barback (previously Bartender, open-source soon): a server that simulates the entire protocol with 1:1 parity; Cellar: a local MCP that turns your AI agent into a WhatsApp RE expert; Jigger (retired): A rich protocol browser that kept itself updated, and tried to define whatsapp behaviors in its own compilable IR language. Back in August 10th, I made a comment about “immortal libraries”. I believe with the dawn of modern AI coding agents, we have reached that convergence point. Meta ships a new revision every other hour now. At this pace, its getting hard to keep up.Introducing: Sentinel
Sentinel by Polymorfa is a fully-capable, always-online automated system designed to do one thing: figure WhatsApp Web out. It does the following:- Processes new releases automatically, analyzes the code, the definitions and parses them into an indexed SQLite database per release. This makes timestamping, detecting changes, comparing source bundles, as simple as a SQL command.
- Creates and runs integration & unit tests against new and existing WhatsApp Web modules, with over 7000 tests across 170 suites today. It uses a custom test harness wrapped around a custom runtime. It factors in all reasonable possible permutations of ABProps, GKX (gates, knobs, experiments), and server-side props using a custom AST that will also graph the permutations of dependencies too. This allows us to treat WhatsApp Web as our source-of-truth, rather than scramble for a JSON IR, like my failed attempt with jigger and zapo & oxidezap’s attempts. Automatically, we can now tell whether the things that matter to us are going to break or not. These tests are language-agnostic and since we have a custom testing harness, we adapted the tests to run on hypermeow, Baileys, whatsapp-rust in that order, with more libraries joining soon.
- This information is packaged neatly into a packet and sent via MCP to an AI coding agent. It assesses the changes and dives deep into the source to understand what happened. It recommends the right patches and automatically opens changes into Polymorfa’s core. It also suggests PRs into other libraries, and you will see this deployed over the next week with the coordination of maintainers in: hypermeow, whatsmeow, whatsapp-rust, Baileys Cobalt, and zapo, in that order.
- The AI coding agent then uses Sentinel’s internal MCP tooling to brief maintainers on coming changes in Discord/Slack, assess conformance issues (parity gaps), performance benchmarking, and % completion and % covered under tests.
- The end result: A pull request or issue regarding a real verified problem, posted after human verification from maintainers & publication from Polymorfa.
The Baileys Advent
For the month of Decemeber 2026, I will be challenging myself in a personal capacity and the capacity of the members of my team at Polymorfa, to ship a Baileys minor or patch version every single day till the new year. No breaking changes. Just nice additions, documented changes, and real feedback, interacting hands-on with users. We will begin with clearing up the backlog of issues and PRs that exist today. We have already planned the next 2 minor releases: 7.2.0 on Monday 7th of December and 7.3.0 on Wednesday 9th of December, and patch releases for bugs & non-breaking features will be sprinkled in between. The end goal: full feature parity with WhatsApp and a Sentinel-friendly library that can eventually be automatically maintained.I am committed to open-source libraries. As maintainer of WhiskeySockets/Baileys for the past 3 years, my highest month in sponsorships was around 1800$ (in August 2024) and more than 70% of my monthly sponsorships is being donated back to other maintainers (support @jlucaso1 and @vinikjkkj when you can!), paid out in bounties, acquiring testing servers & numbers for contributors, Discord server bots (for translation, for AI answers), procuring documentation software plans, domains.. Needless to say, it was not a career, yet I wanted to do this full-time. I took contracts with Whaticket, BotConversa, and Beeper (Automattic’s messaging app, which @tulir co-founded). I fought endlessly to keep things in open-source. We upstreamed a lot of the work i was paid for, most prominently meowcaller, a pure-Go calling client for WhatsApp Web that was the result of a 18 hour pure-MLOW codec goose chase on a train in Switzerland. Yet, a lot of my efforts were undermined by corporate interests, including publicization of WhatsApp Metrics (WAM). There was a reason it never ended up in the public whatsmeow version. I decided to be my own boss, negotiate contracts with vendors on my own terms and build the right landscape for developers, such that i won’t have a conflict of interest. That is now Polymorfa, and in the coming days, we will be GA for your messaging needs. — Thank you for your relentless support. Rajeh “purpshell” Taher
Release notes
Related PR: https://github.com/WhiskeySockets/Baileys/pull/2979 This release (originally 7.0.0) has been in the works since January of 2026. There were multiple roadblocks on the way there, including the fact that libsignal-node (and whatsapp-rust’s libsignal) were both GPL despite Baileys being MIT.libsignal v7.0.0
We pondered about the libsignal question for months, and eventually after some time, João finished a faster and more efficient rewrite of libsignal (wacore-libsignal) in [email protected], licensing it under MIT. João filed his initial PR for Rust-based libsignal into Baileys back in November 16, 2025. Today, libsignal 7.0.0 is a rewritten package, with a new API. It properly handles logging, errors with codes, a type-safe store, that somehow keeps the same session storage format. That means: sessions can move from 6.x.x to 7.x.x and back. The high-level API is entirely in TypeScript, supports modern design standards, and relies on the Rust-based baileys-core (renamed from whatsapp-rust-bridge) for the underlying crypto, meaning it is super super fast. We have tested & written migration regression tests for sessions from: 6.7.24, 6.17.16, 7.0.0-rc.1->rc.9, 7.0.0-rc10->rc14 and 7.0.0, 7.0.1, and 7.0.2 separately. To learn more about API changes, see the libsignal 6.x → 7.x API migration table. Also, libsignal has moved in-house with the rest of the packages, under the pnpm monorepo ⏬.pnpm monorepo
Baileys is now a pnpm-managed monorepo, for ease of collaboration, to keep docs in sync with changes, to bump the different packages together, and to keep the Rust bridged features from desyncing. This has a side-effect: Installing Baileys via GitHub is no longer recommended. Please install things over the NPM registry for your security and for the stability of the project.- NPM releases are signed by GitHub using provenance. If Baileys’ repo (or any repo that you install this way) gets compromised, your NPM has no way to tell, since its just pinning the branch, and rewriting the lockfile on each install.
- We are discontinuing the
developbranch after 100 different PR authors failing to point their branches to it after our announcement.masterwill be less “stable” but it will be branch-protected. No force-pushes, no bypassing PRs. No merging PRs that are not production-ready or production-tested. - Move over now:
npm install baileys@latest
@whiskeysockets/baileys-core 0.6.0
Instead of the old whatsapp-rust-core package, we now have a package that lives in the same repo underpackages/core.
It adapts a lot of learnings from baileysrs, a side project that João started, including an all-new app-state system and also Noise transports now relying on the Rust core.
protococktail 1.1029496320.1 (<major>.<client_revision>.<patch>)
I have parked the protococktail NPM package for over 2 years now. I debated with hundreds of people over these years, how version delivery should be handled.
Everyone has their own solution: whatsmeow just updates everyone alongside it and keeps it all in the same structure, whatsapp-rust and zapo have more complicated solutions..
I tried in February 2026, various renditions of a “version-server” that was going to land in v7. It would give the github repo, authoritative definitions over what proto, graphql, wam, mex, abprops, media strings and binary dictionaries. This was to solve the headache of constantly bumping the library over a small version expiry (like what happened on version 7.0.0), or over a change in the whatsapp dict and dict version that would break the way the socket communicates etc.
That was the wrong model. It put too much authority in a single place and sometimes due to runtime overrides, would break the socket entirely.
That’s when i got to thinking over the last few weeks and i found the solution:
<major>.<client_revision>.<patch>
By keeping all these definitions that can change easily and can be tracked easily, outside the main baileys package, baileys can pin the <major> version.
Practical example: WhatsApp releases revision 1029496320. protococktail releases under 1.1029496320.0. Baileys pins ^1.1029496320.0.
Now, when WhatsApp releases another revision, an npm update will automatically put your Baileys on the latest revision.
Example: When WhatsApp releases a new revision (1029496321) that breaks things, where Baileys fails to compile, we simply bump the <major>, and pin it under a new Baileys release, e.g. 2.1029496321.0 and Baileys pins ^2.1029496321.0.
This way, Baileys can safely upgrade when it can (and give you access to new message types via protos, and abprops, wam, mex queries etc.), without a change in the Baileys version itself. This lifts the burden away from the maintainers of Baileys and those spending hours making PRs to fix these small-but consequential issues.
When we make a mistake and need to rectify it with another publish, a bump of the <patch> is made. This works perfectly within Semver and NPM’s rules.
baileys 7.1.0
Finally, we are now at the level of the Baileys package.- Timeouts from
sock.query()now properly throw aBoomrather than returningundefined, with error status 408, followingDisconnectReason.timedOut. Reusing a message id that’s still waiting will return a 409. useMultiFileAuthStatehas been deprecated. @adiwajshing, the creator of the Baileys project, only created it for demo purposes and said that it must never be used in production.- Despite that, I updated it to include:
- Atomic writes with a
.bakcopy - Corrupt files throw a new error
AuthFileCorruptError. Previous behavior was starting the session corrupted.
- Atomic writes with a
- Despite that, I updated it to include:
- In the place of
useMultiFileAuthState, we now haveuseSqliteAuthState! You can migrate from the file based format using themigrateAuthStatefunction.- The new auth state is much more rigid and corruption-resistant.
- The SignalKeyStore has been updated to allow for listing entries and CRUD, adding
clear(),list(), andlistIds(), on top ofget()andset(). This allows for a more organized retrieval and storage process. This allows for later migration of Baileys auth state into other libraries and is also required by themigrateAuthStatefunction.
- For those who call
keys.transaction(work, key)directly. It is deprecated in favor ofkeys.transactWith({ records }, work). Both patterns continue working for now. - If you somehow call
sock.messageMutex.mutex(task)or other mutexes manually without a key, they now require a key per collection. Issues a warningBAILEYS_UNKEYED_MUTEX. - If you import any of the old Signal Group implementation (
baileys/lib/Signal/Group/*), its only kept for compatibility with a warning. - Likewise for whose who use
getNextPreKeysNode(...).update. - If you set
WHATSAPP_RUST_BRIDGE_*environment variables, you need to rename them toBAILEYS_CORE_*. The old ones still work behind a warning. - If you use the
libsignalpackage directly, follow the migration table as advised above.
One more thing
There’s one thing I always hated about Baileys: the connection lifecycle. You have to do this weird song and dance, making a socket, and then tearing it down at the smallest disconnect, and reconstructing it all over again. Everyone who used Baileys has seen it in the Example.ts file. That has multiple disadvantages:- Important cache gets cleared, increasing requests and subsequently bans, waiting for message errors, so on.
- corruption of auth state, for example, tearing down and GCing a whole socket mid-write
- JS having problems freeing the memory properly because an obscure reference still points to the socket’s event listeners etc.
autoConnect: false flag, the socket does not start as soon as its made, and rather waits for you. From this point on, it also automatically reconnects to WhatsApp when it times out / trivial disconnections. This will be the default later.
sock.connect()- making a socket does not automatically open it up, and this makes things much simpler and less prone to race conditions, for example when requesting pairing codessock.disconnect()- properly disconnects from the whatsapp servers without destroying the entire socket, can simply just reconnect viaconnect()socket.destroy()- properly destroys the socket, its cache, and frees up memory.
reconnect: false flag. This flag is only relevant if you use autoConnect: false. It allows you to manually handle reconnects the legacy way, rather than let the new system manage them.
This took me 2h30min to type lol my hands are dying and I’ve been awake for too long. Enjoy! Call you on Monday 😉 📞 (need a long sleep after this one). PS: If you made it this far, do check out Polymorfa, we have a free tier, we have a paid tier, we have whatever you desire, its a candy store. We re-opened the email waitlist so users can queue up when we finish internal revamp. https://polymorfa.com/