You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2c78f99
Browse filesBrowse the repository at this point in the historyBrowse files
fix(mmx-octopus): v1.9.0 - keep every write inside the plugin dataDir, let the user create their own mmx agent (#119)
* fix(mmx-octopus): keep every write inside the plugin's own dataDir (v1.9.0)
The official plugin marketplace rejected 1.8.0 because the plugin wrote into the
Host's agent directory (a new agent.md) - outside its own dataDir, without the
user asking for it, and never cleaned up on uninstall.
This version applies the official fix A: the capability is removed outright.
- Delete miniapp/node/agentprov.mjs (writes into the Host agent directory) and
miniapp/scripts/agentprov-cli.mjs (the manual CLI).
- Drop the "dedicated agent" tier: DEFAULT_AGENT_MODE / normalizeAgentMode /
SELF_AGENT_NAME, the Host agent-root probing, and the temporary probe session.
- Drop the POST /api/agent-mode route, the agentMode / agentStatus state fields
and the "which agent she uses" choice in the panel (settings and first-run card).
- Identity travels with every message again (withIdentity / assembleChatInput).
- Writes are limited to four JSON files under context.dataDir, atomically.
Reads are limited to package files, dataDir data and the Host agent list.
The plugin adds, changes and deletes no agent.
- Version 1.8.0 -> 1.9.0 (plugin.json / package.json / both READMEs).
Self-test: 857 checks, 0 failures (new group "round 48", 16 checks).
* feat(mmx-octopus): let the user create their own mmx agent (v1.9.0)
The marketplace offered two acceptable fixes for 1.8.0. The previous commit
applies fix A and removes the capability outright. This commit applies fix B:
guide the user to create the agent, and let the plugin only recognise it.
- Add miniapp/node/agentcard.mjs: a pure function that renders her character
sheet (reads the package's own identity/AGENTS.md and identity/PERSONA.md)
into an agent file the Host understands. It writes nothing at all.
- Add the read-only route POST /api/agent-card: returns that text plus
"found", a read-only probe of the Host agent list for an agent named mmx.
- Add a "复制她的设定" button and a short how-to in the panel settings:
copy the sheet, create an agent named mmx in the Host's Agent settings,
paste it, save. Creating it is optional.
- The agent name still has exactly one source: PET_AGENT_NAME in agentpick.mjs.
agentcard.mjs only imports it.
The plugin still writes no Host file: the user creates and deletes the agent,
the plugin only finds it and falls back to "carried with every message".
Docs: both market READMEs (What it does, Usage, Data & access, Known limits,
Upgrading from 1.8.0) describe the new flow.
Self-test: 871 checks, 0 failures (new group "round 49", 14 checks).
* fix(mmx-octopus): restore the agent default and drop the 1.8.0 agent name (v1.9.0)
Two fixes the marketplace reviewer asked for on PR #119.
- state.mjs: restore "this.petAgent = null" in the constructor. Removing the
"create a dedicated agent" mode took the initial value with it, so a fresh
install had undefined and the snapshot was missing a field the contract
declares as string or null.
- state.mjs: drop the agent name 1.8.0 left behind. agentpick.mjs now exports
LEGACY_SELF_AGENT_NAME ('mmx-octopus-agent'); when the state is loaded, a
stored value equal to it is discarded, so an upgraded user no longer gets a
session on that agent any more. Any other explicitly stored name is kept.
- Also removed a stale comment about the old default and fixed one badly
indented comment block.
The legacy name now appears exactly once in the package, and only as the value
to discard - never as something to create or to select.
Docs: both market READMEs note that a saved state still pointing at the old
agent is ignored by 1.9.0.
Self-test: 880 checks, 0 failures (new group "round 50", 9 checks).
The directory and the file are **new**; the Host picks it up without a
135
-
restart.
136
-
-**What is in it** — the same character sheet the plugin would otherwise
137
-
send with every message (who she is, what she looks like, her rules), plus
138
-
the frontmatter the Host expects (`name`, `description`, `displayName`).
139
-
-**What is never touched** — **no existing agent is modified and no other
140
-
file is written**: not your agents' `agent.md`, not the `AGENTS.md` of an
141
-
agent workspace, not your project files. If the name `mmx-octopus-agent` is
142
-
already taken by an agent that is not ours, the plugin **writes nothing and
143
-
does not use it** — she keeps working on an existing agent (that other
144
-
agent's file is never treated as ours).
145
-
-**How it is written** — atomically (temporary file, then a rename), one
146
-
write at a time, and only when the file does not exist yet: an existing
147
-
file is never overwritten, so there is nothing to back up.
148
-
-**How to remove it, or how to pick up a new version** — the file is
149
-
**never rewritten in place**, so after you upgrade the package the old
150
-
character sheet stays in it. Delete
151
-
`<Host agent directory>/mmx-octopus-agent/` and the runtime adds it again on
152
-
the next start, this time with the current version's sheet. If you would
153
-
rather not have this agent at all, pick "use an existing agent" in the
154
-
panel — the plugin then leaves it alone, and as long as you do not switch back to "create a dedicated agent" it will not be recreated.
155
-
Nothing else on your machine is affected.
156
-
-**How the directory is found — it is never guessed** — only from the
157
-
workspace of a session the plugin itself created: the Host sets that
158
-
workspace to the Mini App's own agent directory
159
-
(`<Host agent directory>/<agent>/miniapps/<plugin-id>`), and the plugin
160
-
takes its parent. It does **not** walk up the filesystem looking for a
161
-
folder called `agents` (a project of yours could contain one, and the
162
-
file would land in your project), and it does **not** derive the
163
-
directory from `context.dataDir`. If that one path does not identify the
164
-
directory, the plugin writes **nothing** and falls back to sending her
165
-
character sheet with every message, exactly as before.
166
-
-**One session of its own** — to learn that path the plugin may create one
167
-
session through the Host's Agent API. Such sessions belong to the plugin
168
-
and do **not** show up in your chat list; the plugin reuses that session
169
-
as hers instead of creating another one.
132
+
-**No file outside `context.dataDir`** — since 1.9.0 the runtime writes
133
+
**nothing else at all**: no agent file, nothing under the Host's agent
134
+
directory, nothing in your project. The only files it touches are the four
135
+
JSON files listed above.
136
+
-**No choice in the panel any more.** The 1.8.0 panel's two-way choice
137
+
("Which agent should she use" — "create a dedicated agent" vs "use an
138
+
existing agent") is gone, and so is the manual `agentprov-cli.mjs` command
139
+
that came with it. There is nothing left to switch.
140
+
-**Your own `mmx` agent, if you make one.** The panel's **「复制她的设定」**
141
+
button only hands you her character sheet as text — it writes nothing. You
142
+
paste it into a new agent named `mmx` in the Host's Agent settings; the
143
+
plugin then finds that agent through the Host's agent list and answers
144
+
with it, reading it only. Creating, editing and deleting that agent stay
145
+
yours; the plugin only ever reads the agent list.
146
+
-**It still reads the Host's agent list — read-only.** The plugin reads the
147
+
agents the Host exposes and, if you have an agent named `mmx`, that is the
148
+
one she answers with. Your agent is never modified and never written to.
149
+
With no `mmx` agent she falls back to the default agent.
150
+
-**Her character sheet travels with the message.** With no dedicated agent
151
+
to hold it, her identity (who she is, what she looks like, her rules) is
152
+
carried in the prompt of every turn — see "How her identity reaches her"
153
+
below.
170
154
-**Leftovers from earlier versions** — versions before 1.7.0 wrote an `AGENTS.md`
171
155
into the workspace of the agent that has this Mini App installed, to carry her
172
156
identity there. That is no longer written and no longer needed. If you are
173
157
upgrading from an earlier version the old file may still be there
174
158
(`agents/<agent>/miniapps/<plugin-id>/AGENTS.md`) and you can delete it — the
175
159
runtime never touches it, because a plugin must not write outside its own
176
-
data directory.
177
-
-**How her identity reaches her** — **twice, on purpose**. Her character
178
-
sheet (who she is, what she looks like, her rules) is read from this
179
-
package's own `miniapp/node/identity/AGENTS.md` and passed inside each
160
+
data directory. What 1.8.0 may have left behind is covered under
161
+
"Upgrading from 1.8.0" below.
162
+
-**How her identity reaches her** — **on every turn, in the message**. Her
163
+
character sheet (who she is, what she looks like, her rules) is read from
164
+
this package's own `miniapp/node/identity/AGENTS.md` and passed inside each
180
165
prompt, so it is never missing from a turn. Because that travels in the
181
166
conversation, the Host's context compaction may drop it — that is why it is
182
-
sent again every turn. Since 1.8.0 — and only once you pick "create a
183
-
dedicated agent" in the panel — the same sheet is also written into the
184
-
system prompt of the agent added above (the file disclosed above), which
185
-
survives compaction; if that file cannot be written, the per-turn copy
186
-
remains and nothing changes for you.
167
+
sent again every turn. Since 1.9.0 this is the only channel: the sheet is
168
+
no longer written into any agent file, so the per-turn copy is the one and
169
+
only copy.
187
170
-**Sessions read** — the package declares `session.read`. It reads the title,
188
171
the running state and the final reply of a turn, to tell whether the Agent is
189
172
thinking or has finished, and to summarise the turn. The board in the panel
190
173
lists the running sessions and refreshes every 30 seconds.
191
174
-**Agent turns it runs** — it declares `session.run`, and it runs **one Agent
192
175
turn per message you send her in the chat area**, in her own session. The
193
176
turn runs through the Host Agent, so it carries the capabilities the Host
194
-
grants that agent; it reads the Host's agent list to look for an agent
195
-
dedicated to the Mini App — in the default mode ("create a dedicated
196
-
agent") the one it adds itself comes first (see
197
-
above) and yours is only used when that one is not there; with neither, it
198
-
falls back to the default agent. If you pick "use an
199
-
existing agent" in the panel, only your own `mmx` is used (or the default agent when there is none),
200
-
and the one it could add is never touched. It never runs turns on your own sessions.- **Agent turns it starts on its own** — besides your messages, the runtime starts
177
+
grants that agent; it reads the Host's agent list and, if you have an agent
178
+
named `mmx`, that is the one it answers with (your agent is only read,
179
+
never modified); with no `mmx` agent it falls back to the default agent.
180
+
It never runs turns on your own sessions.
181
+
-**Agent turns it starts on its own** — besides your messages, the runtime starts
201
182
a few turns by itself, and **each of them uses your model quota**:
202
183
-**Idle talk** — **off by default**; turn it on in the panel: Settings →
203
184
「她没人的时候自己说话」 ("She talks when you are away"). Once on, after 20
@@ -229,13 +210,41 @@ it like the rest of the port.
229
210
-**State location** — `context.dataDir`. Treat it as opaque: it may move
230
211
between versions, so do not hard-code it.
231
212
213
+
### Upgrading from 1.8.0
214
+
215
+
1.9.0 changes what the plugin does with the Host's agents, not just the
216
+
version number. **It no longer creates an agent file anywhere**, and with it
217
+
the panel's "create a dedicated agent / use an existing agent" choice and the
218
+
manual `agentprov-cli.mjs` command are gone as well.
219
+
220
+
-**If you used 1.8.0** and let it create its own dedicated agent, the Host
221
+
may still have the leftover directory
222
+
`<Host data dir>/agents/mmx-octopus-agent/`. You can **delete it by hand** —
223
+
nothing in it is needed any more.
224
+
-**1.9.0 never creates that directory and never touches it.** The only files
225
+
it writes are the four JSON files under `context.dataDir`.
226
+
-**Your own `mmx` agent still wins.** If you have an agent named `mmx`, she
227
+
answers with it — read-only; the plugin never modifies it.
228
+
-**1.9.0 also hands you her settings.** The panel's **「复制她的设定」** button
229
+
gives you her character sheet as text, so you can put it into an agent named
230
+
`mmx` that you create yourself. The plugin no longer creates that agent for
231
+
you — it only recognises it.
232
+
233
+
-**If your saved state still points at the old agent, 1.9.0 ignores it.**
234
+
1.8.0 could have stored `mmx-octopus-agent` in the plugin's state file. 1.9.0
235
+
drops that name when it loads the state, so she answers with your own `mmx`
236
+
agent if you have one, and with the Host's default agent otherwise.
237
+
232
238
## Known limits
233
239
234
240
- The interface is Chinese only.
235
241
- There is no voice: a bubble is text.
236
242
- Her body animation only covers the moments the clips cover; between clips the
237
243
`pose` fallback runs.
238
244
- She answers in whatever agent the Host resolves for her.
245
+
- Without an agent named `mmx` of your own, her character sheet travels in the
246
+
message instead, and the Host's context compaction may drop it — which is
0 commit comments