Repository navigation
fix(mmx-octopus): keep every write inside the package's own dataDir, make idle talk opt-in (v1.7.0) - #103
Merged
Conversation
…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
approved these changes
Nov 3, 2026
MyPrototypeWhat
left a comment
Collaborator
There was a problem hiding this comment.
Approving. Thanks for the cleanup. Dropping the extra file writes is the simplest fix.
Verified
- Every write goes through
writeJsonAtomic()tochat.json,diary.json,state.jsonorstyle.jsonundercontext.dataDir. - Nothing writes
agent.mdorAGENTS.mdanymore. The identity comes from the package's ownminiapp/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.jsonand both READMEs. npm run checkpasses (87 tests).
Optional
- 1.4.0 to 1.6.0 saved
idleTalk: trueinstate.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 -
exampleQueriesover the limit.minimax-plugin/plugin.jsonhad 4exampleQueries; 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:displayName:line in the frontmatter of theagent.mdof the agent that has this Mini App installed;AGENTS.mdinto the workspace directory of the agent session the Host resolved for her.Both are removed, not patched:
miniapp/node/displayname.mjsandminiapp/node/ownership.mjsare deleted, so the runtime keeps no path to a Host file at all;ensureIdentityFile()and thestate.identityFileReadysplit are gone - there is no "write the identity file, otherwise fall back" branch left;context.dataDir(state.json,chat.json,diary.json,style.json), all throughwriteJsonAtomic;readIdentityFallback()reads the three sections of this package's ownminiapp/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 newwithIdentity();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'sagent.mdorAGENTS.md, no module does a text write, the write targets are exactly those four JSON files, and 8 negative injections (writing to the Host'sagent.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:
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.mdon 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.idleTalkstartsfalse, the panel's switch starts on "off", andsetIdleTalk()only turns it on for an explicittrue. The compile-time switch inidletalk.mjsis renamedIDLE_TALK_AVAILABLEso 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.readis 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 inensurePetSession(), which runs inside atry/catchand would degrade to "keep using the session as it is". The cost of keeping it is the 3.1.5+ requirement the review mentions.Self-check
841 assertions, 0 failures, on the source tree. The new group adds 18 assertions, 8 of them negative injections.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.