Repository navigation
Document the RESP3 attribute type in the protocol spec - #510
Merged
Merged
Conversation
protocol.md never described the attribute type (`|`), and the module API reference links to /topics/protocol#attribute-type, an anchor that has never existed on this page. That link is generated from src/module.c at the 9.1.0 tag, so it stays in modules-api-ref.md until the next release picks up the fixed comment from valkey-io/valkey#4845. Add an Attributes section with the attribute-type anchor, and a row in the RESP type table. The encoding, the example, and the RESP2 behavior come from addReplyAttributeLen, DEBUG PROTOCOL attrib, and ValkeyModule_ReplyWithAttribute in Valkey. Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
zuiderkwast
approved these changes
Oct 26, 2026
zuiderkwast
left a comment
Contributor
There was a problem hiding this comment.
Yes.
We may be able to use attributes for client opt-in stuff like compression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The module API reference links to
/topics/protocol#attribute-type, but protocol.md has never documented the RESP3 attribute type (|), so that anchor doesn't exist. It is the one remaining failure in valkey-io/valkey-io.github.io#694's internal-links check. The link is generated fromsrc/module.cat 9.1.0, so it can't be fixed in modules-api-ref.md. This adds an Attributes section with that anchor, and a row in the type table, based on what Valkey sends on RESP3 and RESP2 connections.AI generated details
Problem
topics/modules-api-ref.md:1641links tohttps://valkey.io/topics/protocol#attribute-type. The link came from valkey-io/valkey#433 (472c1ca26, first in 8.0.0), which pointed theVM_ReplyWithAttributecomment at valkey.io instead ofantirez/RESP3/blob/master/spec.md#attribute-type. protocol.md never had that anchor, andgit log -S'ttribute' -- topics/protocol.mdis empty.modules-api-ref.md is regenerated from
src/module.catVERSION ?= 9.1.0, andcheck-modules-api-ref.ymlfails on hand edits. valkey-io/valkey#4845 drops the anchor frommodule.con unstable, so the link goes away at the next release. The type stays undocumented either way.Alternative considered
A bare
<a name="attribute-type"></a>on an existing section fixes the check, but it sends readers to a page that doesn't describe the type. Documenting the type costs one short section.What the section is based on
Line numbers are at the 9.1.0 tag. The attribute code is the same on unstable.
|<count>\r\nthencountkey/value pairs, encoded like a mapaddReplyAttributeLen,networking.c:1415-1417. Valkey parses it aslenentries of 2 elements,call_reply.c:220debug.c:854.callReplyAttributeparses the attribute, then the reply, and attaches the attribute to it,call_reply.c:213-230parseReplydispatch,call_reply.c:201.EXECproduces one (see Testing)DEBUG PROTOCOL attribsends only the bulk stringdebug.c:847ValkeyModule_ReplyWithAttributereturnsVALKEYMODULE_ERRmodule.c:3400. Blocked-client and thread-safe contexts copy the real client'sresp,module.c(unstable) 8571 and 9409The anchor uses
<a name>, likepush-event,nil-replyandbig-number-replyon the same page. lychee 0.24.2, which #694 uses, acceptsname=anchors. In a two-page test site,#attribute-typepassed against<a name="attribute-type">in both relative andhttps://valkey.io/form, and only a missing anchor was flagged.Testing
Raw replies from
valkey-serverat valkey-io/valkey7db2df1f7, captured withnc, with each line's\r\nmade visible:The site was built at valkey-io/valkey-io.github.io#694 head
9254bbacwith the same content layout as itsbuild-siteaction, and then checked with itsbuild/broken-links.sh. Without this change:With it:
The site was built with Zola 0.21.0. #694's
build-siteaction useszola-deploy-action@v0.22.0. The`\|`table cell renders as<code>|</code>.This was generated by AI but verified, with love, by a human.