Added custom Claude command + XNACK command support#4030
Added custom Claude command + XNACK command support#4030vladvildanov wants to merge 8 commits intomasterfrom
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fee6e93. Configure here.
| if force: | ||
| pieces.append(b"FORCE") | ||
|
|
||
| return self.execute_command("XNACK", *pieces) |
There was a problem hiding this comment.
XNACK is a non-existent hallucinated Redis command
High Severity
XNACK is not an actual Redis command — it's an unimplemented feature request (redis/redis#5934, opened 2019, still labeled "needs-design"). The command's syntax, modes (SILENT, FAIL, FATAL), IDS count format, RETRYCOUNT, and FORCE options all appear to be AI-fabricated. Redis 8.8.0 (used in @skip_if_server_version_lt) doesn't exist either; the latest release is 8.6. This adds non-functional dead code that will always fail against any real Redis server.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit fee6e93. Configure here.
There was a problem hiding this comment.
Pull request overview
Adds contributor tooling/docs for AI-assisted command additions and implements Redis Streams XNACK support in the core client API, along with new sync/async integration tests gated on Redis >= 8.8.0.
Changes:
- Add
xnack()toredis/commands/core.py(sync + asyncio typing overloads) with argument validation and command assembly. - Add integration tests for
XNACKbehavior and error handling (sync + asyncio). - Add contributor documentation and Claude skill/template files for adding new Redis command support.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
redis/commands/core.py |
Adds xnack() command implementation and typing overloads. |
tests/test_commands.py |
Adds sync integration tests for XNACK (Redis >= 8.8.0). |
tests/test_asyncio/test_commands.py |
Adds asyncio integration tests for XNACK (Redis >= 8.8.0). |
specs/redis_commands_guide.md |
New guide describing command API/spec workflow and repo structure. |
CONTRIBUTING.md |
Documents AI-driven contribution workflow and available CLI commands. |
.claude/commands/add-new-command.md |
New Claude “skill” instructions to add command support from a spec. |
.claude/command-specification-template.md |
New template for authoring command specifications. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| ## Protocols compatibility | ||
|
|
||
| SDK supports two types of Redis wire protocol: RESP2 and RESP3. And aims to provide a compatibility between them | ||
| for seamless user experience. However, there are some differences in types that defined by these protocols. |
There was a problem hiding this comment.
types that defined --> types that are defined
| SDK supports two types of Redis wire protocol: RESP2 and RESP3. And aims to provide a compatibility between them | ||
| for seamless user experience. However, there are some differences in types that defined by these protocols. | ||
|
|
||
| Because, RESP3 introduce new types that wasn't previously supported by RESP2, we're aiming for forward compatibility |
There was a problem hiding this comment.
types that wasn't --> types that weren't
| see `redis/_parsers/resp2.py` and `redis/_parsers/resp3.py`. | ||
|
|
||
| Parsers are responsible for RESP protocol parsing. However, protocols compatibility is achieved by 2nd layer | ||
| parsing as `response_callbacks` defined in `redis/_parsers/helpers.py` and can be extended/updated on client level. |
There was a problem hiding this comment.
For modules the callbacks are defined usually in module's utils.py file
| assert await r.xlen(stream) == 2 | ||
|
|
||
| @skip_if_server_version_lt("8.8.0") | ||
| async def test_xnack_silent(self, r: redis.Redis): |
There was a problem hiding this comment.
The r type hint should also allow RedisCluster
There was a problem hiding this comment.
The RC versions are usually coming with a little different version - for 8.8 we have 8.7.something. If we add these tests with this restriction, they won't actually get executed until we have a GA


Description of change
This PR contains:
CONTRIBUTING.mdabout AI agent contributions.Execute new command via CLI interface:
Augment CLI
Claude CLI
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Note
Medium Risk
Adds a new core Redis Streams command (
XNACK) with argument validation and new integration tests, which could affect client command coverage and behavior for stream consumers. Documentation-only additions for AI contribution workflows are low risk, but the command API change warrants a moderate review.Overview
Adds support for the Redis Streams
XNACKcommand to the core client API (sync + asyncio), including validation for required IDs, allowedmodevalues, and optionalRETRYCOUNT/FORCEarguments.Extends the integration test suite (sync and asyncio) to cover
XNACKbehavior and error cases, gated to Redis>= 8.8.0.Introduces contributor-facing AI workflow docs: a
.claudecommand-spec template and anadd-new-commandskill, plus aCONTRIBUTING.mdsection pointing contributors to available agent commands.Reviewed by Cursor Bugbot for commit fee6e93. Bugbot is set up for automated code reviews on this repo. Configure here.