pi-bro 0.38.0 → 0.39.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to pi-bro are documented here.
4
4
 
5
+ ## [0.39.0] - 2026-11-28
6
+
7
+ ### Highlights
8
+
9
+ - Overthink now delivers one actionable private second look (or silence) per normally settled turn, sharing the exact finding and next move between the above-input preview and `/bro overthink`.
10
+ - Full `/bro overthink` view shows Situation, `[#n]`-resolved Evidence (explicitly tagging compacted/branch summaries and tool results), and Why it matters, while keeping the projected conversation prefix untouched for provider pairing and prompt-cache reuse.
11
+ - Keeps five distinct turn states (**Not checked**, **Checking**, **Checked — nothing material to flag**, **Check failed**, **Finding**) and raises the Overthink `maxTokens` budget to `8192` so reasoning models do not truncate before replying.
12
+
13
+ ### Breaking
14
+
15
+ - Removed editable Overthink question lists (`Ctrl+E` and `/bro config` → Default questions) and forced four-question answers. Legacy global and per-branch empty question lists stay opted out without rewriting saved files or notes until explicitly re-enabled (global toggle in `/bro config`; press `A` in `/bro overthink` to allow an opted-out branch). Historical notes remain readable as legacy assessments.
16
+
17
+ ## [0.38.1] - 2026-11-24
18
+
19
+ ### Maintenance
20
+
21
+ - Split Bro's six backends into separate adapters while keeping commands, settings, and execution behavior unchanged.
22
+
5
23
  ## [0.38.0] - 2026-11-24
6
24
 
7
25
  ### Highlights
package/README.md CHANGED
@@ -65,7 +65,7 @@ File and webpage examples need your own real path or URL; see [how to explain th
65
65
  | `/bro architecture [focus]` | **[Architecture Docs](docs/features/architecture.md).** Inspects the project and writes Markdown, diagrams and an offline interactive `architecture.html` under `docs/architecture/`. Uses BTW model settings. |
66
66
  | `/bro elevate` or **Ctrl+Shift+E** | **[Elevate](docs/features/elevate.md).** Discover missing expert considerations, select useful improvements, and rewrite your task without submitting it. Shares BTW backend settings. |
67
67
  | `/bro remember-me [thought]` | **[Remember Me](docs/features/remember-me.md).** Privately clarify and approve short personal memories with unfoldable background. Agents can call `about_user` to read summaries and expand IDs. |
68
- | `/bro overthink` | **[Overthink](docs/features/overthink.md).** Get a second look from the active Pi model, with four editable questions. Use Ctrl+R to check now; enable automatic checks in config if you want them. |
68
+ | `/bro overthink` | **[Overthink](docs/features/overthink.md).** Get one actionable second look from the active Pi model, with inspectable evidence. Use Ctrl+R to check now; enable automatic checks in config if you want them. |
69
69
  | `/bro grill-me` | **[Grill Me](docs/features/grill-me.md) (experimental).** A private, opinionated decision interview: light, balanced or exhaustive; one question per round; `/consolidate` drafts a brief without ending the interview; `/copy` returns the latest reply or decision brief to the clipboard. Uses BTW model settings; read-only restrictions vary by backend. |
70
70
  | `/bro btw` | **[Side questions](docs/features/btw.md#bro-btw-side-conversation).** A separate conversation seeded with recent context, so you can ask without interrupting the agent. ⚠️ [Full-permission mode](#what-leaves-your-machine) can edit files. |
71
71
  | `/bro guided-review <PR>` | **[Guided Review](docs/features/guided-review.md).** An explanation and quality assessment of a GitHub PR, with ranked findings, source evidence and private questions. Claude, Muse, or Pi is recommended for untrusted PRs. |
@@ -112,7 +112,7 @@ which may keep it under their own policies. Paths below are under
112
112
  | Show | User and assistant text from recent turns (no tool calls, tool results, reasoning or images), plus your preferences | Last result in the private Pi session, plus temporary diagram pages in `pi-bro-<uid>/` |
113
113
  | Side questions | Your questions and up to the last 8 turns of conversation text, plus your preferences | Private Pi session entries with completed turns, mode and draft |
114
114
  | Grill Me | Topic, interview turns, up to the last 8 main-session text turns and preferences; any workspace files the selected inspector reads | Private Pi session entries with the interview and brief |
115
- | Overthink | Current session projection, including tool evidence, plus private user-editable questions and preferences, to the active Pi provider | Global questions in `bro-overthink-defaults.json`; per-session questions and latest private note in Pi session custom entries |
115
+ | Overthink | Untouched current session projection (including tool evidence and summaries), plus review prompt with appended numbered Source index and preferences, to the active Pi provider | Global opt-in in `bro-overthink-defaults.json`; latest private check, failure, and branch opt-out override in Pi session custom entries |
116
116
  | Elevate | Your objective, selected findings, all current-branch user/assistant text; Full also includes tool-call arguments and text results, and preferences | Nothing; the workflow stays in memory |
117
117
  | Guided Review | The PR description and diff, the files the backend reads, your questions, plus your preferences | Reviews and captured source in `bro-reviews/`, with no automatic cleanup |
118
118
  | Advisor | The agent's system instructions, tool list and whole conversation, including tool calls and results (reasoning and images omitted), plus your steering | Steering in `bro-advisor.md` and the session file |
package/docs/README.md CHANGED
@@ -17,7 +17,7 @@ Start with what you want to do. The [README](../README.md) explains the product,
17
17
  - [Document a repository's architecture](features/architecture.md) — create or refresh Markdown, diagrams and an offline HTML map.
18
18
  - [Ask a private side question](features/btw.md#bro-btw-side-conversation) — BTW.
19
19
  - [Remember personal context for agents](features/remember-me.md) — approved short memories, expandable background and the read-only `about_user` tool.
20
- - [Review work quietly with Overthink](features/overthink.md) — same-model second look with editable questions and optional automatic checks.
20
+ - [Review work quietly with Overthink](features/overthink.md) — one actionable same-model second look with inspectable evidence and optional automatic checks.
21
21
  - [Get grilled on a decision](features/grill-me.md) — one question at a time in a private modal, then copy a decision brief.
22
22
  - [Improve a request before sending it](features/elevate.md) — Elevate: discover expert gaps, choose improvements, rewrite the task.
23
23
  - [Investigate a PR](features/guided-review.md) — Guided Review.
@@ -9,7 +9,7 @@ These are **human intentions**, not modes. Run any feature directly. Bare `/bro`
9
9
  | **Explore what could exist:** ask a side question | `/bro btw` | A flexible private conversation |
10
10
  | Challenge a proposal or form a decision | `/bro grill-me` | Reasoned discussion and optional decision brief |
11
11
  | **Get advice on existing work:** review a code change | `/bro guided-review` | Saved findings and code evidence |
12
- | Reconsider substantial work automatically | `/bro overthink` | Private notes when material concerns arise |
12
+ | Reconsider settled work automatically | `/bro overthink` | One actionable private alert (with evidence) when something material merits attention |
13
13
  | Give the agent independent advice | `bro_advisor` (agent tool) | A second opinion returned to the agent |
14
14
  | **Guide the agent:** improve the next assignment | `/bro elevate` | Revised request to copy, edit, and submit |
15
15
  | Remember lasting personal facts/preferences | `/bro remember-me` | Approved memory available through the read-only `about_user` agent tool |
@@ -22,11 +22,11 @@ These are **human intentions**, not modes. Run any feature directly. Bare `/bro`
22
22
 
23
23
  - **Copy is a shared text handoff, not a separate intent state.** Native Pi `/copy` copies immediately; `/bro copy` lets users edit and preview the last reply before copying. It never edits Pi's draft, submits a message or writes to GitHub. You decide where to paste and when to submit. BTW supports latest/all; Grill Me copies its latest reply or brief; Elevate copies a revised assignment; Guided Review copies findings. Retired `/insert` commands tell users to copy instead.
24
24
  - **Resume** restores feature-owned state where needed, not a shared chat engine. The latest Simplify result, BTW and Grill Me restore from private Pi session entries on reload, restart, resume and `/tree`; saved Guided Review, approved Remember Me and steering already have durable state.
25
- - **Clear / Reset / Delete** belong to each feature: BTW resets its thread; Grill Me starts a new interview; Guided Review deletes a specific saved review once cleanup ships; Remember Me deletes a named approved memory; Overthink resets its question defaults.
25
+ - **Clear / Reset / Delete** belong to each feature: BTW resets its thread; Grill Me starts a new interview; Guided Review deletes a specific saved review once cleanup ships; Remember Me deletes a named approved memory.
26
26
  - **Retry / Regenerate** repeats a step without silently losing prior accepted work. Guided Review's regenerate (same captured source) is not update revision (new source).
27
27
  - **Help / Close** share meanings, but a short viewer needs fewer controls than a review or interview.
28
28
 
29
- Do not standardize away distinctive capabilities: Simplify source and modes, Show diagram opening, BTW permissions, Grill Me depth and consolidation, Elevate discovery/selection/rewrite, Guided Review evidence and revisions, Overthink automatic checks/questions, and Remember Me approval/conflict resolution.
29
+ Do not standardize away distinctive capabilities: Simplify source and modes, Show diagram opening, BTW permissions, Grill Me depth and consolidation, Elevate discovery/selection/rewrite, Guided Review evidence and revisions, Overthink automatic checks, and Remember Me approval/conflict resolution.
30
30
 
31
31
  ## Trust and acceptance
32
32
 
@@ -1,66 +1,68 @@
1
1
  # Overthink — private second look
2
2
 
3
- Overthink gives Pi's work a small, skeptical second pass. It checks the direction, the evidence, the risks and the next move, without making a new agent or interrupting the original conversation. It is inspired by [pi-heads-up](https://github.com/Pringled/pi-extensions/tree/main/packages/pi-heads-up).
3
+ Overthink gives Pi's latest settled turn one private, skeptical second look. It asks one question: **Is there something the reply didn't make clear that should change what you do next?** It checks both the work and how the agent handled your direction, without spawning another agent or changing Pi's conversation. It is inspired by [pi-heads-up](https://github.com/Pringled/pi-extensions/tree/main/packages/pi-heads-up).
4
4
 
5
5
  ## Normal use
6
6
 
7
- Automatic checks are **off by default**. To enable them, go to `/bro config` → Features → Overthink. With automatic checks on, after a **fully settled substantial task** (currently at least three tool results across the run), Overthink sends one extra private assessment to the **same active Pi model, at the same thinking level**. A short note appears above the input only if there is something material to flag. If the reply already covered the issue, or there is nothing important to add, Overthink stays quiet. A question-only turn is not enough to trigger a check.
7
+ Automatic checks are **off by default**. To enable them, go to `/bro config` → Features → Overthink. While the pilot is active and automatic checks are on, after a **normally settled user turn** (including zero-tool decisions), Overthink makes one private background call to the **same active Pi model, at the same thinking level**. If there is one consequential thing that should change your next move, a short preview appears above the input:
8
8
 
9
- Run `/bro overthink` to **view** the latest assessment. Opening the modal makes **no model request**. The notes never enter Pi's user/assistant conversation and do not direct the agent to perform work.
9
+ ```text
10
+ ◇ Overthink · Stalling
11
+ Pi stopped the local prototype over public traffic, but its listener
12
+ binds only to localhost. Build the local version as agreed.
13
+ /bro overthink for evidence
14
+ ```
10
15
 
11
- ## Four factory questions
16
+ If nothing material merits attention, Overthink stays quiet. The preview clears as soon as you start a new turn or switch branches.
12
17
 
13
- A new session starts with four questions:
18
+ Run `/bro overthink` to **view** the evidence behind that same finding. Opening the modal makes **no model request**. Notes never enter Pi's user/assistant conversation and do not direct the agent to perform work.
14
19
 
15
- 1. **Direction:** Are we solving the right problem and moving toward the intended outcome?
16
- 2. **Evidence:** What important assumptions or conclusions might be wrong or insufficiently verified?
17
- 3. **Risks:** What material risks, unintended changes, or needless complexity have we introduced?
18
- 4. **Next move:** What correction, decision, or next step would most improve the outcome?
20
+ ## What it checks
19
21
 
20
- Bro still permits up to 32 custom questions and does **one same-model call for the entire list**. When nothing material is missed, the model should answer `NONE` and Overthink stays quiet. Otherwise it must return a brief 2–3-sentence summary followed by **one concise answer for each saved question**, in order, written in plain, everyday words for a tired reader. Saved [preferences](../reference/settings.md#preferences) (`bro-preferences.md`) can adjust tone or answer language on top, without overriding the JSON format, sentence limits, plain-language brevity or review rules. A question without a material concern can say so; it need not invent criticism.
22
+ Overthink looks for one concrete, evidence-backed gap across the work and the working relationship, then optionally tags it with at most one plain label:
21
23
 
22
- **Existing saved global and per-session question lists do not change automatically.** To adopt the four new factory questions, reset the global defaults (Ctrl+D twice, Ctrl+S), then reset the session list (Ctrl+D twice, Ctrl+S). User-edited lists remain intact, even when they contain the former seven questions.
24
+ - **Sucking up** — endorsed your preference against known facts or dropped a supported objection without addressing the evidence.
25
+ - **Half-done** — agreed work is demonstrably unfinished yet presented as done or handed back early despite an available next step.
26
+ - **Overclaimed** — a material claim goes beyond or contradicts what was actually verified.
27
+ - **Overstepped** — an action actually crossed an explicit permission limit.
28
+ - **Stalling** — stopped authorized work over a concern the evidence shows does not apply or has a concrete authorized way forward.
29
+ - **Bloat** — proposed or added avoidable work, components, or decisions when a simpler path delivers the goal.
30
+
31
+ A wrong-goal finding can appear without a label. Silence after a completed check is not certification.
23
32
 
24
33
  ## Viewer
25
34
 
26
- The modal shows a compact check date/model/freshness line, followed by **Summary** and numbered question–answer sections. The original question wording is visible. For the four factory questions, the sections are labeled Direction, Evidence, Risks and Next move. Longer results scroll; short results no longer expand into a mostly empty frame. Earlier plain-text notes stay viewable without being misrepresented as answers to the new questions.
35
+ The full view shows the exact same finding and next move as the preview, plus **Situation**, **Evidence** (citing numbered `[#n]` items from the reviewed context, marking compacted or branch summaries as summaries), and **Why it matters**. It keeps five current-turn states distinct: **Not checked**, **Checking**, **Checked — nothing material to flag**, **Check failed**, and **Finding**. Earlier saved notes stay viewable as **OUTDATED**, and legacy four-question or plain-text notes stay readable as historical assessments without being reinterpreted as new findings.
27
36
 
28
37
  In the modal:
29
38
 
30
- - **Ctrl+R** — force a fresh assessment (also works for smaller tasks). A check uses the **current** session context.
31
- - **Ctrl+E** — edit the questions for **this Pi session**.
39
+ - **Ctrl+R** — recheck the current turn now (works even when automatic checks are off).
40
+ - **A** — allow automatic checks on this branch (shown only on branches with a legacy empty-question-list opt-out).
32
41
  - **?** — show or hide help.
33
- - **U** — show or hide full token/cache/estimated-cost usage details (hidden by default).
34
- - **Ctrl+C** — copy the latest findings.
42
+ - **U** — show or hide provider-reported token/cache/estimated-cost details (hidden by default).
43
+ - **Ctrl+C** — copy the displayed finding as Markdown.
35
44
  - **Esc** — close or leave Help.
36
45
  - **↑/↓** — scroll.
37
46
 
38
- If the last assessment found nothing, the modal says so. The note records the model-relevant session entry it assessed. When a later task (even a trivial turn), compaction, context edit, or branch move changes that position, the viewer explicitly marks the old note **OUTDATED**. Older notes without position metadata are marked **source position not recorded**. Editing questions also marks an existing note as using earlier questions.
39
-
40
- ## Question editor
41
-
42
- The same ordered, editable list is used in both places:
43
-
44
- - **Global defaults:** `/bro config → Features → Overthink → Default questions`.
45
- - **Automatic checks:** `/bro config → Features → Overthink → Automatic checks` toggles the global on/off switch. It starts **Off** unless you previously saved it as On. Turning it off does not delete questions or notes; the viewer and manual **Ctrl+R** still work.
46
- - **Session questions:** `/bro overthink`, then **Ctrl+E**.
47
+ ## Legacy opt-outs and settings
47
48
 
48
- Use **↑/↓** to choose an entry; **Enter** to edit; **Ctrl+N** to add; **Ctrl+X** to delete; **Ctrl+↑/↓** to reorder; **Ctrl+S** to save; **Esc** to cancel. Saving an empty list disables checks. Unsaved changes are protected by a second-Esc warning.
49
+ Automatic checks are toggled in `/bro config → Features → Overthink`. Editable question lists and forced four-question reports are removed from the new flow. Existing saved files and notes are left untouched:
49
50
 
50
- **Ctrl+D** twice resets the editor draft. In the global editor it restores Bro's factory questions; in the session editor it restores the **current global defaults**. Press Ctrl+S to save that reset. A new session inherits the current global defaults once and can then be edited independently. Existing sessions do not change when the global defaults are updated.
51
+ - A legacy empty global question list in `bro-overthink-defaults.json` keeps automatic checks off until you explicitly toggle **Automatic checks** on in `/bro config`.
52
+ - A legacy empty session question list on a branch keeps automatic checks off on that branch even after global automatic checks are turned on; press **A** in `/bro overthink` to allow automatic checks on that branch (this has no effect while global automatic checks are off).
53
+ - Manual **Ctrl+R** checks work either way.
51
54
 
52
55
  ## Model, cache and privacy
53
56
 
54
- Overthink **never** uses the BTW or Bro backend/model setting. It calls Pi's current `modelRegistry.streamSimple` using `buildSessionProjection()` plus a single appended private review instruction. It uses the active physical session model and reasoning level, makes **one call for all questions**, **never executes tools**, and does not add the assessment to the main model context. The request may still contain Pi's tool descriptions as part of the original context; the prompt tells the model to respond in text and not call tools. An unexpected tool-use response is treated as a failed check, not executed. The call sends the session context (including tool evidence exposed by Pi's projection) to that model's provider, under the provider's data policy.
57
+ Overthink **never** uses the BTW or Bro backend/model setting. It calls Pi's current `modelRegistry.streamSimple` using the untouched `buildSessionProjection()` prefix plus one appended private review prompt containing a numbered `[#n]` Source index. Keeping the conversation prefix untouched preserves provider reasoning/tool-call pairing and supports prompt-cache reuse. It uses the active physical session model and reasoning level, **never executes tools**, and does not add results to the main model context. An unexpected `toolUse` response is rejected without executing the tool and recorded as **Check failed**. Saved [preferences](../reference/settings.md#preferences) (`bro-preferences.md`) can adjust tone or answer language without overriding `NONE`, JSON keys, label names, or review rules.
55
58
 
56
- This largely preserves the request prefix and **can** reuse provider prompt-cache input. The benefit varies by provider, model, elapsed time, tool/context changes, other extensions' context hooks, and prompt-cache policy. It does not replicate every live Pi context modification. In Pi 1.3 and 1.5, `context_with_system` can observe a prepared context just before a provider call, while `before_provider_request` can observe a provider-specific payload; neither provides a portable, complete, settled-session request that can simply be appended and replayed through `streamSimple`. A recorded pre-call context also lacks the final agent response that Overthink needs to review. Bro therefore keeps the explicit projection path until a real provider-side comparison shows a safe improvement. **A cached prefix is not free:** high thinking effort can add substantial reasoning tokens on top of the visible-output limit, and both output and reasoning can cost money. Press **U** in the viewer to show *provider-reported* input, cache-read, cache-write, output and reasoning tokens when available; the details are hidden during normal reading. It labels USD cost separately as **estimated cost** from Pi's model price table, not a provider-billed amount; subscription or OAuth users may pay differently. A reported cache-read value of **0** could mean no hit **or unsupported caching**; it is not proof that caching works. Some providers report no usage fields. Check actual billed cost before treating Overthink as cheap.
59
+ Prompt-cache reuse varies by provider, model, elapsed time, and context changes; measure it with **U** in the viewer rather than assuming a hit. **A cached prefix is not free:** high thinking effort can add reasoning tokens on top of visible output. Press **U** to show *provider-reported* input, cache-read, cache-write, output, reasoning tokens, and Pi-table **estimated cost** (not a provider-billed amount). A reported cache-read of **0** may mean either a miss or unsupported caching.
57
60
 
58
- New structured assessments include the exact question snapshot used for that check, so later edits do not relabel earlier answers. Saved notes made by older versions remain plain text. Invalid or incomplete structured model outputs are rejected rather than shown under the wrong question.\n\nOverthink stores editable global defaults in `getAgentDir()/bro-overthink-defaults.json` and session questions plus the **latest** private check in Pi session `custom` entries (`bro-overthink`). Those entries are outside LLM prompts. Session forks inherit their branch's last state; later edits are independent. The viewer resolves only the **latest** note. Pi stores session custom entries by appending, so **each completed check adds another entry to the session file**, even though Bro does not provide a history browser or archive. This is a deliberate reuse of Pi's branch-aware persistence, not a claim that only one physical record exists. Keep this storage growth in mind for long sessions. It does not write to your project files.
61
+ Overthink stores the global automatic opt-in in `getAgentDir()/bro-overthink-defaults.json` and private checks, failures, and branch opt-out overrides in Pi session `custom` entries (`bro-overthink`). Those entries stay outside LLM prompts. Each completed check or failure appends another session custom entry; keep that storage growth in mind for long sessions.
59
62
 
60
63
  ## Limits and verification
61
64
 
62
65
  - The second look is self-criticism by the **same** model; it is not an independent external review. Use `bro_advisor` when a genuinely separate view matters.
63
- - An automatic check can fail without an on-screen error; it must not disturb the main run. Force retry in the modal to see the error.
64
- - Automatic work is triggered at Pi's `agent_settled` lifecycle event (supported from Pi 1.3), not `agent_end`. The earlier event collects tool-use evidence; only a normal final settlement, without queued messages, may start the check. A new agent turn, model change, question edit or session navigation cancels or invalidates stale checks. A returned note is not proof that every listed concern is true.
65
- - Running Heads-up and Overthink together can cause **two extra calls** after a substantive turn. Disable one if that cost is not wanted.
66
- - Host events and cache accounting vary. See [manual qualification](https://github.com/tranhoangnguyen03/pi-bro/blob/main/docs/TESTING.md) before claiming live TUI, PiG or cache-cost behavior.
66
+ - Automatic checks run at Pi's `agent_settled` lifecycle event (supported from Pi 1.3), not `agent_end`. Only a normal final settlement with no queued messages may start a check. A new turn, model change, compaction, or branch move cancels or invalidates stale checks.
67
+ - Running `pi-heads-up` and Overthink together causes **two extra calls** on overlapping turns. Disable one when evaluating attention cost or billing.
68
+ - Host events, provider compatibility with numbered review copies, and cache accounting vary. See [manual qualification](https://github.com/tranhoangnguyen03/pi-bro/blob/main/docs/TESTING.md) and the [pilot evaluation plan](https://github.com/tranhoangnguyen03/pi-bro/blob/main/docs/plans/2026-11-25-overthink-replacement-eval.md).
package/docs/overthink.md CHANGED
@@ -8,7 +8,7 @@ This guide moved to [Overthink](features/overthink.md). The links below take you
8
8
 
9
9
  ## Four factory questions
10
10
 
11
- [Four factory questions](features/overthink.md#four-factory-questions)
11
+ [What it checks](features/overthink.md#what-it-checks)
12
12
 
13
13
  ## Viewer
14
14
 
@@ -16,7 +16,7 @@ This guide moved to [Overthink](features/overthink.md). The links below take you
16
16
 
17
17
  ## Question editor
18
18
 
19
- [Question editor](features/overthink.md#question-editor)
19
+ [Legacy opt-outs and settings](features/overthink.md#legacy-opt-outs-and-settings)
20
20
 
21
21
  ## Model, cache and privacy
22
22
 
@@ -31,13 +31,13 @@ Typing `/bro ` suggests `simplify`, `btw`, `guided-review`, `architecture`, `ele
31
31
  | `/bro doctor` | Check Bro's settings, preferences, and each selected backend, with the effective backend/model/effort per feature. |
32
32
  | `/bro mode [brief\|balanced\|faithful]` | View or choose the explanation mode. |
33
33
  | `/bro preferences` | View or edit what Bro knows about you and how you like answers; see [Preferences](settings.md#preferences). |
34
- | `/bro config` | Open Global (defaults, preferences and Doctor) or Features (per-feature overrides, BTW inheritance, Overthink automatic checks/default questions and Advisor steering). |
34
+ | `/bro config` | Open Global (defaults, preferences and Doctor) or Features (per-feature overrides, BTW inheritance, Overthink automatic checks and Advisor steering). |
35
35
  | `/bro architecture [focus]` | Read the current project and create or refresh `docs/architecture/` with Markdown, an editable graph and offline HTML. Inherits BTW backend settings. [Guide](../features/architecture.md). |
36
36
  | `/bro guided-review <PR number or URL>` | Automatically explain and assess a captured PR in local Pi, with source evidence and optional private questions. Opening the same PR restores its saved review. |
37
37
  | `/bro guided-review` | List saved reviews; `resume` is an alias. |
38
38
  | `/bro guided-review delete [PR number or URL]` | Choose and confirm deletion of a saved review and its captured source. Without a target, opens the saved-review picker. |
39
39
  | `/bro remember-me [thought]` | Start a private memory-writing conversation, browse and expand memories, and approve saves explicitly. [Guide](../features/remember-me.md). |
40
- | `/bro overthink` | View the latest private second-look notes, without a model call. Ctrl+R retry, Ctrl+E edit session questions, U usage details, ? help, Ctrl+C copy. [Guide](../features/overthink.md). |
40
+ | `/bro overthink` | View the latest private second look and evidence, without a model call. Ctrl+R recheck, U usage details, ? help, Ctrl+C copy. [Guide](../features/overthink.md). |
41
41
  | `/bro grill-me [topic]` | Private one-question-at-a-time decision interview. Supply a topic to start fresh; omit it to resume. `/consolidate` drafts a brief; `/copy` copies the latest reply or brief; Pi's editor stays untouched. `/help` lists modal controls. [Guide](../features/grill-me.md). |
42
42
  | `/bro elevate [request]` | Improve an assignment before execution. Discover up to five gaps, choose useful findings, and copy the revised request. Pi's editor is never changed. **Ctrl+Shift+E** can use your unsent draft. See [Elevate](../features/elevate.md). |
43
43
  | `/bro btw [question]` | Open a side conversation in a modal, seeded with recent main-session context. Starts conversation-only; `/mode` toggles full workspace access; `/copy` and `/copy-all` copy the latest answer or full thread. |
@@ -96,7 +96,7 @@ See [feature guide](../features/architecture.md).
96
96
 
97
97
  - **Copy Markdown:** `/bro copy` reads the last completed assistant reply from the current Pi session and lets you edit it in a temporary modal. Preview renders locally. Ctrl+C writes to the system clipboard, which other apps may read. No backend request, saved file, session record, or Pi message changes.
98
98
 
99
- - **Overthink requests:** when you trigger a manual check, or after a substantive Pi turn if you opted into automatic checks, Bro makes one additional provider call using Pi's active model and current session conversation projection (including exposed tool evidence), appending the current session's questions and any saved `bro-preferences.md` (for tone and language only). Overthink never executes tool calls. It may still send tool descriptions copied from Pi's existing context to support cache reuse; a tool-use response is rejected without executing the tool. The provider may retain input under its policy. Results and questions are stored in private Pi session custom entries, not LLM turns; global questions use `bro-overthink-defaults.json` in the agent home. This cannot promise a cache hit or fixed incremental cost. Features → Overthink has an on/off switch (off by default). The viewer displays provider-reported input/cache-read/cache-write/output/reasoning tokens and USD cost when available; a reported cache-read value of zero may mean either a cache miss or unsupported caching. See [Overthink](../features/overthink.md).
99
+ - **Overthink requests:** when you trigger a manual check, or after a normally settled Pi turn if you opted into automatic checks, Bro makes one additional provider call using Pi's active model and the untouched current session projection (including exposed tool evidence and compaction/branch summaries), appending the Overthink review prompt with a numbered `[#n]` Source index and any saved `bro-preferences.md` (for tone and language only). Overthink never executes tool calls; a `toolUse` response is rejected without executing the tool and recorded as a check failure. The provider may retain input under its policy. Results, failures, and branch opt-out overrides are stored in private Pi session custom entries, not LLM turns; the global automatic setting uses `bro-overthink-defaults.json` in the agent home (preserving any legacy saved question list). Keeping the prefix untouched supports provider cache reuse, but this cannot promise a cache hit or fixed incremental cost. Features → Overthink has an on/off switch (off by default). The viewer displays provider-reported input/cache-read/cache-write/output/reasoning tokens and USD cost when available; a reported cache-read value of zero may mean either a cache miss or unsupported caching. See [Overthink](../features/overthink.md).
100
100
 
101
101
  - **External requests**: Bro sends the latest completed assistant response,
102
102
  pasted text, extracted document text, extracted webpage text, or recent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-bro",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "A sidekick for you and your Pi agent: plain-language explanations, side questions, diagrams, PR review and second opinions, without cluttering the agent's context.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -55,7 +55,6 @@
55
55
  "src/grill-engine.ts",
56
56
  "src/overthink.ts",
57
57
  "src/overthink-state.ts",
58
- "src/overthink-questions-ui.ts",
59
58
  "src/copy.ts",
60
59
  "src/last-assistant.ts",
61
60
  "src/remember-store.ts",
@@ -80,6 +79,14 @@
80
79
  "src/modal-kit.ts",
81
80
  "src/composer-modal.ts",
82
81
  "src/backend.ts",
82
+ "src/backends/agy.ts",
83
+ "src/backends/claude.ts",
84
+ "src/backends/cli-process.ts",
85
+ "src/backends/codex.ts",
86
+ "src/backends/contract.ts",
87
+ "src/backends/grok.ts",
88
+ "src/backends/muse.ts",
89
+ "src/backends/pi.ts",
83
90
  "src/cli-auth.ts",
84
91
  "src/prompt.ts",
85
92
  "src/vendor/mermaid.min.js",
package/src/advisor.ts CHANGED
@@ -225,10 +225,6 @@ function advisorActivityPreview(label: string): string {
225
225
 
226
226
  export type AdvisorActivityCallback = (label: string, timestamp: number) => void;
227
227
 
228
- // Thin wrapper around the shared backend: advisor's stdin/stream-json transport, activity parsing,
229
- // and process lifecycle now live in backend.ts (see docs/plans/2026-09-19-bro-advisor-design.md,
230
- // "Transport" for why stdin rather than --print). This function keeps its exact existing
231
- // signature/throw contract -- it is called directly by tests and by runAdvisor below.
232
228
  export class TerminalConsultError extends Error {
233
229
  readonly status: "failure" | "cancelled" | "timeout";
234
230
  constructor(status: "failure" | "cancelled" | "timeout", message: string) {
@@ -237,6 +233,7 @@ export class TerminalConsultError extends Error {
237
233
  }
238
234
  }
239
235
 
236
+ // Adapters own the transport and activity parsing; the consultation translates terminal outcomes into errors.
240
237
  export async function runAdvisorConsultation(
241
238
  prompt: string,
242
239
  selection: BackendSelection,