Repository navigation
Conversation
MyPrototypeWhat
left a comment
There was a problem hiding this comment.
Hi @Huixin615 — thanks for the first contribution. I looked at bc50fa1.
There is one repository red line that blocks merge on this revision.
Must fix
- Please remove direct access to the Host’s local runtime store and session history (read-only still counts)
Community plugins must not open MiniMax Code’s internal runtime database or its session store files. Disclosure in README / Data & access does not make that path allowed. The PR description and the code agree on the source; this is not a “docs say X, code does Y” gap:
miniapp/node/data.mjs:28-31(dataHome): resolvesMAVIS_HOMEor~/.minimax— notcontext.dataDir.miniapp/node/data.mjs:34-50(withDb):import('node:sqlite')thenDatabaseSync(join(home, 'v2', 'sqlite', 'runtime-state.sqlite'), { readOnly: true }).- Queries on that store include conversation / task indexes:
data.mjs:53-60anddata.mjs:71-80(local_runtime_sessions),data.mjs:74-75/data.mjs:143-144(local_runtime_background_tasks). - Session history files are read next:
data.mjs:192-226(historyRows) opens…/v2/sessions/<historyDir>/messages.jsonlunder the same home root (with path checks and a symlink reject). - Those history rows feed the UI: task instructions and parent-result matching (
data.mjs:235-277,data.mjs:326-337), plus child final text / tool names (data.mjs:347-365→/api/taskinserver.mjs:43-46). server.mjsnever usescontext.dataDir; the live data path is entirely outside the plugin’s private directory.
So “read-only,” “no outbound network,” “no Agent turns,” and “no writes to Host files” can all be true and still leave the red line intact: the Mini App opens and queries Host-internal runtime state and session history. Please remove that whole path (SQLite open, history file reads, and any API that depends on them). After it is gone, wait for a compliant way to get this data before rebuilding, or narrow the Mini App so it does not need Host-internal stores. Please align README Data & access with whatever remains.
What the page currently surfaces from that path (worth knowing until it is removed): conversation titles and ids (/api/sessions), task instruction text, child final replies, and tool names. Anything a user pasted into a prompt or a child wrote back can appear in the local page JSON.
Optional (non-blocking; fine to park while the red line is open)
- Loopback
Hostchecks on GET:server.mjs:26-32serves HTML/CSS/JS and the APIs with method checks only. Other plugins in the gallery also guard loopbackHoston requests; worth matching when you have a Host-safe data path.
Happy to re-review once the Host-internal store / session-history access is gone.
|
@MyPrototypeWhat Thanks for your review. I have updated it. Could your please take another look when you have time? Thanks you very much! |
Summary
Add Agent Flow, a Mini App for inspecting native
taskcalls and sub-agent lifecycle events recorded by this plugin's Hooks.Changes since the review of
bc50fa1The implementation that accessed Host-internal data has been removed:
v2/sessionsfiles, or session history./api/sessionsor/api/taskendpoints derived from those stores.Hostheader. The browser reads an event file only after the user selects it.Instead, MiniMax Code's
SessionStart,PreToolUse(task),PostToolUse(task),SubagentStart, andSubagentStopHooks send events to this plugin's recorder. The recorder writes bounded event metadata to the runtime-providedPLUGIN_DATAdirectory.Data & limitations
Records contain timestamps, SHA-256 digests of opaque IDs, agent type, a task title truncated to 160 characters, and whether a tool response field was present. A task title may contain user-supplied or sensitive text. Full task instructions, tool-result bodies, and child final replies are not stored. Records stay on the user's machine until the user deletes them.
The imported file is parsed in the page's memory; the page does not scan Host sessions or automatically refresh the file. A
PostToolUseevent shows that a tool call returned, not that the parent Agent adopted its result. Events without an explicit association are excluded from the selected session's child view. Events from before the Hooks were installed cannot be reconstructed.Requires MiniMax Code 3.1.4 or later and
nodeon the Hook process'sPATH. The documented macOS file location is a manual file-picker hint, not a path accessed by plugin code. Windows has not been manually tested.Validation
node --test plugins/huixin615/agent-flow/tests/*.test.mjs: 10/10 passed.npm run check:agent-flow: OK, repository validation passed, and 69 repository tests passed.taskcalls and two sub-agent lifecycles were recorded. Each call linked to its child by an exact structured session ID match, and the child running intervals overlapped.