Skip to content

Commit 5cc8e91

Browse files
committed
fix: remove READ_ONLY_MODE from system prompt to prevent stale mid-session metadata
Read-only mode is enforced via CLI args (--read-only, YOLO flag filtering) which update correctly per-message. The system prompt value was frozen at session start, causing agents to refuse writes after toggling read-only off.
1 parent 2e90f9f commit 5cc8e91

5 files changed

Lines changed: 0 additions & 22 deletions

File tree

src/prompts/maestro-system-prompt.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ When you need detailed guidance on a Maestro feature, fetch the relevant documen
5555
- **Git Branch:** {{GIT_BRANCH}}
5656
- **Session ID:** {{AGENT_SESSION_ID}}
5757
- **History File:** {{AGENT_HISTORY_PATH}}
58-
- **Read-Only Mode:** {{READ_ONLY_MODE}}
5958

6059
## Task Recall
6160

@@ -212,17 +211,6 @@ If a user requests an operation that would write outside your assigned directory
212211
1. Change to the appropriate session/agent for that directory
213212
2. Explicitly confirm they want to override this safety measure
214213

215-
### Read-Only / Plan Mode Behavior
216-
217-
**Your current read-only mode status: {{READ_ONLY_MODE}}**
218-
219-
When operating in read-only or plan mode (`{{READ_ONLY_MODE}}` = true), you MUST provide both:
220-
221-
1. Any artifacts you create (documents, plans, specifications)
222-
2. A clear, detailed summary of your plan in your response to the user
223-
224-
Do not assume the user will read generated files. Always explain your analysis, reasoning, and proposed approach directly in your response.
225-
226214
**Asking questions:** When you need input from the user before proceeding, place ALL questions in a clearly labeled section at the **end** of your response using this exact format:
227215

228216
---

src/renderer/hooks/agent/useMergeTransferHandlers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ You are taking over this conversation. Based on the context above, provide a bri
501501
groupId: targetSession.groupId,
502502
activeTabId: newTabId,
503503
conductorProfile,
504-
readOnlyMode: false,
505504
});
506505
}
507506

src/renderer/hooks/input/useInputProcessing.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,6 @@ export function useInputProcessing(deps: UseInputProcessingDeps): UseInputProces
10301030
activeTabId: freshSession.activeTabId,
10311031
historyFilePath,
10321032
conductorProfile,
1033-
readOnlyMode: isReadOnly,
10341033
});
10351034
}
10361035

src/renderer/stores/agentStore.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ export const useAgentStore = create<AgentStore>()((set, get) => ({
321321
groupId: session.groupId,
322322
activeTabId: targetTab.id,
323323
conductorProfile: deps.conductorProfile,
324-
readOnlyMode: isReadOnly,
325324
});
326325
}
327326

@@ -417,7 +416,6 @@ export const useAgentStore = create<AgentStore>()((set, get) => ({
417416
groupId: session.groupId,
418417
activeTabId: targetTab.id,
419418
conductorProfile: deps.conductorProfile,
420-
readOnlyMode: isReadOnly,
421419
});
422420
}
423421

src/shared/templateVariables.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import { buildSessionDeepLink, buildGroupDeepLink } from './deep-link-urls';
5353
*
5454
* Maestro Variables:
5555
* {{MAESTRO_CLI_PATH}} - Platform-appropriate path to maestro-cli
56-
* {{READ_ONLY_MODE}} - "true" if agent is in read-only/plan mode, "false" otherwise
5756
*
5857
* Cue Variables (Cue automation only):
5958
* {{CUE_EVENT_TYPE}} - Cue event type (app.startup, time.heartbeat, time.scheduled, file.changed, agent.completed, github.*, task.pending)
@@ -161,8 +160,6 @@ export interface TemplateContext {
161160
historyFilePath?: string;
162161
// Conductor profile (user's About Me from settings)
163162
conductorProfile?: string;
164-
// Read-only / plan mode state
165-
readOnlyMode?: boolean;
166163
// Cue event context (for Cue automation prompts)
167164
cue?: {
168165
eventType?: string;
@@ -303,7 +300,6 @@ export const TEMPLATE_VARIABLES = [
303300
},
304301
{ variable: '{{MONTH}}', description: 'Month (01-12)' },
305302
{ variable: '{{MAESTRO_CLI_PATH}}', description: 'Path to maestro-cli' },
306-
{ variable: '{{READ_ONLY_MODE}}', description: 'Read-only/plan mode (true/false)' },
307303
{ variable: '{{TAB_DEEP_LINK}}', description: 'Deep link to agent + active tab (maestro://)' },
308304
{ variable: '{{TIME}}', description: 'Time (HH:MM:SS)' },
309305
{ variable: '{{TIMESTAMP}}', description: 'Unix timestamp (ms)' },
@@ -334,7 +330,6 @@ export function substituteTemplateVariables(template: string, context: TemplateC
334330
documentPath,
335331
historyFilePath,
336332
conductorProfile,
337-
readOnlyMode,
338333
} = context;
339334
const now = new Date();
340335

@@ -403,7 +398,6 @@ export function substituteTemplateVariables(template: string, context: TemplateC
403398

404399
// Maestro variables
405400
MAESTRO_CLI_PATH: getMaestroCLIPath(),
406-
READ_ONLY_MODE: String(readOnlyMode ?? false),
407401

408402
// Cue variables
409403
CUE_EVENT_TYPE: context.cue?.eventType || '',

0 commit comments

Comments
 (0)