New MSETEX command allows to set an expiration time with MSET (#3121)
commit ba58546 ↗ · valkey-io/valkey · · committed Mar 10, 2026 · +653−18 · base 1e2ca5ec5dd6
Agent prompt
what a new run launched now would send
Clients need to atomically set multiple string keys and apply one shared expiration (and optional NX/XX) in a single command, instead of pairing MSET with a separate EXPIRE (or looping SET). Add that command so it behaves like MSET for the values, with SET-style expiration/condition options applied to every key in the call.
Syntax:
MSETEX numkeys key value [key value ...] [NX | XX]
[EX seconds | PX milliseconds |
EXAT seconds-timestamp | PXAT milliseconds-timestamp | KEEPTTL]
Options (same meanings as SET):
- EX / PX — relative TTL in seconds / milliseconds
- EXAT / PXAT — absolute Unix expiry in seconds / milliseconds
- KEEPTTL — keep existing TTLs on the keys being set
- NX — set only if none of the keys already exist
- XX — set only if all of the keys already exist
Returns: integer 1 if all keys were set; 0 if NX/XX blocked the write (and no keys were modified). Reject invalid numkeys, arity/syntax, conflicting options, and invalid expire values consistently with existing string commands. Follow existing server conventions for expire handling, replica propagation of absolute expiry, keyspace notifications, and COMMAND GETKEYS metadata for the new command.
Interface contract — the change must expose exactly this surface:
Public command name must be MSETEX (lowercase msetex in the protocol), registered so COMMAND GETKEYS / GETKEYSANDFLAGS work; callable as: MSETEX <numkeys> <key> <value> [<key> <value> ...] [NX|XX] [EX <sec>|PX <ms>|EXAT <sec-ts>|PXAT <ms-ts>|KEEPTTL]; reply is integer 0 or 1.
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_valkey_cba5854636996`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
Reference diff
The task commit's diff against its first parent — the judge's comparison target.