Kobolds v0.1.1#
First public release of Kobolds, a high-performance messaging broker written in Zig 0.16.0, along with its client ecosystem (Zig client, libkobolds C ABI, and Node.js/TypeScript client). It has been a long journey to get here and the future looks bright for Kobolds. This is a large release and these notes will in no way provide the full detail of all of the changes, features or bugs since the beginning of this iteration of Kobolds in 2026 but I'm gonna try!
Because this is the first release, these notes cover everything since the repository was created. That includes the history imported from GitHub/Codeberg (first commit 11/08/2025) and all GitLab merge requests from !1 (01/04/2026) through !58 (10/04/2026).
Status: Early preview for friendly developers and community members. Expect breaking changes to the protocol, APIs, and config before 1.0.
Release stats#
Since this is such a massive release, I thought it might be fun to include this little table. This doesn't include the dependencies I've also written to support Kobolds but includes the broker, cli, zig client and nodejs/typescript client.
| Area | Added | Deleted | Changed |
|---|---|---|---|
| Zig | 41,488 | 8,602 | 6,618 |
| TypeScript/JavaScript | 9,387 | 661 | 197 |
Contributors#
- https://gitlab.com/@bengarishodge (everything else)
- https://github.com/JW-Ellis (pre-GitLab https://github.com/kobolds-io/kobolds/pull/28)
- https://github.com/ignorant05 (pre-GitLab PR https://github.com/kobolds-io/kobolds/pull/26)
Highlights#
- Pub/sub messaging with topics, publishers, subscribers, subscribe/unsubscribe, and retained messages.
- Request/reply messaging through advertised services (requestors and repliers).
- Entity lifecycle operations (create, read, destroy) for topics, services, publishers, subscribers, requestors, and repliers.
- Session-based authentication (pre-shared keys with
hmac256ornone) and policy-based authorization. - Multi-threaded broker. Messages move between the router and worker threads through lock-free SPSC queues and ref-counted routing/reclaim envelopes.
libkoboldsC ABI plus a Node.js/TypeScript client, both published to the GitLab package registry.- Built-in message tracing and a span-based tracer for finding bottlenecks.
- Message v3 format with optional, chunk-backed or dynamic backing memory.
- MkDocs documentation site covering the protocol, CLI, broker, and clients.
Breaking Changes#
kbencoding removed: The broker, clients, and CLI no longer support the customkbpayload encoding or its config options. Usejson,cbor, or raw bytes. (#80, !58)- Message v3: The wire and in-memory message format changed. Message bodies are now optional and can be backed by chunk or dynamic memory. (#73, !52)
trace_id: Trace IDs are now random 64-bit integers instead of time-based IDs. (#55, !27)- Auth config: The
userauthentication strategy was renamed tousername_password, anduser.secretwas renamed touser.password. (#13, !1) - Zig 0.16.0: You need Zig 0.16.0 to build. (#52, !23)
Features#
Core Broker and Protocol#
- Initial project structure, CLI and entrypoints, frame and frame parser, message framing, broker configuration, async I/O, TCP transport, message routing, authentication/authorization, and broker implementation (imported pre-GitLab history) (!3, !4)
- Broker session handling:
session_init,auth_success/auth_failure, broker identity, and broker connection groups (#5, !1) - Topics: create and delete topics; request/reply plumbing via
correlation_id(renamed fromtransaction_id) (#18, !5) - Publish: create publisher and publish messages to topics (#17, !6)
- Delivery context: optional
DeliveryContexton frames, serde support, and new envelope kinds for broker/worker/connection (#28, !7) - Subscribe: broker handling for subscribers and published messages (#19, !8)
- Message tracing: opt-in
--tracewith au64trace ID (#14, !14) - Broker native format: encode known payloads as
json,cbor, or bytes (#36, !15) - Services and request/reply: advertised services, request/reply routing,
std.Io.Reader/std.Io.Writer-compatible chunk reader/writer, message body payloads, payload encoding for control messages (#21, #22, #23, #38, !18) - Retained messages (#37, !21)
- Read entity: topics and services (#60, !22)
- Read entity: subscribers, publishers, requestors, and services (#60, !28)
- Destroy entity: topics, services, subscribers, publishers, requestors, and repliers (#61, #17, #18, #21, #22, #23, !29)
- Unsubscribe: subscribers can pause delivery without being destroyed (#71, !43)
- Configurable magic numbers: broker pool capacities and SPSC queue slots, with documented constants (#68 – partial, !47, !57)
CLI and Clients#
- cli: initial CLI with broker
listenand client commands (imported pre-GitLab history) (!3, !4) - cli: argument parsing reworked for the new client config, connection strings, and auth credentials (#3, !1)
- cli:
create-topic,delete-topic,publish, andsubscribecommands (#18, #17, #19, !5, !6, !8) - cli:
--traceflag for message tracing (#14, !14) - cli:
publish --rateand--countflags (!24) - cli: config file path option on commands (#64, !55)
- zig client: client implementation with connect and timeout,
session_init,auth_success/auth_failure, client connection groups,hmac256pre-shared keys, andconnection_stringparsing (transport/host/port) (#3, #5, !1) - zig client: request/reply (
request,requestSync) withcorrelation_id(#18, !5) - zig client:
Client.subscribeand handlers for published messages (#19, !8) - zig client: services, requestors, and repliers (#21, #22, #23, !18)
- zig client: read and destroy entities (#60, #61, !22, !28, !29)
- zig client: unsubscribe (#71, !43)
- zig client: configurable client pool capacities (#68 – partial, !47, !57)
- nodejs/typescript client: prototype
libkoboldsC ABI used by the client (#29, kobolds-ts#1, !12) - nodejs/typescript client:
libkoboldsreaches client parity for core functionality (!32, kobolds-ts!6) - nodejs/typescript client:
libkoboldspublished to the GitLab package registry (!34) - nodejs/typescript client: client moved into the
koboldsrepo and published (scoped package) to the GitLab package registry with CI tests (#66, !35) - nodejs/typescript client: unsubscribe (#71, !43)
Observability and Performance Tooling#
- Tracer with span recording across broker, workers, and clients; message pool allocation; tracer analysis scripts (#69, #53, !40)
- Isolated benchmarking framework: transport-agnostic
Pipeabstraction and a mock pipe for in-memory benchmarks (#27, !39)
DevOps and Distribution#
- GitLab CI/CD pipeline that runs tests before merge (#6, #8, !10)
- Multi-target builds, deployment to the dev farm, and a
systemdservice for the broker (!25) - Reworked CI/CD so
kobolds,libkobolds, and clients are tested, built, and published together; independent build targets (!44) - Versioned
koboldsbinary artifacts uploaded to the GitLab package registry; Ansible/Docker output (#7, !45)
Documentation#
- MkDocs site: protocol, CLI usage, client usage, build docs, endianness, roadmap (#2, #64, #67, !55)
- Expanded client docs and separate broker/client installation guides (#67, !56)
- README updates: dependencies, implemented features, badges, TypeScript client (!16, !26, !42, !48)
Bugfixes#
- Publisher/subscriber resync when a topic is added or a message is published (#19, !8)
- zig client: client slept for 1 ms on every tick (!9)
- Benchmarks made more resilient (!13)
- Stopping a publisher crashed the broker (#39, !17)
- Race condition on message deref (!19)
- cli: a connection string was required for every command (#48, !20)
- Broker crashes under backpressure and overpressure with fast producers and slow consumers (#63, !33)
- zig client: client crashes (OOM) under backpressure; publish backpressure handling and corrected recv/send buffer sizes (#63, !33)
- Zig
ChunkWriterstream write error (!35) - nodejs/typescript client: broken package export file (!36)
- Serializer did not recompute the expected size when adding a delivery context, which could overpack the output buffer (!38)
- Tracer memory leak and memory corruption when publishing many traced messages (#70, !49)
- Offset bug in the chunk reader/writer (#73, !52)
- Inter-thread routing queues reduced to 1024 slots (!53)
- Chunk memory used by default, with fallback to dynamic memory when the chunk pool is exhausted; clearer deserialization errors (#74, !54, !55)
- Client never received
auth_failurebecause the broker closed the connection before sending it (!56)
Refactors#
- Renamed authentication strategies (
username_password,password) in broker and zig client (#13, !1) - Codebase reorganized to make the library more portable (!11)
- Upgraded to Zig 0.16.0 (#52, !23)
trace_idis now a random integer (#55, !27)- nodejs/typescript client:
libkobolds/C ABI rewritten for the new APIs:src/abi/, opaquekb_context, header/body getters and setters (#62, !30, !31) - Inter-thread messaging:
RoutingEnvelope/ReclaimEnvelope, ref-counted messages, lock-free SPSC queues, no cross-thread deallocation (#65, !33) - nodejs/typescript client: moved from
kobolds-tsinto thekoboldsrepo (#66, !35) - Message v3: optional, chunk-backed or dynamic memory,
FrameReassemblerV2/FrameDisassemblerV2, serializer v2, new header getters/setters (#73, !52) - zig client: message creation switched to dynamic memory for message v3 (#73, !52)
- nodejs/typescript client:
libkoboldsABI and tests updated for message v3 (#73, !52) - Removed
kbencoding from the broker (#80, !58) - cli: removed
kbencoding options (#80, !58) - zig client: removed
kbencoding (#80, !58) - nodejs/typescript client: removed
kbencoding (#80, !58) - Dependency update:
stdxv0.4.2 for better allocation performance (!46) - Tuned broker/client params for benchmarking and idling; removed dead message types (!44, !47, !50)
- Repository housekeeping: removed Apache license and rewrote git history (#15, #16, !2, !3, !4)
Known Issues#
- Very large message sizes and volumes can cause a switch on a corrupt value. (#75)
- Chunk memory appears slower than dynamic memory. (#76)
session_joinis not implemented yet; clients usesession_initonly. (#57)- Some config parameters are still hard-coded, such as the worker memory pool size and pool pressure. (#68)