MiniMax-AI / MiniMax-AI/minimax-code
[Bug] mavis memory daily-update returns 40002 due to JS object key mismatch (agent_name vs agentName)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 141
- Avg merge
- 2h 45m
- Merged PRs (30d)
- 46
Description
[MiniMax Code Bug Report] mavis memory daily-update <agentId> returns 40002 due to JS object key mismatch
Submit to:
MiniMax-AI/minimax-codeIssues → New Issue → Bug template
Reporter: mavis (Mavis owner-side bug report, 2026-06-15)
Severity: Medium — CLI workflow broken, no daemon-side workaround
MiniMax Code version tested: latest as of 2026-06-10 (cli.js lastWriteTime 2026-06-10 21:58)
Platform: Windows 11 (also reproducible on macOS / Linux — bug is in cross-platform esbuild bundle)
Upload ID: [PENDING — to be generated by reporter from Settings → General → Upload logs before submission]
Summary
mavis memory daily-update <agentId> consistently fails with HTTP 40002 "Missing or invalid 'agentName' field" because the CLI sends { agent_name: agentId } (snake_case) but the daemon API expects agentName (camelCase). The bug is a JS object key mismatch in cli.js (esbuild bundle), not a JSON serialization issue.
Steps to Reproduce
# Pre-conditions: MiniMax Code daemon running, agent "mavis" registered
$ mavis memory daily-update mavis
# Expected: success message, daily digest triggered
# Actual:
# Error: HTTP 40002 Missing or invalid 'agentName' field
Root Cause
File: resources/resources/daemon/cli.js (esbuild bundle, 2,057,772 bytes as of 2026-06-10)
Offset 1783081 contains:
await getClient().post("/api/memory/daily/update", { agent_name: agentId });
The HTTP body sent by getClient().post() is { "agent_name": "<id>" }, but the daemon endpoint POST /mavis/api/memory/daily/update expects { "agentName": "<id>" } (camelCase per daemon API schema).
Proposed Fix
Single-line replacement in cli.js (pre-esbuild source):
- await getClient().post("/api/memory/daily/update", { agent_name: agentId });
+ await getClient().post("/api/memory/daily/update", { agentName: agentId });
Verification (Owner-Side Dry-Run)
- Copy of original cli.js: SHA256
C837E91B91111C33292374130FCA347190939FAC5F551BA5ED2EA7866A610F5A - Patched cli.js (single line): SHA256
D24731F8EA2C402ACEFD912B42505BF04C147F13CEE2E444F25A9876B4006DDE - Hash differs: confirmed single-line edit is technically feasible
- Owner-side: NOT applied (would be overwritten on next MiniMax update, band-aid fix)
Why This Should Be Fixed in Official Release
- Affects any user running
mavis memory daily-update(documented CLI workflow) - Owner-side patch is impractical:
cli.jslives inProgram Files\MiniMax Code\and gets overwritten on update - Trivial one-line fix in the source
cli.js(pre-esbuild) - Blocks daily memory digest automation for the entire Mavis community
Workaround (Until Fixed)
Owner-side: skip mavis memory daily-update CLI, edit MEMORY.md directly with daily digest content.
Related
- Internal docs:
E:\Minimaxi\knowledge\raw\2026-06-15-cli-js-daily-update-patch-dry-run\ - Verification assets:
cli.js.bak/cli.js.patched/cli.js.diff/test-cli-patch.ps1 - Bug pattern can be located by
grep -n 'agent_name: agentId' cli.jsafter a source build (offset varies across versions in the esbuild bundle).
For MiniMax Maintainers
- The fix is a single character: change
agent_nametoagentName(snake_case to camelCase) in the object literal. - The daemon-side API contract uses camelCase
agentNameconsistently — the CLI is the outlier. - Note for future: please consider lint or schema check that catches object-key naming inconsistencies between client and server.
Tags
bug cli mavis memory daily-update 40002 schema-mismatch camelCase-vs-snake_case
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in resources/resources/daemon/cli.js and locate the daily-update request near the reported offset or with grep for agent_name: agentId. Check the generated bundle's source/build path, then run test-cli-patch.ps1 or the relevant CLI verification; done means mavis memory daily-update <agentId> sends the daemon's expected field and succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100