Skip to content

fix(mmx-octopus): cross-session awareness is off by default and really stops collecting (v1.10.0) - #138

Merged
MyPrototypeWhat merged 4 commits into
MiniMax-AI:mainfrom
antianqi:fix/marketplace-v1910
Nov 18, 2026
Merged

MyPrototypeWhat merged 4 commits into
MiniMax-AI:mainfrom
antianqi:fix/marketplace-v1910

Conversation

@antianqi

@antianqi antianqi commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What the review found

Two problems in this package, both confirmed against the code (not just read off the issue):

  1. petAware defaulted to true. The cross-session feature was on for every new install.
  2. Turning it off did not stop collection. The setting only gated the prompt injection —
    observe({all: true}) and sessions() 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:

  1. Upgrading kept the old true. 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 — the saved value does
    not show that the user ever enabled collection.

What changed

  • petAware now defaults to false (miniapp/node/state.mjs).
    setPetAware() only turns it on for an explicit true; undefined counts as off.
  • When it is off, collection really stops (miniapp/node/observe.mjs):
    the observe subscription is aborted, the board polling timer is cleared, and the
    cross-session data already on screen is wiped. The same guard is used in
    scheduleObserve(), scheduleBoard() and restartObserve() — one place, so it cannot drift.
  • Upgrading resets the switch unless the user opted in (miniapp/node/state.mjs).
    The rule lives in one pure function, migratePetAware():
    • only a saved petAwareOptIn marker counts as an explicit opt-in, and that marker is
      written only by setPetAware(true) — i.e. by the user clicking the switch in the panel;
    • every older state (1.9.0 and earlier, no marker) is reset to off, even when it
      contains petAware: true; the panel keeps a "please turn it on again" note until the
      user turns it on, and both READMEs have an "Upgrading from 1.9.0" section saying so;
    • setPetAware(false) withdraws the opt-in again;
    • the migrated state is written back to disk, so the old true cannot be read back as a
      choice on the next start.
  • The panel now shows the switch as off by default and says so.
  • README.md / README.zh-CN.md disclose what is read, how it is used, that it is
    off by default since 1.10.0, and that the minimum client version is now 3.1.6.
  • Version bumped to 1.10.0 (behaviour change).

Tests

The scenarios live in tests/petaware-scenarios.mjs and are shipped with the package:

node --test tests/petaware-default-off.test.mjs

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:

  • start from a legacy state.json with petAware: true
  • after the upgrade the switch is off, and no observe and no sessions() call happens
  • the panel keeps the "please turn it on again" note
  • turning it on in the panel starts collection again, and the opt-in survives a restart
  • a legacy state that never had the field at all is off as well

Three 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 node directory, 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

  • The shipped test passes; with the guard removed, the default flipped back on, or the
    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).
  • Our full internal self-check: 914 checks, 0 failures.
  • The repository's own checks pass (npm test 87/87, npm run validate).

…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.

Copy link
Copy Markdown
Collaborator

One upgrade case still blocks merging at f41a034: an existing state.json with petAware: true retains that value after upgrading, so cross-session collection continues without a new opt-in.

Version 1.9.0 could persist true as the default. That saved value alone does not establish that the user explicitly enabled collection. The new default and off-switch behavior address new installs and explicit disabling, but not this upgrade case.

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 state.json with petAware: true. After upgrade, assert that the setting is off and no observe or sessions() calls occur until explicit opt-in, then verify that enabling it starts collection.

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.
@antianqi

Copy link
Copy Markdown
Contributor Author

Fixed in 2cf4843 — good catch, and you are right about the reasoning: 1.9.0 persisted true because that was its default, so the saved value proved nothing about the user's choice.

Migration (miniapp/node/state.mjs — one pure function, migratePetAware(), is the only place that holds the rule):

  • a saved petAwareOptIn marker is the only thing that counts as an explicit opt-in, and it is written only by setPetAware(true) — i.e. by the user clicking the switch in the panel;
  • every older state (1.9.0 and earlier, no marker) is reset to off, even when it contains petAware: true. The panel then keeps a "please turn it on again" note until the user turns it on, and both READMEs have an "Upgrading from 1.9.0" section saying exactly this;
  • setPetAware(false) withdraws the opt-in again;
  • the migrated state is written back to disk, so the old true cannot be read back as a choice on the next start.

Regression test — the one you asked for, in tests/petaware-scenarios.mjs (shipped with the package; run it with node --test tests/petaware-default-off.test.mjs):

  • start from a legacy state.json with petAware: true;
  • after the upgrade the switch is off, and no observe and no sessions() call happens — the scenarios run a real server against a mock host and count the calls;
  • the panel keeps the "please turn it on again" note;
  • turning it on in the panel starts collection again, and the opt-in survives a restart;
  • a legacy state that never had the field is off as well.

A third negative injection puts the old read-back rule back into the migration — into a copy of the whole node directory, so the broken server is the one that runs — and asserts that the criterion turns red. With that injection the shipped test fails within seconds and names the broken assertions; with the real code it is green.

Copy link
Copy Markdown
Collaborator

Follow-up on head 2cf4843. The upgrade-migration blocker we reported on f41a034 is resolved. A legacy state.json with petAware: true and no explicit opt-in is reset to off, written back, and stays off across a restart until the user enables awareness again.

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.

@MyPrototypeWhat
MyPrototypeWhat merged commit 097f319 into MiniMax-AI:main Nov 18, 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