Skip to content

Added custom Claude command + XNACK command support#4030

Draft
vladvildanov wants to merge 8 commits intomasterfrom
vv-xnack-support
Draft

Added custom Claude command + XNACK command support#4030
vladvildanov wants to merge 8 commits intomasterfrom
vv-xnack-support

Conversation

@vladvildanov
Copy link
Copy Markdown
Collaborator

@vladvildanov vladvildanov commented Apr 9, 2026

Description of change

This PR contains:

  1. New custom Claude command that enrich agent with necessary context and provides a clear guideline on how to add a support for given Redis command. Also it contains a command specification template to be used to provide custom command specification.
  2. Support for XNACK command fully added using new Claude command.
  3. Update to CONTRIBUTING.md about AI agent contributions.

Execute new command via CLI interface:

Augment CLI

auggie command add-new-command $path_to_specification

Claude CLI

claude /add-new-command $path_to_specification

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

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 XNACK command to the core client API (sync + asyncio), including validation for required IDs, allowed mode values, and optional RETRYCOUNT/FORCE arguments.

Extends the integration test suite (sync and asyncio) to cover XNACK behavior and error cases, gated to Redis >= 8.8.0.

Introduces contributor-facing AI workflow docs: a .claude command-spec template and an add-new-command skill, plus a CONTRIBUTING.md section 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.

@vladvildanov vladvildanov marked this pull request as draft April 9, 2026 12:06
@vladvildanov vladvildanov requested a review from Copilot April 9, 2026 12:09
@jit-ci
Copy link
Copy Markdown

jit-ci bot commented Apr 9, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread redis/commands/core.py
if force:
pieces.append(b"FORCE")

return self.execute_command("XNACK", *pieces)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fee6e93. Configure here.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() to redis/commands/core.py (sync + asyncio typing overloads) with argument validation and command assembly.
  • Add integration tests for XNACK behavior 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.

Comment thread redis/commands/core.py
Comment thread CONTRIBUTING.md Outdated
Comment thread specs/redis_commands_guide.md Outdated
Comment thread specs/redis_commands_guide.md Outdated
Comment thread specs/redis_commands_guide.md Outdated
Comment thread .claude/commands/add-new-command.md Outdated
Comment thread .claude/command-specification-template.md Outdated
vladvildanov and others added 6 commits April 9, 2026 15:45
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The r type hint should also allow RedisCluster

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants