Repository navigation
fix(mmx-octopus): cross-session awareness is off by default and really stops collecting (v1.10.0) - #138
Conversation
…y stops collecting (v1.10.0) The marketplace review (issue MiniMax-AI#136) found two real problems, and both were ours: - petAware defaulted to true. A privacy-sensitive cross-session feature has to be off by default, so a fresh install now starts with it off and the user turns it on themselves. - Turning it off only stopped the summary from reaching the prompt; the collection kept going. observe({all:true}) and sessions() were still called. The switch now reaches the collection layer: while it is off the package does not subscribe to session events, does not list sessions, and does not put anything about other sessions into her prompt. Turning it off at runtime aborts the subscription, stops the board timer and clears what the board had already shown. A restart keeps it off. Also: the README said the package needs MiniMax Code 3.1.5; it needs 3.1.6. Version 1.9.0 -> 1.10.0.
|
One upgrade case still blocks merging at Version 1.9.0 could persist Please add a migration that keeps collection off unless the user has explicitly opted in. If the old state cannot distinguish an explicit choice from the old default, reset it to off and ask the user to enable it again. Please also add a regression test starting from a legacy This is the remaining blocker for the cross-session collection part of issue #136. |
… user opted in The marketplace review (2026-11-17) pointed out that an existing state.json with petAware: true kept that value after upgrading, so cross-session collection continued without a new opt-in. 1.9.0 persisted true because that was its default, and a saved true does not show that the user ever enabled collection. - state.mjs: new pure function migratePetAware() is the single place holding the rule. Only a saved petAwareOptIn marker counts as an explicit opt-in; older states are reset to off and the panel keeps a "please turn it on again" note. setPetAware(true) is the only place that records the opt-in; setPetAware(false) withdraws it. The reset is written back to disk so the old true cannot be read back as a choice. - client: the panel shows the upgrade note while the switch is reset. - tests: the regression the review asked for, in the shared scenario module that the bundled test and the internal self-check both run: start from a legacy state.json with petAware: true, assert the switch is off and that no observe or sessions() call happens, then assert that turning it on starts collection and that the opt-in survives a restart. Plus a negative injection that puts the old read-back rule back and must turn the check red. - README (both languages): the upgrade section says the switch is reset to off.
|
Fixed in 2cf4843 — good catch, and you are right about the reasoning: 1.9.0 persisted Migration (
Regression test — the one you asked for, in
A third negative injection puts the old read-back rule back into the migration — into a copy of the whole |
|
Follow-up on head We re-ran the package tests and checked migration persistence, restart, and opt-in. These checks used a real server against a mock Host, not Electron or a real Host. |
What the review found
Two problems in this package, both confirmed against the code (not just read off the issue):
petAwaredefaulted totrue. The cross-session feature was on for every new install.observe({all: true})andsessions()were still called on every request.Collecting-but-not-using is not the same as not collecting.
A third one was raised in the review on 2026-11-17 and is fixed in the latest commit:
true. An existingstate.jsonwithpetAware: truekept that value after upgrading, so cross-session collection continued without a new
opt-in. 1.9.0 persisted
truebecause that was its default — the saved value doesnot show that the user ever enabled collection.
What changed
petAwarenow defaults tofalse(miniapp/node/state.mjs).setPetAware()only turns it on for an explicittrue;undefinedcounts as off.miniapp/node/observe.mjs):the
observesubscription is aborted, the board polling timer is cleared, and thecross-session data already on screen is wiped. The same guard is used in
scheduleObserve(),scheduleBoard()andrestartObserve()— one place, so it cannot drift.miniapp/node/state.mjs).The rule lives in one pure function,
migratePetAware():petAwareOptInmarker counts as an explicit opt-in, and that marker iswritten only by
setPetAware(true)— i.e. by the user clicking the switch in the panel;contains
petAware: true; the panel keeps a "please turn it on again" note until theuser turns it on, and both READMEs have an "Upgrading from 1.9.0" section saying so;
setPetAware(false)withdraws the opt-in again;truecannot be read back as achoice on the next start.
README.md/README.zh-CN.mddisclose what is read, how it is used, that it isoff by default since 1.10.0, and that the minimum client version is now 3.1.6.
Tests
The scenarios live in
tests/petaware-scenarios.mjsand are shipped with the package:They start a real server against a mock host and count the actual
observe/sessions()calls — they do not grep the source. They cover the cases the review named:first launch, toggling the switch and restarting — plus the upgrade case:
state.jsonwithpetAware: trueobserveand nosessions()call happensThree of them are negative injections: they break a copy of the production code
(remove the guard / flip the default back on / put the old read-back rule back into the
migration) and assert that the criterion catches it. The last one is injected into a copy
of the whole
nodedirectory, so the broken server is the one that actually runs.A test that cannot fail proves nothing.
The same implementation backs our own internal self-check, so the two cannot disagree.
Verified
migration rule put back to the old read-back behaviour, it fails within seconds and
names the broken assertions (the scenario runner is a child process with a timeout, so a
broken build reports a failure instead of hanging CI).
npm test87/87,npm run validate).