Skip to content

fix(mmx-octopus): keep every write inside the package's own dataDir, make idle talk opt-in (v1.7.0) - #103

Merged
MyPrototypeWhat merged 2 commits into
MiniMax-AI:mainfrom
antianqi:fix/marketplace-v170
Nov 3, 2026
Merged

MyPrototypeWhat merged 2 commits into
MiniMax-AI:mainfrom
antianqi:fix/marketplace-v170

Conversation

@antianqi

@antianqi antianqi commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the Marketplace review of 1.6.0: the three required fixes, the strong recommendation, and the version bump the review asks for.

Must fix 1 - exampleQueries over the limit

.minimax-plugin/plugin.json had 4 exampleQueries; the limit is 3. Now 3.

Must fix 2 - writes outside the package's own dataDir

The review found two places where this package wrote files outside context.dataDir:

  • it rewrote the displayName: line in the frontmatter of the agent.md of the agent that has this Mini App installed;
  • it wrote an AGENTS.md into the workspace directory of the agent session the Host resolved for her.

Both are removed, not patched:

  • miniapp/node/displayname.mjs and miniapp/node/ownership.mjs are deleted, so the runtime keeps no path to a Host file at all;
  • ensureIdentityFile() and the state.identityFileReady split are gone - there is no "write the identity file, otherwise fall back" branch left;
  • the only places the runtime writes are the four JSON files under context.dataDir (state.json, chat.json, diary.json, style.json), all through writeJsonAtomic;
  • her identity (who she is, what she looks like, her rules) now travels inside the message, every turn: readIdentityFallback() reads the three sections of this package's own miniapp/node/identity/AGENTS.md, assembleChatInput() puts them into the chat input, and the four non-chat turns (idle talk, diary, diary reply, style learning) go through the new withIdentity();
  • writeTextAtomic() now has zero call sites in production code - the only atomic text write that existed was the one that wrote to the Host.

The self-check asserts the negative now: no module under miniapp/node/ mentions the Host's agent.md or AGENTS.md, no module does a text write, the write targets are exactly those four JSON files, and 8 negative injections (writing to the Host's agent.md, a text write in another module, the identity split coming back, idle talk defaulting back to on, ...) all turn the assertions red.

Trade-offs, stated plainly:

  • the identity layer now lives in the conversation, so the Host's context compaction may drop it - that is why it is sent again on every turn;
  • the name in the Host's agent list no longer follows the name set in the panel. The panel and her messages still use the name you set; the Host's own agent list keeps whatever it shows.

Both READMEs are updated: the sections about writes outside dataDir are gone, the identity path is described as it is now, and there is a note that an install upgrading from an earlier version may still have the old AGENTS.md on disk and can delete it. The runtime never touches that file, because a plugin must not write outside its own data directory.

Must fix 3 (strong recommendation) - idle talk defaulted to on

It now defaults to off: state.idleTalk starts false, the panel's switch starts on "off", and setIdleTalk() only turns it on for an explicit true. The compile-time switch in idletalk.mjs is renamed IDLE_TALK_AVAILABLE so it can no longer be read as a default-on flag - it only says the feature exists. Once a user turns it on, the behaviour is unchanged (20 minutes of quiet, at most 2 turns an hour, at least 45 minutes apart).

The review's notes

  • session.read is kept. It is what lets the runtime read a turn's title, running state and final reply, so it can tell whether the Agent is thinking or has finished and can summarise the turn. Dropping it would also break the read of her own session in ensurePetSession(), which runs inside a try/catch and would degrade to "keep using the session as it is". The cost of keeping it is the 3.1.5+ requirement the review mentions.
  • The package size (~31 MB, 94 webm clips) is unchanged. Shrinking the clips means re-encoding published assets; that is a separate change and was not part of this fix.
  • The interface is still Chinese only. This package is Chinese-first by design; recording it here so it is not read as an oversight.

Self-check

841 assertions, 0 failures, on the source tree. The new group adds 18 assertions, 8 of them negative injections.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…make idle talk opt-in (v1.7.0)

Marketplace review of 1.6.0. Three required fixes, one strong recommendation,
and the version bump the review asks for.

Must fix 1 - exampleQueries must have at most 3 entries: 4 -> 3.

Must fix 2 - the package wrote files outside its own dataDir, in two places:
it rewrote the displayName line in the Host agent's agent.md, and it wrote
AGENTS.md into the workspace of the agent the Host resolved for her. Both are
gone rather than patched: displayname.mjs and ownership.mjs are deleted, the
runtime keeps no path to a Host file at all, and the only places it writes are
the four JSON files under context.dataDir. Her identity now travels inside the
message every turn (readIdentityFallback -> assembleChatInput, and the idle
talk / diary / diary reply / style turns go through withIdentity()).

Must fix 3 (strong recommendation) - idle talk now defaults to off. The
state.idleTalk default is false, the panel's switch starts on "off", and the
compile-time switch in idletalk.mjs is renamed IDLE_TALK_AVAILABLE so it no
longer reads like a default-on flag. Users turn it on themselves.

Both READMEs are updated: the sections about writes outside dataDir are gone,
the identity path is described as it is now, and idle talk is documented as
opt-in.

Self-check: 841 assertions, 0 failures (new group, 18 assertions, 8 negative
injections).
…ions

Versions before 1.7.0 wrote an AGENTS.md into the workspace of the agent that
has this Mini App installed. 1.7.0 no longer writes it and no longer needs
it, but an upgraded install may still have the old file on disk. Both READMEs
now say so, and say that the runtime never touches it, because a plugin must
not write outside its own data directory.

The leftover is a machine projection of this package's own identity file, not
something the user wrote, so it is safe to delete.

@MyPrototypeWhat MyPrototypeWhat left a comment

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.

Approving. Thanks for the cleanup. Dropping the extra file writes is the simplest fix.

Verified

  • Every write goes through writeJsonAtomic() to chat.json, diary.json, state.json or style.json under context.dataDir.
  • Nothing writes agent.md or AGENTS.md anymore. The identity comes from the package's own miniapp/node/identity/AGENTS.md.
  • Idle talk is off by default (state.mjs:352), runs only when the switch is on (server.mjs:743), and saves as off unless set to true.
  • Both READMEs match the new default and still list what goes to the model, plus the quota note.
  • Version is 1.7.0 in plugin.json, package.json and both READMEs.
  • npm run check passes (87 tests).

Optional

  • 1.4.0 to 1.6.0 saved idleTalk: true in state.json, so upgraders keep idle talk on. To make it opt-in for everyone, reset that value once on upgrade, or note it in the README.

@MyPrototypeWhat
MyPrototypeWhat merged commit c4bfe68 into MiniMax-AI:main Nov 3, 2026
1 check passed
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.

2 participants