Agents: Plan Mode should allow research — label actions as queries or mutators, and make plan-mode access configurable per agent
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
This is a design proposal with three unresolved open questions, so the first step is a decision, not an edit. Read the plan-mode gate in base-agent.ts around line 7550 (validateNextStep) and buildPlanApprovalForm, then trace how the composite steps ForEach, While, Pipeline and Tasks dispatch actions and sub-agents so the same check can cover them. Sketch the metadata changes (MJ: Actions, MJ: AI Agent Actions, MJ: AI Agents.PlanModeAccess, PlanModeWritablePaths) and get maintainer agreement on where the query/mutator label lives before any implementation. Done means an agreed design, then the gate exemption plus tests covering query, mutator and composite-step cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Plan Mode should stop an agent from changing things before approval, not from researching. Today it blocks every Action and every Sub-Agent call until the plan is approved, so an agent can't look anything up while it plans. Meanwhile ForEach, While, Pipeline and Tasks, which can run actions and sub-agents, are not gated at all.
This proposes:
- labeling actions as queries (read-only) or mutators (change state),
- letting Plan Mode run queries by default,
- letting each agent configure exactly which actions and sub-agents it may use while planning.
Current behavior (on next)
- The gate: in
BaseAgent.validateNextStep(base-agent.ts~7550),if (this._planModeActive && !this._planApproved && (step === 'Actions' || step === 'Sub-Agent'))demotes the step toRetry.- There is no exemption for read-only actions. A planning agent can't call "Get Entity Details", run a read-only query, or delegate to a research sub-agent.
- Composite steps aren't gated:
ForEach,While,PipelineandTasksare not checked, though each can run actions or sub-agents. The gate is too strict for direct calls and too loose for composite steps. - Fixed approval form:
buildPlanApprovalFormalways builds a markdown textarea plus approve/reject buttons. A plan that needs a richer preview (a mockup, a diagram) can't show one.
Agentic coding tools draw the line in a different place. Plan mode there allows reading, searching, read-only commands and research sub-agents, and blocks edits and state-changing commands until the plan is approved.
Proposal
1. Label actions as queries or mutators
Add a classification with two values:
| Value | Meaning | Examples |
|---|---|---|
Query |
Reads only; no state changes anywhere | Get Entity Details, Run View, Run Query, web search |
Mutator |
Changes MJ data or anything outside it | Create/Update/Delete Record, Send Email, webhooks |
Unclassified actions count as Mutator, so nothing becomes callable in Plan Mode by accident.
Where the label lives (open question):
- On
MJ: Actions(recommended). Whether an action changes state is a fact about its code, and it's the same no matter who calls it.MJ: Actionsalready records facts like this (IsIdempotent,CompensationActionID).- It's labeled once instead of on every agent that uses the action.
- MCP, A2A, GraphQL, scheduled jobs and the governance work in #4614 can all use it, not just agents.
- On
MJ: AI Agent Actions. Plan Mode is only relevant when an agent calls the action, and actions are a lower-level construct that shouldn't carry agent concepts.- Costs: the same fact is repeated on every agent-action row; it can't be reused outside agents; and an action that changes state could be labeled
Queryon one agent by mistake.
- Costs: the same fact is repeated on every agent-action row; it can't be reused outside agents; and an action that changes state could be labeled
Recommendation: both, at two levels.
- The fact (
Query/Mutator) goes onMJ: Actions. - The policy, whether this agent may call the action while planning, goes on
MJ: AI Agent Actionsas an override (§2).
That keeps what an action does separate from what an agent is allowed to do with it.
2. Per-agent policy
MJ: AI Agents.PlanModeAccesssets the default for what the agent can call while planning:Queries(new default): query actions only.None: today's behavior, blocking all actions and sub-agents.
MJ: AI Agent Actions.AllowedInPlanModeis nullable; null follows the agent default. It can allow a specific mutator, such as writing a scratch record, or block a specific query.- Sub-agents: the same nullable
AllowedInPlanModeon child agents and onMJ: AI Agent Relationships, defaulting to blocked. A research sub-agent can be allowed while a builder sub-agent stays blocked.
3. Rules that keep it consistent
- Plan Mode carries into sub-agents. An allowed sub-agent runs under the same restrictions, using its own policy. It can research but can't change anything.
- Composite steps are checked.
ForEach,While,PipelineandTasksare allowed only if every action and sub-agent inside them is allowed. - Payload writes while planning. Add
PlanModeWritablePathson the agent: the payload paths the agent may write during planning (e.g. a draft spec). Other payload paths stay locked until approval. Planning usually produces something, and today there is no defined rule for what it may write.
4. Related: configurable approval form
Let an agent supply the plan-approval form, as a response form or template on the agent, instead of always using buildPlanApprovalForm. This allows a rich preview (rendered mockup, diagram) next to approve, reject and feedback.
Why
Skip's requirements stage researches the client's schema (entity details, tag summaries) before it writes requirements and a mockup for the user to approve. Plan Mode is the natural fit for that "research, propose, approve, build" flow, but today it blocks the research. More generally, agents produce better plans when they can look things up first.
Open questions
- Where the label lives (§1). We recommend both levels, but storing it only on
MJ: AI Agent Actionsis a real alternative. - Is a third value worth it:
Query/Internal(writes MJ data) /External(sends email, calls third parties)? A third value would let approval unlock internal writes while external effects still need confirmation each time. Two values are enough to start. - Should runtime-added actions (skills,
actionChanges) inherit the label fromMJ: Actions? Yes would be the natural answer, but it's worth confirming.
Relationship to #4614
The query/mutator label is a natural input to the governance work in #4614. A deny/approval rule like "mutators need approval in shared conversations" becomes a simple policy once actions carry the label.
🤖 Generated with Claude Code
- Lingua principale
- TSQL
- Stelle
- 32
- Fork
- 7
- Merge medio
- 1g 16h
- PR unite (30g)
- 504
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MemberJunction/MJ
-
DBAutoDoc: export --state-file writes SQL Server SQL for a PostgreSQL database, ignoring --providerAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
MemberJunction/MJ#7094 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
MemberJunction/MJ#6971 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
MemberJunction/MJ#6947 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MemberJunction/MJ#6800 ·
I maintainer di solito rispondono entro 1 giorno
-
Convention: saved-query discoverability follows Status — Approved is canon, Pending is a draftAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
MemberJunction/MJ#6746 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MemberJunction/MJ
Issue simili
-
[Feature]: Skill Workshop skill diet should use the configured utility model, not always the primaryApertaclawsweeper:fix-shape-clear clawsweeper:needs-live-repro clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🐚 platinum hermit P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
openclaw/openclaw#210348 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
ai-generated tests
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
danielmiessler/LifeOS#3121 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
diegosouzapw/OmniRoute#21908 ·
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100