-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefaults.go
More file actions
194 lines (192 loc) · 6.98 KB
/
Copy pathdefaults.go
File metadata and controls
194 lines (192 loc) · 6.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
package config
import "path/filepath"
func DefaultConfig() *Config {
profiles := ModelsDevSeedProfiles()
profiles["generic"] = ModelConfig{
Model: "qwen3.5-coder",
BaseURL: "http://localhost:11434/v1",
MaxTokens: 8192,
MaxContext: 128000,
Protocol: "openai-compatible",
}
return &Config{
Version: DefaultVersion,
Providers: ProvidersConfig{
Primary: "minimax",
Fallback: []string{"openai", "deepseek"},
Profiles: profiles,
},
Context: ContextConfig{
// Sized for modern 200K-1M providers (Opus 4.7, GPT-5.4,
// Sonnet 4.6) where prompt caching subsidizes stable
// prefixes. The earlier 50-files × 320-tokens "file scrap"
// failure mode came from a tiny per-file budget, not from
// the file count itself; here we keep the count generous
// and the per-file budget meaningful so injects are
// useful evidence, not unreadable slices.
MaxFiles: 20,
MaxTokensTotal: 12000,
MaxTokensPerFile: 2000,
// History budget — the work narrative the model threads
// across turns. Prompt caching on the conversation prefix
// makes carrying ~24K of history cheap on modern
// providers; capping low (the old 2K) starved the
// reasoning thread and forced the model to re-discover
// context every round.
MaxHistoryTokens: 24000,
MaxHistoryMessages: 120,
Compression: "standard",
// AutoIncludeFiles=false: a tool-using model should
// retrieve its own context via grep_codebase / find_symbol
// / read_file when it needs files, NOT have N random
// scraps dumped into the prompt before the question even
// runs. Pre-loading hurts signal-to-noise (the model sees
// 20 partial files it didn't ask for) AND wastes the
// cached prefix on stuff that may be irrelevant to the
// current turn. Users who DO want a specific file pulled
// in opt back in per-turn with `[[file:path]]` markers or
// `#ctx-files` / `#context:on` flags in the prompt.
AutoIncludeFiles: false,
IncludeTests: false,
IncludeDocs: true,
SymbolAware: true,
GraphDepth: 2,
},
Memory: MemoryConfig{
Enabled: true,
MaxEpisodic: 1000,
MaxSemantic: 5000,
ConsolidationInterval: "30m",
DecayRate: 0.01,
EnableLLMUpdate: true,
LLMUpdateProvider: "",
LLMUpdateModel: "",
LLMUpdatePrompt: "Based on the following conversation turn, suggest up to {max_entries} memory entries to store. Each entry should be a concise fact or insight relevant to future sessions. Respond in JSON format: [{\"type\": \"episodic\"|\"semantic\", \"content\": \"...\", \"relevance\": 0.0-1.0}].\n\nTurn:\n{turn_content}\n\nSuggested entries:",
LLMUpdateTimeoutMs: 10000,
LLMUpdateMaxEntries: 5,
LLMUpdateMinConfidence: 0.5,
LLMUpdateEnabled: true,
LLMUpdateThreshold: 0.6,
},
Security: SecurityConfig{
SecretDetection: true,
VulnScanning: true,
DepAudit: true,
Sandbox: SandboxConfig{
AllowShell: true,
AllowNet: false,
Timeout: "30s",
MaxOutput: "100KB",
},
},
Tools: ToolsConfig{
Enabled: []string{"file_ops", "shell", "git", "search", "code_edit", "web"},
// RequireApprovalNetwork defaults to ["*"] so any non-user source
// (web, ws, mcp) is gated by default. Operators who trust their
// local browser tab can set this to [] to disable the network gate,
// or to specific tool names. The agent-loop RequireApproval stays
// empty so existing automation isn't broken by default.
RequireApprovalNetwork: []string{"*"},
Shell: ShellToolConfig{
BlockedCommands: []string{"rm -rf /", "mkfs", "dd if="},
Timeout: "30s",
},
},
Agent: AgentConfig{
// Sustained-loop defaults. Earlier defaults (25/5/7) were tuned
// for short Q&A turns and choked on real refactor work — the
// model would land in a synthesis nudge after 5 tool calls and
// be forbidden from calling more after 7, so multi-step
// orchestration like "read N files, edit M, verify, edit
// again" stopped halfway. Modern context windows + provider
// pricing easily support the higher numbers below; users on
// tight budgets can override per-project in .dfmc/config.yaml.
MaxToolSteps: 60,
MaxToolTokens: 250000,
MaxToolResultChars: 3200,
MaxToolResultDataChars: 1200,
ParallelBatchSize: 4,
MetaCallBudget: 64,
MetaDepthLimit: 4,
ToolRoundSoftCap: 15,
ToolRoundHardCap: 30,
BudgetHeadroomDivisor: 7,
ElasticToolTokensRatio: 0.60,
ElasticToolResultCharsRatio: 1.0 / 40.0,
ElasticToolDataCharsRatio: 1.0 / 100.0,
// "auto" = autonomous park→compact→resume inside the same Ask
// call. The cumulative ResumeMaxMultiplier ceiling still bounds
// total work. Set to "off" in CI / cost-sensitive contexts to
// require an explicit /continue between budgets.
AutonomousResume: "auto",
AutonomousPlanning: "auto",
ToolReasoning: "auto",
// "auto" = the engine self-resumes after a final assistant
// answer if the model didn't emit `[done: true]`. The first
// `[next: …]` action becomes the next user prompt. Capped by
// MaxAutoContinueIterations so a runaway model can't burn a
// whole budget on its own. Set to "off" for legacy behavior
// (user types each follow-up manually).
AutoContinue: "auto",
MaxAutoContinueIterations: 5,
ContextLifecycle: ContextLifecycleConfig{
Enabled: true,
AutoCompactThresholdRatio: 0.7,
KeepRecentRounds: 3,
HandoffBriefMaxTokens: 500,
AutoHandoffThresholdRatio: 0.9,
},
ToolDefaultTimeoutSeconds: 30,
ReadSnapshotCap: 256,
RecentFailureCap: 256,
// ChatAutoDecompose: routes multi-step chat prompts to Drive if the task
// looks like it needs multiple steps. Single-step questions stay with Ask().
ChatAutoDecompose: true,
},
Hooks: HooksConfig{
AllowProject: false,
Entries: map[string][]HookEntry{},
},
Plugins: PluginsConfig{
Directory: filepath.Join(UserConfigDir(), "plugins"),
Enabled: []string{},
},
TUI: TUIConfig{
Theme: "dark",
VimKeys: true,
ShowTokens: true,
ShowStatsPanel: true,
ToolStripExpanded: true,
GitDiffTimeoutSeconds: 30,
MouseCapture: true,
},
Web: WebConfig{
Port: 7777,
Host: "127.0.0.1",
Auth: "none",
OpenBrowser: true,
},
Remote: RemoteConfig{
Enabled: false,
GRPCPort: 7778,
WSPort: 7779,
Auth: "token",
},
Coach: CoachConfig{
Enabled: true,
MaxNotes: 3,
},
Intent: IntentConfig{
Enabled: true,
TimeoutMs: 1500,
FailOpen: true,
MaxSnapshotChars: 2000,
},
Telegram: TelegramConfig{
Enabled: false,
Token: "",
AllowedUsers: []int64{},
SessionName: "dfmc",
},
}
}