Go Library Releases of the Week: Bubble Tea 2.2 with OSC 7577, go-redis 9.24, gotreesitter 0.58, quic-go 0.66, and oapi-codegen 2.9Thematic roundup · digest for November 28
Modular showcase of fresh Go library releases featuring updated network protocol and terminal UI components
Thematic roundup5 sections≈ 5 min

Go Library Releases of the Week: Bubble Tea 2.2 with OSC 7577, go-redis 9.24, gotreesitter 0.58, quic-go 0.66, and oapi-codegen 2.9

Bumping five lines in go.mod to eliminate long TLS handshake drops, QUIC leaks, OpenAPI schema headaches, and cgo in a code parser is a realistic plan if your services are already on Go 1.26+. Three of these releases are drop-in upgrades, while two ask you to check configs and a few handlers first.

Bubble Tea 2.2: restoring TUI apps after a terminal restart (OSC 7577)

Restart your terminal, and open TUI apps vanish so you have to relaunch them by hand. Bubble Tea 2.2 solves this with support for OSC 7577 (Program Resume Protocol), which launched 12 hours before the release and already works in Rex and Herdr.

A terminal supporting OSC 7577 sets OSC7577_TOKEN (read on startup via tea.EnvMsg). The app sends an escape sequence with its relaunch command (argv), pid, timestamp, and a MAC signature using that token—just set a field on tea.View.

func (m model) View() tea.View {
    v := tea.NewView(m.render())
    // Provide the command and working directory to restore the session
    if !m.quitting {
        v.ProgramResume = &tea.ProgramResume{
            Args: []string{m.exe, "--session", m.sessionID},
            Dir:  m.dir,
        }
    }
    return v
}

After a restart, the terminal verifies the signature and restores the app on screen. Per the spec, it's a hint rather than a guarantee: the terminal decides whether and how to honor it.

go-redis 9.24: Redis 8.12 commands and experimental Active-Active failover

The go-redis 9.24 client catches up with Redis 8.12: it adds set-member TTLs (SExpire, SPExpire, STTL, SAddEX), ZMOVE/BZMOVE/ZMOVEMEMBER, BITRANGEINTARRAY, CF.COMPACT, scalar HNSW in FT.CREATE, RERANK in FT.HYBRID, and BLESS (NO-EVICT).

For Active-Active setups (Redis Enterprise), it introduces an experimental NewMultiDBClient with circuit breakers, weights, lag-aware health checks, and MetricGroupFlagMultiDB metrics in redisotel-native. Cluster routing and client-side caching (CSC) now share a unified COMMAND metadata table.

// Enable cluster routing via COMMAND metadata
rdb.SetCommandInfoResolver(redis.NewCommandMetadataResolver())

// Set a TTL on a set member in Redis 8.12
err := rdb.SExpire(
    ctx, "myset", 5*time.Minute, "member1",
).Err()

That shared table unlocks OPT-IN/OPT-OUT CSC on ClusterClient and cross-slot MGET that handles MOVED/ASK during resharding. It also adds per-client OTelRecorder, FullDuplexPipes/PipelineMinIdleConns, and an idle connection reaper. The MultiDB API is still experimental and may change.

gotreesitter 0.58: parity with C tree-sitter across 34 grammars without cgo

Pulling C tree-sitter into Go via cgo creates build headaches. gotreesitter 0.58 introduces internal/ccore, a pure-Go engine (stdlib only) matching C tree-sitter 0.27.1.

Thirty-four grammars—including JSON, Python, C, TypeScript, Rust, Ruby, Kotlin, Zig, Dockerfile, Protobuf, TOML, CSS, and SQL—now use ccore by default. On the test corpus, it matched C on 1,283/1,283 tree digests and 509/509 incremental edits (178/202 on real files). ParseContext and ParseStrict add timeout cancellation.

// Cancel heavy parsing via context
tree, err := entry.ParseContext(ctx, src)
if err != nil {
    return err
}
if r := tree.RetryStopReason(); r != gotreesitter.ParseStopNone {
    log.Printf("error recovery stopped early: %v", r)
}

On files with syntax errors, parse trees for those 34 grammars may differ from v0.57.0 because they now match C. You can restore the older engine for a parser with parser.SetAdmissionCandidateRoute(false).

quic-go 0.66: a major batch of RFC compatibility fixes

quic-go 0.66 squashes real-world network bugs: handshakes with certificate chains over 16 KiB no longer fail with CRYPTO_BUFFER_EXCEEDED, and fixes land for send-queue stalls, leaked reset streams, duplicate DATAGRAM frames, CONNECTION_CLOSE panics on 32-bit systems, and RESET_STREAM_AT/0-RTT issues.

ECN (Explicit Congestion Notification) is also fixed: after a network change, ECN is re-validated so stale marks don't throttle the new path. The HTTP/3 server gains ReadHeaderTimeout.

// Set a header read timeout on the HTTP/3 server
srv := &http3.Server{
    Addr:              ":443",
    Handler:           mux,
    ReadHeaderTimeout: 5 * time.Second,
}

Idle connections also use less memory by freeing crypto streams and keys. Watch three breaking changes: HTTPStreamer.HTTPStream now returns only *Stream without auto-sending headers (call http.NewResponseController(w).Flush()), HTTP Datagrams outside Extended CONNECT fail with H3_DATAGRAM_ERROR, and tokens/tickets are now bound to the QUIC version (old 0-RTT tickets are rejected).

oapi-codegen 2.9: updates for Go OpenAPI client and server generation

Composite allOf/anyOf/oneOf schemas often silently picked one conflicting field. oapi-codegen 2.9 adds v3 mode (docs), which follows OpenAPI more strictly and reports conflicts explicitly; it will become the default in the next release.

It also adds OpenAPI 3.2 (QUERY method and additionalOperations), output-options.naming, templated output-options.struct-tags (db, validate, yaml), and vendor media type mapping in output-options.content-types.

# Opt in to strict v3 schema merging early
compatibility:
  schema-merging-behavior: v3
# Customize enum names and explicit identifiers
output-options:
  naming:
    enum-values:
      keep-underscores: true
    explicit-names: verbatim

The release requires Go 1.26+ and github.com/oapi-codegen/runtime v1.9.1+, and bundles security fixes from v2.8.1/v2.8.2. When upgrading from <= v2.6.0, regenerate your code before bumping runtime—the strictmiddleware packages have been removed.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 7