Repository navigation
Expand file tree
/
Copy pathbricks.example.toml
More file actions
203 lines (183 loc) · 9.92 KB
/
Copy pathbricks.example.toml
File metadata and controls
203 lines (183 loc) · 9.92 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
195
196
197
198
199
200
201
202
203
# bricks.toml: agent, context, compression, web and memory settings
# (annotated example).
#
# Put it at the root of the project (`BricksConfig::load(working_dir)` reads
# `<working_dir>/bricks.toml` and `~/.bricks/rules/*.toml`). Every key is
# optional; the values below are the defaults. They are starting points for
# models with 100k to 200k-token windows, not universal values. Changes apply the
# next time the configuration is loaded. An invalid section is reported and
# replaced by its defaults; an invalid rule only disables itself.
#
# Details: docs/cli.md, docs/context.md, docs/compression.md, docs/shell.md,
# docs/web.md, docs/semantic.md, docs/agents.md and docs/memory.md.
[agent]
# Default model, as `provider_id/model_id` of providers.toml. Without it,
# `bricks` needs --model (no model is ever chosen silently).
# model = "my-provider/my-model"
# reasoning = "deep" # one of that model's reasoning profiles
# retry_after_max_wait_ms = 60000 # longest Retry-After a provider may ask for (0: never wait for it).
# # Above it, no retry is sent and the error says why.
# Permissions are not set in this file. They are chosen in Bricks, per
# session: Settings › General › "Permissions for new conversations" for
# the default of new conversations, the first-choice bar above the composer, or
# the /config view of a conversation. On the command line, `--permissions
# ask|execute` sets the profile of the run's session; without it, the session
# keeps its own choice (none chosen: ask). A `[permissions]` section left in
# this file is reported and not applied: delete it. See docs/cli.md#permissions.
[context]
safety_margin_tokens = 1024 # minimum free margin below the prompt budget
safety_margin_ratio = 0.02 # margin as a fraction of the budget (larger wins)
large_injection_tokens = 8000 # additions since the last measurement → pre-flight
preflight_ratio = 0.80 # occupation (upper bound) → pre-flight
compact_threshold = 0.85 # occupation → compaction after the turn
keep_recent_messages = 10 # tail kept verbatim (never splits a tool call)
max_recent_ratio = 0.30 # largest share of the budget for that tail
summary_max_tokens = 4096 # output reserved for the summary call
min_compaction_gain = 0.20 # a compaction must shrink the context by 20 %
max_compaction_failures = 3 # then automatic compaction stops for the session
max_overflow_recoveries = 1 # compactions per turn after a "too long" refusal
image_tokens = 1600 # estimate per image
document_tokens = 3000 # estimate per document / audio / video item
[compression]
level = "minimal" # off | minimal | aggressive (builder default: off)
max_output_chars = 40000 # hard cap of any tool output, at every level
max_lines = 300 # budget of ordinary log lines (rules may lower it)
max_error_lines = 250 # budget of diagnostic lines
max_block_lines = 80 # longer blocks keep head and tail
context_lines = 2 # lines kept around each error
max_line_chars = 2000 # longest ordinary line
json_summary_min_bytes = 16384 # JSON summarised from this size (aggressive: ÷4)
json_sample_items = 3 # items sampled per array
json_max_depth = 6
json_max_keys = 40
json_max_string_chars = 200
json_max_output_bytes = 12000
skeleton_min_lines = 150 # aggressive: skeletons for files at least this long
# raw_output_dir = "/var/tmp/bricks-outputs" # default: the session's storage, else <temp>/bricks/raw-outputs/<session>
# Project rules: same schema as ~/.bricks/rules/*.toml, highest priority.
[compression.filters.make]
description = "make: directory changes removed; compiler diagnostics kept by the built-in detectors."
match = [{ program = "make" }, { program = "gmake" }]
options_with_value = ["-C", "-f", "-j"]
strip_lines_matching = ['^make(\[\d+\])?: (Entering|Leaving) directory']
max_lines = 200
# Replace a built-in rule by reusing its id…
# [compression.filters.git-log]
# match = [{ program = "git", subcommands = ["log"] }]
# max_lines = 80
#
# …or disable it.
# [compression.filters.vite]
# disabled = true
# ── Web search and reading (docs/web.md) ─────────────────────────────────────
# Without this section: DuckDuckGo's HTML interface, no key. A keyed provider
# is used only when named here, and its key is read only from the variable
# named by `api_key_env`, never write a key in this file.
[web.search]
provider = "duckduckgo" # duckduckgo | brave | tavily | exa
fallback = [] # e.g. ["tavily", "duckduckgo"], tried in order
max_attempts = 3 # provider requests per search, retries included
timeout_ms = 5000 # one provider request
budget_ms = 12000 # the whole search, fallbacks included
max_retry_wait_ms = 2000 # longest Retry-After / rate-limit wait honoured once
# [web.search.brave]
# api_key_env = "BRAVE_SEARCH_API_KEY"
# mode = "FR" # Brave: country
# [web.search.tavily]
# api_key_env = "TAVILY_API_KEY"
# mode = "basic" # Tavily: search_depth
# [web.search.exa]
# api_key_env = "EXA_API_KEY"
# mode = "auto" # Exa: type
# endpoint = "https://api.exa.ai/search" # https only (http only to loopback)
[web.fetch]
max_pages = 5 # pages read after a search
concurrency = 5 # downloads at once
per_host = 2 # downloads at once to one host
page_timeout_ms = 4000 # connection + redirects + body of one page
max_page_bytes = 1500000 # decoded bytes kept per page (after decompression)
max_total_bytes = 8000000 # decoded bytes for all pages of one call
max_redirects = 5
budget_ms = 12000 # all downloads of one call
allow_private = [] # explicit exceptions, e.g. ["127.0.0.1:8080"] for a local server
[web.extract]
max_elements = 60000 # larger pages are not parsed
concurrency = 2 # pages parsed at once (blocking threads)
min_reliable_chars = 400 # below: extraction flagged as possibly incomplete
[web.passages]
min_chars = 500
max_chars = 1500
max_passages = 5
budget_chars = 6000 # characters of passages in one result
per_source = 2 # first pass: at most this many per page
[web.store]
max_session_bytes = 67108864 # documents kept per session (oldest removed beyond)
[agents]
# Native sub-agents (the Agent tool). See docs/agents.md. Runtime limits, not
# profile rules. Profiles: <workspace>/.bricks/agents/*.md > ~/.bricks/agents/*.md
# > built-in.
# enabled = true
# auto_model = "provider_id/model_id" # what `model: auto` means; absent: inherit
# max_context_chars = 16000
# summary_chars = 30000 # characters of a child's answer returned to its parent
# max_concurrent = 16 # descendants working at once in the session (launches, batches, resumes)
# max_depth = 1 # generations below the session's agent (1: children, no grandchildren)
# max_queued = 64 # children waiting for a slot (beyond: AgentQueueFull)
# admission_timeout_ms = 60000 # a child waits this long for a slot, then AgentAdmissionTimeout
# background_drain_ms = 600000 # headless: sub-agents still running get this long after the main run, then are cancelled (exit 6)
# default_isolation = "auto" # accepted, not used yet: a child runs in its isolation argument, else its profile's
# skills_max_bytes = 24000 # profile skills loaded into a child, in total
# subagent_memory_write = false # children without a memory setting may write memory (false: read only)
# [agents.reasoning_aliases]
# high = "deep" # a profile's `high` → this model's `deep`
[bash]
# Bash shell settings. See docs/shell.md.
# extra_path = [] # directories appended to PATH on Unix (macOS defaults to Homebrew and ~/.cargo/bin)
[background]
# Background commands (Bash `background: true`, the Job tool). See docs/agents.md.
# max_jobs = 16 # running at once in the session
# output_buffer_bytes = 1048576 # kept in memory per stream
# max_line_bytes = 65536 # a longer line is cut (marked)
# raw_log_bytes = 52428800 # each raw log, and its copy in the session's files
# stop_grace_ms = 2000 # TERM → KILL
# max_page_bytes = 65536 # largest Job output page
[semantic]
# The shared code understanding engine (CodeScout, /search). Every value is a
# ceiling: a query can lower it, never lift it. See docs/semantic.md.
# max_files = 20000
# max_matches = 2000
# max_results = 50
# max_file_bytes = 2097152
# max_parsed_files = 200
# timeout_ms = 15000
# default_budget_tokens = 4000
# max_budget_tokens = 16000
# tree_cache_entries = 512
# result_cache_entries = 128
# result_cache_ttl_ms = 30000
# max_blocking_tasks = 4
[semantic.lsp]
# Language servers are optional, started on demand, never installed by Bricks.
# enabled = true
# request_timeout_ms = 10000
# startup_timeout_ms = 60000
# diagnostics_wait_ms = 5000
# ready_wait_ms = 10000
# startup_settle_ms = 2000
# idle_shutdown_secs = 600
# max_restarts = 2
# max_open_documents = 64
# max_concurrent_requests = 8
# [[semantic.lsp.servers]]
# name = "rust-analyzer"
# command = "rust-analyzer"
# file_patterns = ["*.rs"]
# extension_to_language = { ".rs" = "rust" }
# ── Long-term memory (docs/memory.md) ────────────────────────────────────────
# Markdown notes: <workspace>/.bricks/memory (project) and
# ~/.bricks/memory/global (shared). The CLI attaches it when `enabled` is true.
# The desktop app has its own switch; it reads the two index limits here.
[memory]
enabled = false # the CLI attaches the note memory only when true
max_index_notes = 200 # notes listed in the index injected into the prompt
max_index_tokens = 1500 # estimated tokens of that index