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
Copy file name to clipboardExpand all lines: packages/dashboard/src/components/ConfigEditor/ConfigEditor.tsx
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -57,12 +57,14 @@ interface FieldDef {
57
57
options?: string[];
58
58
description: string;
59
59
section: string;
60
+
defaultValue?: boolean|number|string;
60
61
}
61
62
62
63
constFIELD_DEFS: FieldDef[]=[
63
64
// General
64
65
{key: "enabled",label: "Enabled",type: "boolean",description: "Enable the magic-context plugin",section: "General"},
65
66
{key: "ctx_reduce_enabled",label: "Agent Controlled Reduction",type: "boolean",description: "Enable agent controlled reductions via ctx_reduce tool. When enabled, agent is prompted and nudged to choose what messages and tool calls to drop periodically. If disabled the system still works via auto drops based on message ages.",section: "General"},
67
+
{key: "drop_tool_structure",label: "Drop Tool Structure",type: "boolean",description: "When enabled, dropped tool calls are fully removed. When disabled, tool input/output is truncated in place so tool structure stays visible.",section: "General",defaultValue: false},
66
68
// Thresholds
67
69
// cache_ttl and execute_threshold_percentage are rendered as custom PerModelField components
68
70
{key: "nudge_interval_tokens",label: "Nudge Interval (tokens)",type: "number",description: "Token interval between rolling ctx_reduce nudges.",section: "General"},
return`Compressed history intentionally omits tool calls and their outputs — summaries like "I edited file X" are historian records, not patterns to replicate. In the live conversation, older tool calls and their results are cleaned up to save context — you may see your own past messages referencing actions without the corresponding tool call or result visible. This is normal context management. ALWAYS use real tool calls; never simulate, fabricate, or inline tool outputs in your text. If there is no tool result message, the action did not happen. NEVER simulate, hallucinate or claim tool calls, command output, search results, file edits, or diffs in plain text as if they actually occurred.`;
18
+
}
19
+
20
+
return`Older tool calls in your conversation show truncated inputs and [truncated] outputs — this is normal context management, not a pattern to follow. The original tool calls executed successfully with full inputs and produced real outputs that were later cleaned up to save context. ALWAYS use real tool calls with complete arguments; never copy truncated patterns like "filePa...[truncated]" into your tool inputs. If you need to re-read a file or re-run a command, make a fresh tool call.`;
21
+
}
22
+
15
23
constBASE_INTRO=(
16
24
protectedTags: number,
25
+
dropToolStructure: boolean,
17
26
): string=>`Messages and tool outputs are tagged with §N§ identifiers (e.g., §1§, §42§).
18
27
Use \`ctx_reduce\` to manage context size. It supports one operation:
19
28
- \`drop\`: Remove entirely (best for tool outputs you already acted on).
@@ -33,13 +42,16 @@ Use \`ctx_expand\` to decompress a compartment range to see the original convers
33
42
- Looking for how something was implemented previously → \`ctx_search(query="how does the dreamer lease work")\`
34
43
- Want to recall what was decided in an earlier conversation → \`ctx_search(query="dashboard release signing setup")\`
35
44
\`ctx_search\` returns ranked results from memories, session facts, and raw message history. Use message ordinals from results with \`ctx_expand\` to retrieve surrounding conversation context.
45
+
${getToolHistoryGuidance(dropToolStructure)}
36
46
NEVER drop large ranges blindly (e.g., "1-50"). Review each tag before deciding.
37
47
NEVER drop user messages — they are short and will be summarized by compartmentalization automatically. Dropping them loses context the historian needs.
38
48
NEVER drop assistant text messages unless they are exceptionally large. Your conversation messages are lightweight; only large tool outputs are worth dropping.
39
49
Before your turn finishes, consider using \`ctx_reduce\` to drop large tool outputs you no longer need.`;
40
50
41
51
/** Intro when ctx_reduce is disabled — no drop guidance, no ctx_reduce references. */
42
-
constBASE_INTRO_NO_REDUCE=`Messages and tool outputs are tagged with §N§ identifiers (e.g., §1§, §42§).
52
+
constBASE_INTRO_NO_REDUCE=(
53
+
dropToolStructure: boolean,
54
+
): string=>`Messages and tool outputs are tagged with §N§ identifiers (e.g., §1§, §42§).
43
55
Use \`ctx_note\` for deferred intentions — things to tackle later, not right now. NOT for task tracking (use todos). Notes survive context compression and you'll be reminded at natural work boundaries (after commits, historian runs, todo completion).
44
56
Use \`ctx_memory\` to manage cross-session project memories. Write new memories or delete stale ones. Memories persist across sessions and are automatically injected into new sessions.
45
57
**Save to memory proactively**: If you spent multiple turns finding something (a file path, a DB location, a config pattern, a workaround), save it with \`ctx_memory\` so future sessions don't repeat the search. Examples:
@@ -54,7 +66,8 @@ Use \`ctx_expand\` to decompress a compartment range to see the original convers
54
66
- Need a config value, API key location, or environment detail → \`ctx_search(query="embedding provider configuration")\`
55
67
- Looking for how something was implemented previously → \`ctx_search(query="how does the dreamer lease work")\`
56
68
- Want to recall what was decided in an earlier conversation → \`ctx_search(query="dashboard release signing setup")\`
57
-
\`ctx_search\` returns ranked results from memories, session facts, and raw message history. Use message ordinals from results with \`ctx_expand\` to retrieve surrounding conversation context.`;
69
+
\`ctx_search\` returns ranked results from memories, session facts, and raw message history. Use message ordinals from results with \`ctx_expand\` to retrieve surrounding conversation context.
70
+
${getToolHistoryGuidance(dropToolStructure)}`;
58
71
59
72
constSISYPHUS_SECTION=`
60
73
### Reduction Triggers
@@ -217,14 +230,15 @@ export function buildMagicContextSection(
217
230
protectedTags: number,
218
231
ctxReduceEnabled=true,
219
232
dreamerEnabled=false,
233
+
dropToolStructure=true,
220
234
): string{
221
235
constsmartNoteGuidance=dreamerEnabled
222
236
? `\nWhen \`surface_condition\` is provided with \`write\`, the note becomes a project-scoped smart note.\nThe dreamer evaluates smart note conditions during nightly runs and surfaces them when conditions are met.\nExample: \`ctx_note(action="write", content="Implement X because Y", surface_condition="When PR #42 is merged in this repo")\``
return`## Magic Context\n\n${BASE_INTRO(protectedTags)}${smartNoteGuidance}\n${section}\n\nPrefer many small targeted operations over one large blanket operation. Compress early and often — don't wait for warnings.`;
243
+
return`## Magic Context\n\n${BASE_INTRO(protectedTags,dropToolStructure)}${smartNoteGuidance}\n${section}\n\nPrefer many small targeted operations over one large blanket operation. Compress early and often — don't wait for warnings.`;
0 commit comments