.agents/skills/runtime-behavior-probe/references/redis-runtime-patterns.md
Use this reference for recurring ioredis investigations so you do not have to rediscover the probe strategy each time. Treat the repository source as the truth for client behavior, and use redis.io/commands to confirm contract-sensitive details such as argument order, reply types, and version availability. If you rely on the website rather than source, say so in the report.
WRONGTYPE, MOVED, ASK, CROSSSLOT, NOSCRIPT, or LOADING.Do not read these variables automatically. Before a live probe uses any of them, tell the user the exact variable names you plan to read and why each one is needed, then wait for explicit approval. Never print their values:
REDIS_URLREDIS_PASSWORDREDIS_TLS_CA, REDIS_TLS_CERT, REDIS_TLS_KEY (and any other REDIS_TLS_* the probe needs)For most local probes you do not need any of these. ioredis repository instructions assume a Redis server with the correct version is running on the default host and port. Prefer that local Redis server over a live remote service unless the question is specifically about the remote deployment.
If the task targets another integration, use that integration's expected default variable names under the same rule.
Before attributing a failure to the patch or client code under review, exclude source-selection and environment problems with a controlled comparison.
built, another checkout, /tmp/node_modules, or an installed ioredis package does not prove current lib behavior.built is the subject. Otherwise prefer current-source lib/ imports so stale build output cannot create a false result.In the final report, distinguish code failures, unsupported configurations, environment blockers, and inconclusive probes. Do not collapse them into one failed-test count.
Start from the uncertainty instead of from the full client surface. The patterns below cover the runtime questions that recur most often in ioredis.
Use when the uncertainty is what a command returns at runtime.
Map, arrays, null, buffers, strings, or numbers.Use when key routing, slot ownership, or topology matters.
MOVED or ASK redirect occurred. Probe multi-key commands across keys in different slots to observe CROSSSLOT behavior and any client-side slot checks.{tag}) to force keys into the same slot when the probe needs a multi-key command to succeed.Use when delivery semantics or resubscription matter.
PSUBSCRIBE) and channel subscribers as expected.SSUBSCRIBE and SPUBLISH) in cluster, capture which shard delivered the message.Use when the question is about resilience.
Use when batching or atomicity is under test.
MULTI/EXEC, capture queueing errors versus execution errors, behavior on DISCARD, and WATCH optimistic-locking aborts (EXEC returning null).Use when push-message routing or subscribed connection behavior matters.
Use for BLPOP, BRPOP, XREAD BLOCK, WAIT, and similar.
Use when same-tick batching, offline queue behavior, or command queue ordering is involved.
Use for SCAN, HSCAN, SSCAN, and ZSCAN.
COUNT and MATCH behave as expected. Note that SCAN gives no count or completeness guarantees mid-iteration.Use when size or latency is the concern.
For ioredis probes, try to record:
null, empty, or transformed by the client.Do not spend time rediscovering static documentation unless the runtime result seems to contradict what you expected. The value of this skill is in the observed behavior.