pi-bro 0.23.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,130 @@
1
+ # Backend access, privacy and retention
2
+
3
+ [Docs home](../README.md) · [All commands](commands.md) · [Safety and permissions](data-and-permissions.md)
4
+
5
+ ## Backends: access and retention
6
+
7
+ Bro uses each CLI's own account and billing route, never Pi provider
8
+ credentials, and does not copy credentials or rewrite backend configuration.
9
+ Each backend and your model provider may retain sessions, logs, and request
10
+ data under their own settings and policies.
11
+
12
+ | | Explain / show | BTW conversation-only | BTW full permission | Advisor | Guided Review |
13
+ | --- | --- | --- | --- | --- | --- |
14
+ | **Agy** | Temporary directory, Agy sandbox | Temporary directory, Agy sandbox | Workspace, permissions bypassed | Fresh workspace process, permissions bypassed | Captured checkout, Agy sandbox (shell and in-project writes allowed; advisory) |
15
+ | **Claude Code** | Scratch directory, tools/MCP/skills disabled, no session persistence | Workspace, tools disabled | Workspace, permissions bypassed | Fresh workspace process, permissions bypassed | Restricted Read/Grep/Glob only; confined checkout, no persistence |
16
+ | **Grok** | Temporary directory, **prompt instruction only** | Workspace, **prompt instruction only** | Workspace, permissions bypassed | Fresh workspace process, permissions bypassed | Captured checkout, read-only sandbox (shell-enabled; advisory) |
17
+ | **Codex** | Scratch directory, read-only sandbox, ephemeral session | Workspace, read-only sandbox | Workspace, approvals and sandbox bypassed | Fresh workspace process, approvals and sandbox bypassed | Captured checkout, read-only sandbox, ephemeral (shell-enabled; advisory) |
18
+ | **Muse** | Scratch directory, approval/write/shell disabled, no session log | Workspace, approval/write/shell disabled | Workspace, permissions bypassed (`--yolo`) | Fresh workspace process, permissions bypassed (`--yolo`) | Captured checkout; writes/shell/web disabled, no session log |
19
+
20
+ - Grok always runs explain, show, btw and the advisor with its sandbox off and
21
+ permissions bypassed; its tools, hooks, skills, plugins, and MCP may remain
22
+ available. "Answer only from the supplied context" is a request, not an
23
+ enforced restriction. Guided Review is the exception: it runs with
24
+ `--sandbox read-only --permission-mode dontAsk` but still executes shell
25
+ commands inside that sandbox.
26
+ - Codex's read-only sandbox is not a tool-free mode: workspace reads and
27
+ sandboxed commands remain available, including for Guided Review. Bro does
28
+ not disable configured MCP servers or web search; their access is governed
29
+ by Codex configuration.
30
+ - Agy's Guided Review runs under `--sandbox`, which restricts terminal
31
+ commands but still permits writes inside the project; it has no file-only
32
+ tool filter.
33
+ - Muse's restricted mode disables write and shell tools and approval prompts,
34
+ not all tools: workspace reads and web tools remain available without approval.
35
+ It is not a tool-free or network-isolated mode.
36
+ - Claude's restrictions are tool/configuration settings (with safe mode), not
37
+ an OS sandbox; built-in and managed Claude behavior can remain. Running a
38
+ permission-bypassing mode as root may be rejected by Claude.
39
+ - BTW continues natively: Agy by conversation ID, Claude and Grok by
40
+ `--resume`, Codex by `resume`, and Muse by `--session-id` of the same session,
41
+ including across `/mode` switches. An Agy conversation stays bound to the
42
+ workspace it started in, so after a `/mode` switch — or whenever a thread
43
+ has turns but no native session ID — Bro starts a fresh native session
44
+ seeded with the main-session context and every earlier turn.
45
+ - Cancellation, deadlines, and invalid output streams stop the backend's
46
+ process group on POSIX, escalating after a five-second grace period. On
47
+ Windows only the direct child is targeted. Detached shell work or external
48
+ services a backend started are not contained. Bro removes its private
49
+ temporary prompt files.
50
+
51
+ ### Configuration precedence
52
+
53
+ When resolving backend, model, and reasoning effort:
54
+ 1. **Per-capability override**: `overrides.<capability>` (`explain`, `show`, `btw`, `advisor`, or `review`) pins that capability's complete selection.
55
+ 2. **Shared default**: otherwise the capability inherits `default` (root `model`/`effort` in older flat files).
56
+ 3. **Agy catalog normalization**: for Agy selections, Bro maps suffixed variant IDs and handles fixed-effort models.
57
+ 4. **Initial file creation only**: `PI_BRO_MODEL` has no effect once the settings file exists.
58
+
59
+ When resolving turn count for `/bro show`:
60
+ 1. **Command argument**: an explicit count like `/bro show 3` or `/bro show 1 query` overrides for that run.
61
+ 2. **Saved setting**: `showTurns` (defaults to 1).
62
+
63
+ When shaping an answer, each part has one owner:
64
+
65
+ | Part | Decided by |
66
+ | --- | --- |
67
+ | Bro's source rules: quoted source treated as data, no added facts, Show's traceability rules, BTW access mode | Built in; nothing overrides them |
68
+ | How much of the source an explanation keeps | The mode: **M** for one explanation, otherwise the saved `mode` |
69
+ | What a Show drawing focuses on | The steering query |
70
+ | Who the answer is for: wording, tone, depth, and answer language | Your [preferences](settings.md#preferences), otherwise Bro's built-in defaults |
71
+
72
+ ## Privacy and safety
73
+
74
+ - **External requests**: Bro sends the latest completed assistant response,
75
+ pasted text, extracted document text, extracted webpage text, or recent
76
+ session conversation text (tool calls, tool results, reasoning, and images
77
+ omitted) to the selected backend and its configured model provider.
78
+ - **Elevate requests**: `/bro elevate` sends your objective, preferences, and all user/assistant text on the current branch by default, without a fixed history cap. Its visible Context switch can include tool-call arguments and text results (Full), potentially including sensitive file contents or command output. Both modes exclude hidden reasoning and image binaries. Only explicit Retry after a context-overload error trims older history; the UI discloses reduced context. Its optional rewrite call includes only approved findings. It makes fresh restricted calls through the BTW model setting, but a backend's restricted mode is not a universal file/network sandbox (Grok restrictions are prompt-only). It does not insert or submit anything to Pi unless you approve insertion. In the terminal, insertion can replace the draft Elevate was opened on, if it is unchanged; an explicit `/bro elevate <request>` requires an empty editor. See the [Elevate guide](../elevate.md).
79
+ - **Side conversation requests**: `/bro btw` sends your side questions and the
80
+ seeded main-session conversation text (plus earlier turns when a native
81
+ session is reseeded) to the selected backend. In full permission mode the
82
+ side agent can additionally read and edit the workspace.
83
+ - **Guided Review requests**: PR identity/description, captured diff, relevant private discussion and preferences go to the selected backend, which can inspect captured files. Main-session context is not attached. Claude (`--restricted`, file tools only) and Muse (write/shell/web disabled) use strict file-only inspection and are recommended for untrusted PRs. Codex and Grok inspect the captured checkout under a read-only sandbox; Agy's `--sandbox` still allows in-project writes. All three run shell commands and show an advisory. Prompt injection can still corrupt conclusions or reveal captured content to the provider; this is not a general confidentiality guarantee. See [Guided Review access and storage](../guided-review.md#access-privacy-and-storage).
84
+ - **Preferences**: `bro-preferences.md` is sent with every explain, Show,
85
+ BTW, Elevate, and Guided Review request to the selected backend. It is never sent to the advisor or
86
+ to Pi's main model.
87
+ - **Advisor requests**: `bro_advisor` sends the executor agent's system
88
+ instructions, active tool list (excluding `bro_advisor`), ordered
89
+ conversation history including tool calls and tool results (unlike Show,
90
+ which omits them), your steering brief, and the executor's optional question
91
+ to the selected backend. Reasoning and image bodies are omitted with explicit
92
+ markers (`[reasoning omitted]`, `[image omitted]`). The advisor process runs
93
+ in your workspace with auto-approved permissions; its instruction to only
94
+ advise is behavioral, not an enforced boundary.
95
+ - **Access enforcement** differs by backend; see
96
+ [Backends: access and retention](data-and-permissions.md#backends-access-and-retention). Prompt
97
+ instructions are not access enforcement.
98
+ - **Context isolation**: Bro does not add explanations, BTW answers, or the
99
+ steering brief to Pi's conversation history or main-agent context. BTW text
100
+ reaches the main editor only through `/insert` or `/insert-all`, and advisor
101
+ results appear as normal tool results in the executor's transcript.
102
+ - **Saved reviews**: Guided Review records, questions, drafts and captured Git source persist under the host's `getAgentDir()/bro-reviews/`. No automatic cleanup or sync is provided; see [storage and removal](../guided-review.md#access-privacy-and-storage).
103
+ - **Memory**: the latest explanation (for `/bro open`) and the BTW thread live
104
+ only in process memory and clear when you switch Pi sessions, reload
105
+ extensions, or quit Pi. Backend-native sessions can persist independently.
106
+ Standing advisor priorities are stored in `~/.pi/agent/bro-advisor.md`, and
107
+ the session steering brief is stored as session-scoped extension data
108
+ (`bro-advisor-steering`) in the session file.
109
+ - **File safety**: `/bro file` reads only regular files whose resolved path is
110
+ inside Pi's current workspace, including after resolving symlinks. Bro's
111
+ extractor does not modify them.
112
+ - **Web requests**: `/bro url` connects directly to the target website. The site
113
+ sees your IP address and Bro's user agent. Bro sends no browser cookies,
114
+ authorization, or referrer information, and it refuses local, private, and
115
+ reserved network destinations, including redirects. Avoid private or signed
116
+ URLs whose query string contains secrets.
117
+ - **Web extraction**: Bro parses downloaded HTML locally without executing page
118
+ scripts or loading page subresources. It sends the extracted readable text,
119
+ including links preserved in that text, to the selected backend; it does not
120
+ separately send the requested URL or raw page HTML.
121
+ - **Show diagrams**: When a show reply ends in one self-contained HTML block
122
+ or one Mermaid sequence diagram, Bro writes a page to
123
+ `pi-bro-<uid>/bro-show-<hash>.html` in your system temp folder with a
124
+ restrictive Content-Security-Policy, and opens it in your browser only when
125
+ you press **O**. HTML pages run no scripts. Sequence-diagram pages run only
126
+ Bro's bundled Mermaid and its fixed setup script; the model's diagram text is
127
+ inserted as escaped text and nothing is loaded from the network. **C**
128
+ copies the full reply, including the diagram source.
129
+ - **Clipboard**: **C**, `/copy`, `/copy-all`, and Guided Review's Copy finding copy text to your system
130
+ clipboard, where your operating system or clipboard manager may retain it.
@@ -0,0 +1,108 @@
1
+ # Set up models and preferences
2
+
3
+ [Docs home](../README.md) · [All commands](commands.md) · [Safety and permissions](data-and-permissions.md)
4
+
5
+ ## Settings
6
+
7
+ Use `/bro config` to review or change the shared default backend/model/effort
8
+ and any per-capability (explain/show/btw/advisor/review) overrides, the explanation
9
+ mode, and the default show turn count. Changes save immediately. Esc inside a
10
+ picker cancels that pick; Esc on the settings screen closes it, keeping
11
+ whatever was already saved. If the terminal becomes too small, config blocks
12
+ hidden actions; Esc closes config even if a picker was open, after pending saves
13
+ finish. A failed save cancels that close and shows its error inline; if the error
14
+ alone makes config too small, any other key clears it so you can try again. `/bro mode` changes the mode directly (**M** in an explanation
15
+ tries another mode without saving it), and `/bro help` shows the active settings
16
+ and file path.
17
+
18
+ Elevate inherits the **BTW** backend/model/effort selection. There is no separate Elevate setting in this release. See the [Elevate guide](../elevate.md).
19
+
20
+ Settings live in this user-editable file, created when the extension loads
21
+ (under `$PI_CODING_AGENT_DIR` instead when that is set):
22
+
23
+ ```text
24
+ ~/.pi/agent/bro-settings.json
25
+ ```
26
+
27
+ ```json
28
+ {
29
+ "version": 2,
30
+ "default": { "backend": "agy", "model": "gemini-3.7-flash", "effort": "low" },
31
+ "mode": "balanced",
32
+ "showTurns": 1,
33
+ "overrides": {
34
+ "explain": { "backend": "claude", "model": "sonnet", "effort": "medium" },
35
+ "advisor": { "backend": "grok", "model": "grok-4.7", "effort": "high" }
36
+ }
37
+ }
38
+ ```
39
+
40
+ Bro reads the file again before each request, so manual edits apply next time.
41
+
42
+ - Each selection is one atomic backend/model/effort choice. An override pins
43
+ its own complete selection and ignores the shared default, even when it
44
+ happens to match it; select **Default** in `/bro config` to inherit again.
45
+ Omitted overrides inherit `default`.
46
+ - `effort` must be one the backend offers (`default` omits it and lets the
47
+ model decide). Agy selections are normalized against Agy's installed model
48
+ catalog. Claude, Grok, Codex, and Muse accept seeded or custom model IDs; a model/effort
49
+ combination the account does not support fails with the backend's own error
50
+ instead of silently falling back.
51
+ - `mode` is `brief`, `balanced` (the default), or `faithful`. `showTurns` is
52
+ the default number of turns `/bro show` draws (default 1); `/bro show
53
+ <n-turns>` overrides it for one run.
54
+ - `PI_BRO_MODEL` picks the initial Agy model only when Bro creates a missing
55
+ settings file, for example `PI_BRO_MODEL=gemini-3.7-flash-low pi`.
56
+ - Older flat settings files (root `model`/`effort`) still load and mean Agy.
57
+
58
+ ## Preferences
59
+
60
+ Tell Bro about yourself and how you like answers. Bro adds what you write to
61
+ every explain, `/bro show`, `/bro btw`, `/bro elevate`, and Guided Review prompt as a labelled section,
62
+ alongside its own instructions. It never replaces them: modes, **M**, and the
63
+ source rules keep working. The advisor never receives your preferences; use
64
+ `/bro advisor-steer` for it.
65
+
66
+ Run `/bro preferences` to edit them: **Ctrl+S** saves, **Ctrl+K** deletes the
67
+ file, **Ctrl+C** copies, and **Esc** closes without saving. The first time,
68
+ the editor opens with this starter text, which is not saved until you press
69
+ **Ctrl+S**:
70
+
71
+ ```md
72
+ ## About me
73
+ I'm an overworked white-collar worker, and so are my colleagues. By the end of a
74
+ hard day our brains are fried and we can only handle simple language, no matter
75
+ how sharp we are at our best.
76
+
77
+ ## How I like answers
78
+ - Explain it like I'm a simpleton: plain, everyday words.
79
+ - Go easy on analogies. No forced ones.
80
+ ```
81
+
82
+ You can also edit the file directly (under `$PI_CODING_AGENT_DIR` instead when
83
+ that is set):
84
+
85
+ ```text
86
+ ~/.pi/agent/bro-preferences.md
87
+ ```
88
+
89
+ - **Free-form**: no placeholder or structure is required. Bro re-reads the
90
+ file on every request, so edits apply next time. A missing or empty file
91
+ means no preferences, and Bro's prompts are then exactly the built-in ones.
92
+ - **What preferences can change**: wording, tone, technical depth, length in
93
+ BTW, and the answer language. If you name a language, code, commands, paths,
94
+ names, and numbers still stay exactly as written. In `/bro show`,
95
+ preferences only change wording and language. Guided Review also receives preferences for explanation/answer wording; they do not override its evidence or review rules. A per-run choice (the mode,
96
+ **M**, a Show steering query, or what a BTW/review question asks for) wins over a
97
+ standing preference.
98
+ - **Limit**: 4,000 characters, because the text goes with every request. A
99
+ longer file stops explain, Show, BTW, and Guided Review with an error until you trim it;
100
+ Bro never cuts it silently. `/bro doctor` reports the problem, and the
101
+ editor still opens the file so you can fix it.
102
+ - **BTW threads**: when your preferences change, the next side question starts
103
+ a fresh backend session that is caught up on the thread, so old preferences
104
+ don't linger.
105
+
106
+ `bro-prompt.md`, the full prompt template from earlier versions, is no longer
107
+ read. Move what you want to keep into `/bro preferences`, and choose
108
+ `/bro mode brief` for the original ELI-simpleton instruction.
@@ -0,0 +1,55 @@
1
+ # Diagnostics and troubleshooting
2
+
3
+ [Docs home](../README.md) · [All commands](commands.md) · [Safety and permissions](data-and-permissions.md)
4
+
5
+ ## Check your setup
6
+
7
+ Run `/bro doctor` when Bro is newly installed or something is not working. It
8
+ checks Bro's settings and preferences, then probes only the backends some feature
9
+ actually selects, and reports the effective backend/model/effort for each
10
+ feature. Failed checks explain what to fix.
11
+
12
+ - **Agy**: installed version, model catalog, and account access.
13
+ - **Claude Code**: installed version and configured authentication.
14
+ - **Grok**: installed version only; authentication and connectivity are not
15
+ verified.
16
+ - **Codex**: installed version and configured authentication.
17
+ - **Muse**: installed version only; authentication and connectivity are not
18
+ verified.
19
+
20
+ Doctor never sends source text or runs a model completion. A successful check
21
+ confirms the setup but cannot guarantee that a later provider request will
22
+ succeed.
23
+
24
+ ## Troubleshooting and current limits
25
+
26
+ If an explanation fails, run `/bro doctor` first. If a webpage cannot be
27
+ extracted, copy its content into a supported text file or save it as a PDF and
28
+ use `/bro file`. If a PDF contains only scanned images, run OCR with another
29
+ tool before giving it to Bro.
30
+
31
+ - An unsupported model, effort, or missing backend fails with that backend's
32
+ diagnostic; Bro never falls back to another backend.
33
+ - Document input supports `.md`, `.markdown`, `.txt`, `.pdf`, and `.docx` only;
34
+ it does not perform OCR.
35
+ - Webpage input supports one public HTML page, up to 5 MiB downloaded and
36
+ 100,000 extracted characters. JavaScript-only, authenticated, paywalled,
37
+ blocked, paginated, and media-first pages are not supported.
38
+ - Direct webpage fetching does not currently use `HTTP_PROXY`, `HTTPS_PROXY`,
39
+ or other proxy environment variables.
40
+ - `/bro elevate` is pre-execution only. It does not validate expert claims, run source research or keep a persistent thread. Invalid discovery JSON can be retried with the [Retry] button; if it recurs, choose another BTW backend/model in `/bro config`. See [Elevate](../elevate.md).
41
+ - `/bro btw` threads are memory-only and do not survive reloads or restarts.
42
+ - The Agy advisor requires Agy CLI `>=1.1.15`.
43
+ - Show captures only the conversation text of what already happened in the
44
+ current session — the last few turns' user and assistant messages, with
45
+ tool calls, tool results, reasoning, and images always omitted; its shapes
46
+ reflect what was reported in the conversation, not independent verification.
47
+ - Diagrams open in your default browser; pressing **O** on a remote or
48
+ headless session with no display reports the failure instead of opening
49
+ anything.
50
+ - Explain keeps only the latest result in memory and does not export directly to files. Guided Review separately persists review records and captured source.
51
+ - Guided Review is local-Pi interactive only, keeps its captured revision on reopen, and does not publish, review a branch or fetch later PR changes. See [review recovery and limits](../guided-review.md#if-something-goes-wrong).
52
+ - Bro temporarily captures mouse input while its modal is open so mouse-wheel
53
+ and trackpad scrolling work in regular and fullscreen modes. Native mouse
54
+ selection may be unavailable or visually extend outside the Bro window;
55
+ press **C** to copy the full explanation instead.