Skip to content

[Bug] mavis memory daily-update returns 40002 due to JS object key mismatch (agent_name vs agentName) #66

Closed as not planned

Description

@seasonmsg

[MiniMax Code Bug Report] mavis memory daily-update <agentId> returns 40002 due to JS object key mismatch

Submit to: MiniMax-AI/minimax-code Issues → 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.js lives in Program 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.js after a source build (offset varies across versions in the esbuild bundle).

For MiniMax Maintainers

  • The fix is a single character: change agent_name to agentName (snake_case to camelCase) in the object literal.
  • The daemon-side API contract uses camelCase agentName consistently — 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

Activity

  1. added
    bugSomething isn't working
    desktopMiniMax Code desktop app
    needs-triageAwaiting maintainer assessment
    and removed
    desktopMiniMax Code desktop app
    on Sep 19, 2026
  2. hetaoBackend commented on Sep 21, 2026

    @hetaoBackend
    Collaborator

    This was generated by AI during triage.

    Thanks for the precise diagnosis — the agent_name vs agentName mismatch trace is exactly the kind of report we can act on.

    This was filed against a June build; the CLI/daemon API surface has been reworked substantially since then (the mavis CLI itself was restructured). Could you retest memory daily-update on the latest build? If it still fails, please share the current version string and we'll fix the field mapping directly.

  3. added
    needs-infoWaiting for specific information requested from the reporter
    and removed
    needs-triageAwaiting maintainer assessment
    on Sep 21, 2026
  4. hetaoBackend commented on Oct 19, 2026

    @hetaoBackend
    Collaborator

    Closing as part of a backlog cleanup: this issue was filed more than a month ago against an older release, and the codebase has changed substantially since then. If it still reproduces on the latest version, please open a new issue with the current version and reproduction steps. Thank you for the report!

    批量清理积压:该 issue 创建已超过一个月,针对的是较旧版本,代码已有较大变化。如果在最新版本上仍能复现,欢迎附上当前版本号和复现步骤重新提交 issue。感谢反馈!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdesktopMiniMax Code desktop appneeds-infoWaiting for specific information requested from the reporter

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions