paseo-follow-up 1.4.0-beta.0 → 1.4.0-beta.10

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.
Files changed (77) hide show
  1. package/OVERVIEW.md +14 -3
  2. package/README.md +56 -3
  3. package/client/about.tsx +132 -0
  4. package/client/agents.tsx +127 -0
  5. package/client/brief.tsx +189 -68
  6. package/client/chat.tsx +12 -4
  7. package/client/display.tsx +22 -4
  8. package/client/home-chrome.tsx +69 -17
  9. package/client/home-list.tsx +20 -10
  10. package/client/home-view.ts +55 -8
  11. package/client/home.tsx +69 -14
  12. package/client/inbox-store.ts +15 -7
  13. package/client/keys.ts +3 -0
  14. package/client/large.tsx +9 -10
  15. package/client/live.tsx +8 -6
  16. package/client/needs-you.tsx +2 -0
  17. package/client/panel.tsx +19 -13
  18. package/client/pill.tsx +12 -6
  19. package/client/pr-controls.tsx +19 -6
  20. package/client/reviewers.tsx +172 -0
  21. package/client/settings.tsx +6 -0
  22. package/client/visibility.ts +7 -0
  23. package/client/workspace-data.ts +37 -0
  24. package/docs/screenshots/decision-card-answered-phone-light.png +0 -0
  25. package/docs/screenshots/decision-card-expanded-chat-light.png +0 -0
  26. package/docs/screenshots/decision-card-partial-phone-dark.png +0 -0
  27. package/docs/screenshots/decision-card-unanswered-phone-dark.png +0 -0
  28. package/docs/screenshots/reviewers-picker-phone.png +0 -0
  29. package/docs/screenshots/reviewers-picker.png +0 -0
  30. package/docs/screenshots/reviewers-sheet.png +0 -0
  31. package/index.client.tsx +13 -3
  32. package/index.server.ts +276 -66
  33. package/package.json +5 -3
  34. package/server/about.ts +397 -0
  35. package/server/agent-actions.ts +38 -10
  36. package/server/agent-hook.mjs +78 -13
  37. package/server/agent-mcp.ts +1 -104
  38. package/server/agent-settings.ts +124 -0
  39. package/server/ai-jobs.ts +220 -0
  40. package/server/daemon.ts +133 -101
  41. package/server/directory.ts +165 -0
  42. package/server/etag.ts +14 -0
  43. package/server/github.ts +5 -2
  44. package/server/governor.ts +7 -2
  45. package/server/hook-source.ts +1 -1
  46. package/server/inbox-directory.ts +14 -19
  47. package/server/inbox.ts +31 -4
  48. package/server/mcp-registrations.ts +113 -0
  49. package/server/mcp-source.ts +1 -1
  50. package/server/mcp.d.mts +14 -0
  51. package/server/mcp.mjs +17 -4
  52. package/server/native-tools.ts +68 -0
  53. package/server/overseer-prompt-source.ts +1 -1
  54. package/server/overseer-prompt.md +1 -0
  55. package/server/overseer.ts +72 -8
  56. package/server/pr-actions.ts +13 -8
  57. package/server/questions.ts +1 -1
  58. package/server/ranker.ts +313 -0
  59. package/server/recovery-config.ts +17 -0
  60. package/server/reviewer-config.ts +131 -0
  61. package/server/session-mcp.ts +2 -2
  62. package/server/transcript.ts +66 -0
  63. package/server/trust-bypass.ts +104 -0
  64. package/shared/about.ts +226 -0
  65. package/shared/agent-settings.ts +169 -0
  66. package/shared/attention.ts +2 -2
  67. package/shared/brief.ts +50 -5
  68. package/shared/chat.ts +8 -3
  69. package/shared/contracts.ts +35 -3
  70. package/shared/display.ts +16 -1
  71. package/shared/home.ts +2 -2
  72. package/shared/overseer.ts +10 -2
  73. package/shared/questions.ts +17 -0
  74. package/shared/ranker.ts +135 -0
  75. package/shared/resources.ts +4 -0
  76. package/shared/reviewers.ts +75 -2
  77. package/shared/search.ts +25 -5
package/OVERVIEW.md CHANGED
@@ -5,7 +5,9 @@ Follow-up watches every pull request a Paseo workspace opens until the work is a
5
5
  ## What you see
6
6
 
7
7
  - Home: every workspace grouped by what it needs from you (Needs you, Follow-up is fixing, Running, Waiting on others, Quiet), with the selected one beside the list so you can allow a permission, answer, merge, reply or sign off in place, and a brief with what Follow-up did while you were away. Above the list: the status counts, provider limits from Smart Session when it's installed, a search over names, branches, PRs, agents and asks, and a sort menu (Priority, Recent, Oldest waiting, Name, By project).
8
- - The Overseer (1.4 beta), pinned on Home: one agent you talk to about all your workspaces. It forwards your asks to the agent that owns them, asks you when it isn't sure, and starts a new workspace only when you say so.
8
+ - The Overseer (1.4 beta), pinned on Home: one agent you talk to about all your workspaces. It forwards your asks to the agent that owns them, asks you when it isn't sure, and starts a new workspace only when you say so. You can ask it from Home's search box (the last row, "Ask the Overseer: …") or with ⌘K → Follow-up: Ask the Overseer.
9
+ - AI priority (1.4 beta): Home's Priority sort ranked from your Linear issues, Slack DMs and mentions, GitHub review requests and the weekly plan, each row with a one-line reason that names its source. It runs hourly on workdays, only when something changed, and Re-rank now is in the sort menu.
10
+ - What's this about?, a collapsible section at the top of Home's detail pane and the workspace panel: a one-line gist, a short AI overview of what the workspace is for and where it stands, and its linked Linear issues, PRs, Slack threads and docs.
9
11
  - A workspace panel for the open workspace only, with a Home button: PRs merged, what needs you, what needs fixing, a bar with one segment per PR, and what the agent is doing now. "Open full" on Home docks it beside the agent's chat.
10
12
  - A Needs you card with one button per decision: Send repairs, Merge, Resume, Retry, or Answer.
11
13
  - Questions from the main agent, each with a permanent ref (Q1, Q2…), lettered options, the agent's recommendation and what it does while it waits. Pick an option, add a note and Send it to the agent, or Copy it instead. Answered questions stay listed under their ref, and the question mode setting (Stop, Work around, Keep building) tells agents what to do until you answer.
@@ -26,14 +28,23 @@ Auto-send ("Send repairs automatically") is on by default for every followed wor
26
28
 
27
29
  ### What agents can do for you
28
30
 
29
- Every root agent Paseo launches (tracked or not) gets Follow-up's action tools: `list_prs`, `add_reviewers`, `merge`, `enable_merge_when_ready`, `disable_merge_when_ready`, `send_repairs`, `set_auto_send`, `clear_hold`, `retry_batch`, `track`, `inbox_list`, `sign_off`, `snooze`, `set_finish_flags` and `set_priorities` (external priorities for Home's Priority sort, kept in `plugin-data/follow-through/priorities.json`). Each runs the server path its button runs, with the same guards (tracked workspace, hold, PR eligibility, merge blockers), across every tracked workspace, so an orchestrating agent can act "on all" when you ask it to. Tools that act on a list, and merge, return a dry run and run only with `confirm: true` and that plan's id; merge is marked destructive and the list tools read-only. Inbox tools act on other agents only: an agent can't sign itself off. Recovery agents, contributors and subagents never get them, and the daemon re-checks the caller on each call. Each agent action is kept in the inbox's delivery ledger as `by: "agent:<id>"`; it never counts as you writing to an agent. A sign-off is still a sign-off made on your behalf, so it clears the flag. There is no tool to untrack or archive a workspace, or to put one on hold, because Follow-up has no button for those either.
31
+ Every root agent Paseo launches (tracked or not) gets Follow-up's action tools: `list_prs`, `add_reviewers`, `merge`, `enable_merge_when_ready`, `disable_merge_when_ready`, `send_repairs`, `set_auto_send`, `clear_hold`, `retry_batch`, `track`, `inbox_list`, `sign_off`, `snooze`, `set_finish_flags`, `set_priorities` and the read-only `workspace_about` (a workspace's overview and linked items) (external priorities for Home's Priority sort, kept in `plugin-data/follow-through/priorities.json`). Each runs the server path its button runs, with the same guards (tracked workspace, hold, PR eligibility, merge blockers), across every tracked workspace, so an orchestrating agent can act "on all" when you ask it to. Tools that act on a list, and merge, return a dry run and run only with `confirm: true` and that plan's id; merge is marked destructive and the list tools read-only. Inbox tools act on other agents only: an agent can't sign itself off. Recovery agents, contributors and subagents never get them, and the daemon re-checks the caller on each call. Each agent action is kept in the inbox's delivery ledger as `by: "agent:<id>"`; it never counts as you writing to an agent. A sign-off is still a sign-off made on your behalf, so it clears the flag. There is no tool to untrack or archive a workspace, or to put one on hold, because Follow-up has no button for those either.
30
32
 
31
33
  ## Data and access
32
34
 
33
- This is a trusted, unsandboxed plugin. It reads workspace metadata, saved agent history and configuration, GitHub status and existing CLI authentication, and keeps its state in `plugin-data/follow-through` on the daemon host. It registers scoped MCP tools and reversible provider hooks for tracked sessions and, while the Needs-you inbox is on, the `needs_you` tool and its Stop-hook nudge for root agents (see below). To find the spec link it reads completed Claude Artifact publish results in the workspace's root sessions, never page content, chat links or the repository; a link you set wins over the agent's, which wins over detection. Repair prompts go to your configured agent and provider. For the provider meters it calls the Smart Session plugin's `smart-session.subscriptions` and `smart-session.budget` RPCs at most once a minute, or reads the newest rows of its `plugin-data/smart-session/accounts-YYYY-MM.jsonl`; it never asks ZeroSub to refresh or switch. It has no Slack identity and no background channel scanning; replies to stakeholders need your authorization and a sent-message receipt from the agent.
35
+ This is a trusted, unsandboxed plugin. It reads workspace metadata, saved agent history and configuration, GitHub status and existing CLI authentication, and keeps its state in `plugin-data/follow-through` on the daemon host. It attaches scoped agent tools per session (served by Paseo's own MCP as `follow_*` on Paseo 0.15+, a per-launch stdio bridge otherwise; never a global MCP registration, and it removes the user-scope `follow-through` entry older versions wrote, keeping a `.follow-through-unregister.bak` of each file) and reversible provider hooks for tracked sessions and, while the Needs-you inbox is on, the `needs_you` tool and its Stop-hook nudge for root agents (see below). To find the spec link it reads completed Claude Artifact publish results in the workspace's root sessions, never page content, chat links or the repository; a link you set wins over the agent's, which wins over detection. Repair prompts go to your configured agent and provider. For the provider meters it calls the Smart Session plugin's `smart-session.subscriptions` and `smart-session.budget` RPCs at most once a minute, or reads the newest rows of its `plugin-data/smart-session/accounts-YYYY-MM.jsonl`; it never asks ZeroSub to refresh or switch. It has no Slack identity and no background channel scanning; replies to stakeholders need your authorization and a sent-message receipt from the agent.
36
+
37
+ Follow-up reads Paseo's agent, workspace and project lists into one in-memory directory shared by discovery, runtime checks, the Needs-you inbox, the Overseer and every client RPC. It reads the lists once at start, then patches the directory from lifecycle events: turn started or ended, permission requested or resolved, agent created, closed or archived, workspace created or archived. A change marks it dirty, and a dirty directory re-reads at most once a minute; a clean one re-reads every ten minutes. Before anything that would load an agent (a timeline or provider-subagent read), Follow-up re-reads that one agent, because the cached copy may predate Paseo unloading it. Provider subagents are asked about only when a send is due or waiting for acknowledgment, or completion is being checked. The Done label is sent only when it changes. In the app, the panel, the larger view and the pill draw from the client's shared workspace poll, which runs every 15 s plus a refresh shortly after Paseo reports an agent change. The inbox runs the same way and passes the tag of the list it holds, so an unchanged list comes back empty. Display preferences re-read once a minute. None of these poll while the app is hidden.
38
+
39
+ Reviewer lists live in `plugin-data/follow-through/reviewers.json` (owner-only), apart from `state.json`. Each list is per repository, plus a default for repositories without one, and each user keeps their own. Collaborator and team suggestions are read with `gh api` only when you open Add reviewer. They are cached for ten minutes, and never polled.
34
40
 
35
41
  The Needs-you inbox (beta) keeps one flag per root agent in `plugin-data/follow-through/inbox.json`. When a turn starts it reads the newest user message from the agent's recent timeline to tell your messages from automation, and it reads, never writes, Defer's `plugin-data/defer/queue.json`, Smart Session's `plugin-data/smart-session/compactions.json`, Session Guard's `plugin-data/session-guard/state.json` and Paseo's schedule records. An unknown or unreadable format counts as your message, which clears a flag rather than adding one. Signing off also clears Paseo's own unread dot for that agent. The first-run import and the restart check read only Paseo's agent list: an agent's last activity is its unread time or your last message to it, never Paseo's `updatedAt` (which the daemon rewrites in bulk), and they don't fetch timelines, which would load every agent. Closed and archived agents are never imported. Turning the inbox off stops all of this.
36
42
 
37
43
  The brief (beta) is stored on the agent's inbox entry and appended to its timeline as a Follow-up row; re-appending replaces that row, and the restart check ignores the `updatedAt` change the append causes because it never reads `updatedAt`. To build a brief Follow-up reads only what it already has: the agent's `needs_you` call, the permission request's title, the failed turn's error message, Session Guard's note and reset time for a paused agent, and its own PR state. It does not read or quote the agent's reply. While the inbox is on, every root Paseo agent on Claude Code or Codex gets Follow-up's MCP bridge with the `needs_you` tool only (tracked main agents keep their full set), and `plugin-data/follow-through/brief.json` records whether the inbox and the nudge are on and which agents have a permission prompt showing. Clicking an option or Retry sends one message as you; it is logged in the delivery ledger as yours, so it clears the flag. The Stop hook, part of the same reversible provider hooks Follow-up already installs, now also runs for those root Claude Code sessions: if the turn ended without `needs_you`, it blocks the stop once with a one-line request to call it, records that it did in `hook-state`, and never blocks the same turn again. It reads `brief.json`, its own per-turn marker and the time of the agent's last `needs_you` call, and nothing else. Turn it off with *Ask agents to state what they need*; turning the inbox off stops it too.
38
44
 
39
45
  The Overseer (beta) is one Claude agent in a Follow-up workspace under `plugin-data/follow-through/overseer-home`, labelled `follow-up.overseer=1` and created only when you click Start. Its id is kept in `plugin-data/follow-through/overseer.json`. Discovery, tracking, auto-send and Needs you skip its workspace. At the start of each of its turns, the provider hook adds a digest from `plugin-data/follow-through/overseer-digest.json` and records what it showed in `hook-state/overseer-seen-<agent>.json`. The worker builds that file from Paseo's workspace list (metadata only, at most once a minute) and Follow-up's own state. It rewrites the file only when the content changes, and skips it while the resource governor pauses background work. Its tools are `workstreams`, `agent_digest`, `route_candidates`, `send_to_agent` and `start_workspace`. For an agent that isn't loaded, `agent_digest` reads the provider's transcript on disk, read-only (Claude Code's `projects/<cwd>/<session>.jsonl`, Codex's `sessions/**/rollout-*-<thread>.jsonl`; only the last 512 KB, and never the credentials in Paseo's agent record). Without a transcript it uses Follow-up's goal and PR titles. It never reads that agent's timeline. `send_to_agent` writes your words to the delivery ledger first: as yours only when they answer that agent's open ask, otherwise as Follow-up's. It wakes a resting agent only because you asked for it. `start_workspace` runs only after your approval, through a dry run and confirm. The Overseer can't merge, archive or post anywhere.
46
+ "What's this about?" keeps its overviews in `plugin-data/follow-through/about.json` (gist, overview, linked rows, when and from what; never raw history) and logs each model call's duration and cost to `ai-jobs.jsonl`. To write one it reads the root agent's latest steps from its live timeline only when Paseo already has the agent loaded; otherwise it reads the first and last part of the agent's provider transcript on disk (Claude Code's `~/.claude/projects`, Codex's `~/.codex/sessions`), read-only, and never wakes the agent. It reads subagent titles from Paseo's agent list, PR titles and bodies with `gh pr view`, and only the Linear issues and Slack threads the workspace itself links, through `mcpproxy call tool-read` (`linear:get_issue`, `slack-user:slack_read_thread`); there are no searches. The model is set under Settings → Agents (default Haiku). With Claude it runs as a headless `claude -p` with no tools, no MCP servers, no settings and no saved session. With Codex it runs as `codex exec --ephemeral` with no user config or rules, no shell tool and a read-only sandbox in an empty temporary folder. Either way it gets one turn, a 90-second timeout, and runs one call at a time; on timeout the whole process group is killed. Overviews are written ahead of time only for non-dormant workspaces in Needs you, at most 60 a day by default (Settings → Agents), and not while a Claude account is above 85% of a limit or the resource governor has paused background work; above its higher threshold, opening the section shows the cached overview and writes none.
47
+
48
+ Settings → Agents (`plugin-data/follow-through/agents.json`, its own file) chooses the provider, model, effort and mode for What's this about?, the Overseer, recovery agents and the priority ranker. Missing or invalid entries use the defaults. The provider and model list comes from Paseo's provider snapshot. It is read only when that settings screen opens, and cached for ten minutes. A changed Overseer setting is never applied mid-conversation: Home offers a restart, and the new Overseer is handed the old one's last steps (read from its transcript on disk when it isn't loaded). The old agent is left as it is. A recovery agent on a different provider than the main agent keeps the main agent's system prompt, MCP servers and tool policy, and drops its provider-specific model, mode and options. `FOLLOW_UP_OVERSEER_PROVIDER` ("provider/model") overrides the Overseer's setting; it exists only for isolated test daemons.
49
+
50
+ The ranker behind AI priority (beta) runs inside Follow-up's worker as bounded one-shot jobs (Claude or Codex, per the ranker role) through the shared job runner (`server/ai-jobs.ts`), one at a time and only while the resource governor allows background work. It reads Follow-up's own state, `mcpproxy call tool-read` for `linear:list_issues` (assigned to you) and `slack-user:slack_search_public_and_private` (DMs and mentions, last 48 hours), `gh search prs --review-requested=@me`, and the planning artifact through one Claude turn limited to the Artifact tool. It hashes those inputs and calls the model only when they changed. It writes only `plugin-data/follow-through/priorities.json` (its ranking, which replaces its previous one) and `ranker.json` (input hash, run count, source health, the day's plan summary, and Linear issues no workspace covers). It never stores raw artifact HTML or share keys. The provider, model, cadence and daily cap come from the ranker role in Settings → Agents; the plan reader always uses Claude, the only provider with the Artifact tool.
package/README.md CHANGED
@@ -56,6 +56,18 @@ Tap a PR, or its segment in the bar, for a sheet with its checks, reviewers and
56
56
 
57
57
  ![The PR sheet for a PR whose required checks failed](docs/screenshots/follow-up-pr.png)
58
58
 
59
+ ### Reviewers
60
+
61
+ **Add reviewers** asks the people you've set for that repository. Set them in **Settings → Follow-up → Reviewers**:
62
+
63
+ - Each repository Follow-up has seen a PR in gets its own list. **Default for all repos** covers every repository without one.
64
+ - **Add reviewer** suggests the repository's collaborators and teams from GitHub. You can also type a login (`octocat`) or a team as `org/team`.
65
+ - Remove a reviewer with its ×. The arrow moves a reviewer earlier in the list.
66
+
67
+ The PR sheet says who will be asked. **Edit…** opens a picker where you check or uncheck people for that PR only. **Remember for owner/repo** saves the choice as that repository's list. With nobody set, **Add reviewers** opens the picker straight away. The PR author is never asked.
68
+
69
+ The lists are yours, not your team's. Each person who installs Follow-up sets their own. If you upgrade from a version that hardcoded reviewers, each repository keeps the reviewers you last requested there. A fresh install starts empty.
70
+
59
71
  The expand icon next to the gear (or **Follow-up: open the larger view** in ⌘K) opens the workspace as a full screen, in two columns when there is room: what needs you on the left, the stacks and activity on the right. Esc or the collapse icon takes you back.
60
72
 
61
73
  ![The larger view: Needs you, tasks and activity on the left, pull request stacks on the right](docs/screenshots/follow-up-large.png)
@@ -109,6 +121,16 @@ The Follow-up sidebar row (and ⌘K → **Follow-up: Home**) opens **Home**: eve
109
121
  - **Provider limits** under it, from the [Smart Session](https://www.npmjs.com/package/paseo-smart-session) plugin: one line per provider, such as "Claude 5h 62% · 7d 41% · resets 14:10". Amber from 80%, red at the limit; tap a line to see each ZeroSub account. The age shows when the reading is older than 15 minutes. Without Smart Session the line isn't there.
110
122
  - **Search** ("Search workspaces, branches, PRs"; `/` or ⌘K → **Follow-up: Search** focuses it) matches workspace names, branches, PR numbers ("#1402" or "1402") and titles, agent and subagent titles, the project, Linear keys such as HER-1312, and the current ask. Words can come in any order, prefixes count and one typo is forgiven. Results are one ranked list (name above branch and PR above the ask, then recency) with the matched words marked and each row's group as a chip; archived workspaces come last. ↑/↓ move, Enter opens the result on the right, Esc clears.
111
123
  - **Sort** (the menu beside search, remembered on this device): **Priority** (default), **Recent**, **Oldest waiting**, **Name** and **By project**. It orders rows inside each group; groups stay in place and search ignores it. Priority means urgency: blocking asks, then decisions only you make, then finished turns; inside those, a big open question first, then the nearest task deadline, then the oldest ask. When an agent has ranked workspaces with `set_priorities` in the last 6 hours, Priority uses those scores inside Needs you (blocking asks still first), each row shows the ranker's one-line reason and source, and the menu says "Ranked 12m ago"; otherwise it says "By urgency". Follow-up never writes a reason itself.
124
+ #### What's this about?
125
+
126
+ When a workspace's name doesn't remind you what it's for, open **What's this about?** at the top of Home's detail pane or the workspace panel (under Home). It's collapsed by default and remembers open or closed on this device. Collapsed, it shows a one-line gist once one is written ("Fix slow vendor-activity query; PR #1352 merged, waiting on Hadar"). Open, it shows:
127
+
128
+ - **An overview**: two to four plain sentences on what the workspace is for, where it stands and what it's waiting on, written by a small model from the root agent's first messages and latest steps, its subagents' titles, its PRs and the linked issues. While it's being written you see "Summarizing…" with the first message.
129
+ - **Linked**: Linear issues (key, title, state, priority, due), PRs (number, title, state), Slack threads (channel, who, a one-line excerpt) and claude.ai or doc links the agent shared, each with a source chip. Links are only ever found in the workspace's own text, never written by the model; with none it says "No linked issues or threads found".
130
+ - **A footer** with when and from what it was summarized ("Summarized 2h ago from the saved transcript, 2 PRs, HER-1312"), any source that couldn't be read, and **Refresh**.
131
+
132
+ An overview is written when you open the section and none exists, or when the inputs changed and it's over an hour old, or on Refresh. Workspaces in Needs you get one ahead of time (at most 60 a day). Agents can read it with the read-only `workspace_about` tool.
133
+
112
134
  ![Home: the list grouped into Needs you, Follow-up is fixing, Running and Waiting on others, with a permission selected and Allow / Deny, Sign off and the agent's last steps on the right](docs/screenshots/follow-up-home.png)
113
135
 
114
136
  - ⌘K: **Follow-up: Home**, **Follow-up: Search**, **Follow-up: Sign off & next**, **Follow-up: Later (tomorrow 09:00)**, **Follow-up: Next needs-you**, **Follow-up: Done while you were away**.
@@ -117,6 +139,8 @@ The Follow-up sidebar row (and ⌘K → **Follow-up: Home**) opens **Home**: eve
117
139
 
118
140
  One agent you talk to about all your workspaces. It sits pinned at the top of Home's list, under the morning brief. Click **Start the Overseer** once, and Follow-up creates it in its own workspace, which is never tracked, never shown under Needs you, and never sent repairs. Its row shows whether it is idle, working, or asking you something. Selecting it opens the conversation in the right pane with a reply box, and **Open full** opens its chat.
119
141
 
142
+ **Ask from anywhere.** Type in Home's search box and the last row is always **Ask the Overseer: <what you typed>**. Arrow down to it and press Enter (or tap it), and it goes to the Overseer as you wrote it. The search clears and its conversation opens. If no workspace matches, it is the only row, so Enter sends it straight away; a single word that matches nothing waits for ↓ or a tap, so a typo never reaches an agent. The first ask starts the Overseer, so you don't have to click Start first. While the Overseer is on, ⌘K → **Follow-up: Ask the Overseer** opens it from any screen with the reply box focused. Both work on the phone too.
143
+
120
144
  - **It routes your asks; it doesn't do the work.** "Tell the HER-1312 agent to use option A" goes to the agent that owns HER-1312, and the Overseer answers in one line: "Sent to Okta SCIM sync (key HER-1312)". It scores candidates by Linear key, PR number, branch, workspace name, open asks and recent activity. When no candidate stands out, it asks you with a decision (the top two or three plus **New workspace**) instead of guessing.
121
145
  - **What it forwards keeps your voice.** A forwarded message starts "From Tom via Overseer:". It clears that agent's Needs-you flag only when it answers the agent's open ask. A new task leaves the ask standing.
122
146
  - **New workspaces only on your word.** It starts one, branched off main and named from the task, only after you asked or picked **New workspace**, and only through a dry run and confirm.
@@ -124,14 +148,42 @@ One agent you talk to about all your workspaces. It sits pinned at the top of Ho
124
148
  - **It is cheap to keep.** Each turn begins with a digest of what changed since the last one, built from Paseo's workspace metadata and Follow-up's own state. That's about 800 tokens at 100 workspaces, with resting workspaces in one line. The digest file is rewritten only when its content changes, and not at all while the resource governor pauses background work. The Overseer never reads the timeline of an agent that isn't loaded, because that would load the agent for an hour. Instead it reads the agent's transcript from disk, or Follow-up's cached goal and PRs. Sending to a resting agent wakes it, so that happens only when you ask for it, and the reply says "woke …".
125
149
  - **Archived it by accident?** Follow-up starts a new one with a handoff from the old one's last steps.
126
150
 
127
- Turn it off under Settings → **Overseer (beta)**.
151
+ Turn it off under Settings → **Overseer (beta)**. While it's off, search has no ask row.
152
+
153
+ #### AI priority (1.4 beta)
154
+
155
+ Home's **Priority** sort can come from a ranker that reads what's happening outside Paseo: your assigned Linear issues (priority, due date, project and milestone), Slack DMs and mentions from the last 48 hours, open GitHub review requests, and the CPO's weekly planning artifact. Each row then shows a one-line reason that names its source, such as "HER-1312 · Urgent · due today" or "Slack: Dana asked twice". Needs you still comes first, whatever the score.
156
+
157
+ - **When it runs:** about once an hour, Sunday to Thursday from 08:00 to 20:00 Israel time. **Re-rank now** in the sort menu runs it at any time, and so does asking the Overseer what to work on first. The menu says when it last ranked and names any source it couldn't read ("Ranked 12m ago · Slack unavailable").
158
+ - **What it costs:** it calls the model only when its inputs changed since the last run, and at most 24 times a day (Re-rank now isn't capped). A run at about 100 workspaces is one Sonnet call of roughly 10k input tokens, about $0.06 and 20 s. The weekly plan is read at most once a day, for about $0.03. Each run's cost and duration go to `ai-jobs.jsonl`.
159
+ - **What it touches:** everything is read-only: Follow-up's own state, read-only Linear and Slack tools through mcpproxy, `gh search prs`, and one read of the planning artifact with Claude's Artifact tool and no other tools. It never posts, comments or publishes. The artifact's link comes from `FOLLOW_UP_PLAN_URL`, or else from the morning-brief skill's source list (link only, without any share key).
160
+ - Linear issues assigned to you that no workspace covers are kept for a later "Not started" group; they aren't shown yet.
161
+
162
+ Turn it off under Settings → **Overseer (beta)** → **AI priority**.
163
+
164
+ ![Home sorted by Priority: each row shows the ranker's reason and source, such as "HER-1312 · Urgent · due today" from Linear and "Slack: Dana asked twice" from Slack](docs/media/overseer/priority-dark.png)
165
+
166
+ ![Home's search with "scim" typed: the matching workspace, then the active row "Ask the Overseer: scim" with an Enter hint](docs/media/overseer/omnibox-ask-dark.png)
167
+
168
+ ### Choosing models
169
+
170
+ Settings → **Agents** has one card for each agent Follow-up runs for you. Each card says what the agent does and what it uses now ("Claude · Haiku"). It lets you pick the provider, model, effort and, for full agents, the permission mode, and each card has **Reset to default**. The list comes from the providers and models Paseo knows about, read when you open the screen. Providers that aren't installed or are turned off are listed with the reason.
171
+
172
+ | Agent | Default | Notes |
173
+ |---|---|---|
174
+ | What's this about? | Claude · Haiku | One small call per overview, no tools. Claude (`claude -p`) or Codex (`codex exec`). Also sets how many overviews are written ahead per day (60). |
175
+ | Overseer | Claude · newest Opus, Bypass | A change applies when you restart it. Its pane on Home offers **Restart with …**, and the new Overseer gets the old one's last steps. |
176
+ | Recovery | Same as main agent | Or pick a provider and model. Switching provider keeps the main agent's tools and instructions. |
177
+ | Priority ranker | Claude · Sonnet, hourly, up to 24 a day | One call per run, no tools. Claude or Codex. |
178
+
179
+ The choices live in `agents.json` in Follow-up's data folder. Anything missing or invalid there falls back to the default. Agents can read the choices with the read-only `agent_settings` tool. The About footer names the model that wrote each overview ("Summarized by Haiku · 2h ago").
128
180
 
129
181
  ![Home with the Overseer selected: the pinned row asks which agent should take a broken export, and the pane shows the conversation, the routed task and the decision with two candidates plus New workspace](docs/media/overseer/overseer-dark.png)
130
182
 
131
183
  Install the beta:
132
184
 
133
185
  ```sh
134
- paseo plugin update follow-through --version 1.4.0-beta.0
186
+ paseo plugin update follow-through --version 1.4.0-beta.10
135
187
  # or, for a fresh install:
136
188
  paseo plugin install npm:paseo-follow-up@beta
137
189
  ```
@@ -151,6 +203,7 @@ Betas publish to npm's `beta` dist-tag, so `paseo plugin update` without `--vers
151
203
  - Follow-up never merges, turns on merge when ready, requests reviewers or archives on its own. **Merge** re-checks the stack, lists any PRs underneath that would merge first, and asks again.
152
204
  - A merged PR is not the end: tasks such as production checks and open questions keep the workspace open until the main agent declares Done and everything has settled.
153
205
  - Answers go out only when you click Send. Follow-up never answers for you.
206
+ - **It stays light on Paseo (1.4).** Follow-up keeps one shared view of Paseo's agents and workspaces. It reads the full list once at start, then updates it from Paseo's events: turns, permissions, archives and new agents or workspaces. It re-reads the list at most once a minute after a change, and every ten minutes otherwise. Home, the workspace panel, the pills and the Needs-you inbox all read that shared view, so opening them never makes Paseo list your workspaces again. In the app, the panel and pills draw from one shared poll that refreshes when an agent changes. The Needs-you list answers "unchanged" in a few bytes when nothing moved, and nothing polls while the app is in the background. At 120 workspaces and idle, Follow-up's worker makes about 1 request a minute to Paseo, down from about 60. With the app open it was about 140.
154
207
 
155
208
  ### Agents can do what you can click
156
209
 
@@ -159,7 +212,7 @@ Tell an agent "the PRs look good, assign reviewers on all" and it can do it. Eve
159
212
  | Tool | Does what this button does |
160
213
  | --- | --- |
161
214
  | `list_prs` | Reads tracked PRs across all workspaces (draft, checks, threads, reviewers, merge blockers). Filters: `needs_reviewers`, `ready_to_merge`, `workspace`. |
162
- | `add_reviewers` | **Add reviewers**, on one PR or many. Repository defaults, or the logins you name. |
215
+ | `add_reviewers` | **Add reviewers**, on one PR or many. Uses your saved reviewers for the repository, or the logins (or `org/team` slugs) you name. `list_prs` shows each PR's saved reviewers as `configuredReviewers`. |
163
216
  | `merge`, `enable_merge_when_ready`, `disable_merge_when_ready` | **Merge** and the PR sheet's merge-when-ready switch, with the same plan and blockers. |
164
217
  | `send_repairs`, `set_auto_send`, `clear_hold`, `retry_batch`, `track` | **Send**, the **Auto-send** switch, **Resume**, **Retry**, following a workspace again after an opt-out. |
165
218
  | `set_priorities` | Stores external priorities for Home's Priority sort: per workspace a score 0–100, a one-line reason and sources (Linear, Slack, planning, GitHub, Paseo). Plans first; `confirm: true` with the plan id stores them. Used for 6 hours. |
@@ -0,0 +1,132 @@
1
+ import { useState } from "react";
2
+ import { Pressable, Text, View } from "react-native";
3
+ import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
4
+ import { Icon } from "@getpaseo/plugin/client/ui";
5
+ import { useQuery, useQueryClient } from "@tanstack/react-query";
6
+ import { workspaceAboutRpc } from "../shared/contracts";
7
+ import { aboutDisplay, linkLine, SOURCE_LABEL, type AboutLink, type AboutView } from "../shared/about";
8
+ import { errorText } from "../shared/errors";
9
+ import { Button, text, type Theme } from "./kit";
10
+ import { Spinner } from "./motion";
11
+ import { useTick } from "./home-data";
12
+ import type { Colors } from "./theme";
13
+
14
+ const OPEN_KEY = "follow-up.about.open";
15
+ /** Open/closed is per device (web and desktop storage). Native or blocked storage: this session only. */
16
+ let memoryOpen: boolean | null = null;
17
+ const readOpen = (): boolean => {
18
+ try { const v = (globalThis as { localStorage?: Storage }).localStorage?.getItem(OPEN_KEY); if (v === "1" || v === "0") return v === "1"; } catch { /* memory only */ }
19
+ return memoryOpen ?? false;
20
+ };
21
+ const writeOpen = (open: boolean) => {
22
+ memoryOpen = open;
23
+ try { (globalThis as { localStorage?: Storage }).localStorage?.setItem(OPEN_KEY, open ? "1" : "0"); } catch { /* memory only */ }
24
+ };
25
+
26
+ export const aboutKey = (workspaceId: string) => ["follow-through", "about", workspaceId] as const;
27
+
28
+ /**
29
+ * "What's this about?" at the top of Home's detail pane and the workspace panel. Collapsed: the label and, when one
30
+ * is cached, the one-line gist. Open: the overview, what's linked, and when it was written with a Refresh.
31
+ */
32
+ export function AboutSection({ workspaceId, theme, compact, flush = false }: { workspaceId: string; theme: Theme; compact: boolean; flush?: boolean }) {
33
+ const c = theme.colors; const t = text(c);
34
+ const [open, setOpenState] = useState(readOpen);
35
+ const [refreshing, setRefreshing] = useState(false);
36
+ const read = useRpc(workspaceAboutRpc);
37
+ const client = useQueryClient();
38
+ const query = useQuery({
39
+ queryKey: [...aboutKey(workspaceId), open],
40
+ queryFn: () => read({ workspaceId, open }),
41
+ // Polls only while an overview is being written; otherwise one read per open (and per Refresh).
42
+ refetchInterval: q => (q.state.data as AboutView | undefined)?.status === "pending" ? 3000 : false,
43
+ staleTime: 60_000,
44
+ });
45
+ useTick(60_000);
46
+ const view = query.data ?? null;
47
+ const d = aboutDisplay(view, Date.now());
48
+ const toggle = () => { const next = !open; writeOpen(next); setOpenState(next); };
49
+ const refresh = async () => {
50
+ if (refreshing) return;
51
+ setRefreshing(true);
52
+ try { const next = await read({ workspaceId, open: true, refresh: true }); client.setQueryData([...aboutKey(workspaceId), true], next); }
53
+ catch { /* the query's error shows */ } finally { setRefreshing(false); }
54
+ };
55
+ const busy = refreshing || view?.status === "pending";
56
+
57
+ const failedKinds = new Set(view?.record?.failed ?? []);
58
+
59
+ // Collapsed it's a plain disclosure row; open, a hairline frame with no fill so the ask stays the raised block.
60
+ return <View style={{ borderRadius: 10, borderWidth: open ? 1 : 0, borderColor: c.border, marginHorizontal: flush ? 0 : compact ? 16 : 12, marginTop: flush ? 0 : 8 }}>
61
+ <Pressable accessibilityRole="button" aria-expanded={open} accessibilityState={{ expanded: open }} accessibilityLabel={`${open ? "Hide" : "Show"} what this workspace is about`}
62
+ accessibilityHint={d.gist && !open ? d.gist : undefined} onPress={toggle}
63
+ style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: open ? 12 : 8, marginHorizontal: open ? 0 : -8, minHeight: compact ? 44 : 32, paddingVertical: 6, borderRadius: 8,
64
+ backgroundColor: state.pressed ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
65
+ <Icon name={open ? "ChevronDown" : "ChevronRight"} size={14} color={c.foregroundMuted} />
66
+ <Text style={[t.label, { flexShrink: 0 }]}>What's this about?</Text>
67
+ {!open && d.gist ? <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0 }]}>{d.gist}</Text> : <View style={{ flex: 1 }} />}
68
+ {!open && view?.status === "pending" && !d.gist && <Spinner color={c.foregroundMuted} size={11} label="Summarizing" />}
69
+ </Pressable>
70
+ {open && <View style={{ paddingHorizontal: 12, paddingBottom: 10, gap: 12 }}>
71
+ <Overview d={d} view={view} c={c} compact={compact} loading={query.isPending} error={query.error ? errorText(query.error) : null} />
72
+ {/* Nothing is claimed about links until an overview exists: "none found" only after a finished write. */}
73
+ {d.body === "overview" && <View style={{ gap: 4 }}>
74
+ <Text accessibilityRole="header" style={[t.small, { fontWeight: "600", letterSpacing: 0.5, textTransform: "uppercase" }]}>Linked</Text>
75
+ {d.links.length ? d.links.map(l => <LinkRow key={l.key} l={l} c={c} compact={compact} failed={failedKinds.has(SOURCE_LABEL[l.kind])} />)
76
+ : <Text style={t.meta}>{d.empty}</Text>}
77
+ </View>}
78
+ {view?.record && <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
79
+ <Text style={[t.small, { flex: 1, minWidth: 0 }]}>{d.footer}</Text>
80
+ <Button theme={theme} compact={compact} kind="ghost" icon="RefreshCw" title={busy ? "Summarizing…" : "Refresh"} accessibilityLabel="Summarize again" disabled={busy} onPress={() => void refresh()} />
81
+ </View>}
82
+ {!view?.record && view?.status === "failed" && <View style={{ flexDirection: "row" }}>
83
+ <Button theme={theme} compact={compact} kind="ghost" icon="RefreshCw" title={busy ? "Summarizing…" : "Try again"} disabled={busy} onPress={() => void refresh()} />
84
+ </View>}
85
+ </View>}
86
+ </View>;
87
+ }
88
+
89
+ function Overview({ d, view, c, compact, loading, error }: { d: ReturnType<typeof aboutDisplay>; view: AboutView | null; c: Colors; compact: boolean; loading: boolean; error: string | null }) {
90
+ const t = text(c);
91
+ const [more, setMore] = useState(false);
92
+ // onTextLayout doesn't fire on web; about 200 characters fill four lines at phone width.
93
+ const long = compact && (d.overview?.length ?? 0) > 200;
94
+ // Context, not the ask: body size, a step quieter than the ask's text. On a phone, four lines with More.
95
+ if (d.body === "overview") return <View style={{ gap: 4 }}>
96
+ <Text selectable numberOfLines={compact && !more ? 4 : undefined}
97
+ style={[t.body, { lineHeight: 19, color: c.foreground, opacity: 0.88 }]}>{d.overview}</Text>
98
+ {long && <Pressable accessibilityRole="button" onPress={() => setMore(m => !m)} hitSlop={12}><Text style={[t.small, { color: c.foreground }]}>{more ? "Less" : "More"}</Text></Pressable>}
99
+ {d.refreshing && <View style={{ flexDirection: "row", alignItems: "center", gap: 6 }}><Spinner color={c.foregroundMuted} size={10} label="Summarizing" /><Text style={t.small}>Updating…</Text></View>}
100
+ </View>;
101
+ if (d.body === "summarizing" || loading) return <View style={{ gap: 6 }}>
102
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
103
+ <Spinner color={c.foregroundMuted} size={12} label="Summarizing" />
104
+ <Text style={t.meta}>Summarizing…</Text>
105
+ </View>
106
+ {d.excerpt && <Text numberOfLines={3} style={[t.meta, { fontStyle: "italic" }]}>“{d.excerpt}”</Text>}
107
+ </View>;
108
+ if (error) return <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>Couldn't load the overview: {error}</Text>;
109
+ if (d.body === "failed") return <Text accessibilityRole="alert" style={t.meta}>Couldn't write an overview{view?.error ? `: ${view.error}` : "."}</Text>;
110
+ return <Text style={t.meta}>No overview yet.</Text>;
111
+ }
112
+
113
+ function LinkRow({ l, c, compact, failed }: { l: AboutLink; c: Colors; compact: boolean; failed: boolean }) {
114
+ const t = text(c);
115
+ const line = linkLine(l);
116
+ const bare = !l.title && !l.excerpt;
117
+ // A source that couldn't be read says so on its own row, muted: it doesn't need the developer.
118
+ const meta = bare && failed ? [...line.meta, `${SOURCE_LABEL[l.kind]} couldn't be read`] : line.meta;
119
+ return <Pressable accessibilityRole="link" accessibilityLabel={[SOURCE_LABEL[l.kind], line.lead, line.title, ...meta].filter(Boolean).join(", ")} disabled={!l.url}
120
+ onPress={() => { if (l.url) void openExternalUrl(l.url).catch(() => undefined); }}
121
+ style={state => ({ flexDirection: "row", alignItems: "flex-start", gap: 10, minHeight: compact ? 44 : undefined, paddingVertical: compact ? 8 : 4, paddingHorizontal: 6, marginHorizontal: -6, borderRadius: 6, backgroundColor: (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
122
+ <Text numberOfLines={1} style={[t.small, { width: 46, paddingTop: 2 }]}>{SOURCE_LABEL[l.kind]}</Text>
123
+ <View style={{ flex: 1, minWidth: 0, gap: 1 }}>
124
+ <Text numberOfLines={2} style={t.body}>
125
+ <Text style={{ fontWeight: "500", fontVariant: ["tabular-nums"], color: bare ? c.foregroundMuted : c.foreground }}>{line.lead}</Text>
126
+ {line.title ? <Text>{` ${line.title}`}</Text> : bare && l.url && l.kind !== "slack" ? <Text style={{ color: c.foregroundMuted }}>{" link"}</Text> : null}
127
+ </Text>
128
+ {!!meta.length && <Text numberOfLines={1} style={t.small}>{meta.join(" · ")}</Text>}
129
+ </View>
130
+ {!!l.url && <View style={{ paddingTop: 3 }}><Icon name="ArrowUpRight" size={12} color={c.foregroundMuted} /></View>}
131
+ </Pressable>;
132
+ }
@@ -0,0 +1,127 @@
1
+ import { ActivityIndicator, Text, View } from "react-native";
2
+ import type { PluginSurfaceProps } from "@getpaseo/plugin/client";
3
+ import { useRpc } from "@getpaseo/plugin/client";
4
+ import { SettingsAction, SettingsCard, SettingsSection, SettingsSelect, useToast } from "@getpaseo/plugin/client/ui";
5
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
6
+ import { agentSettingsRpc, setAgentSettingRpc } from "../shared/contracts";
7
+ import { AGENT_ROLES, JOB_PROVIDERS, ROLE_DEFAULTS, ROLE_INFO, isJobRole, modelName, providerName, type AgentRole, type AgentSettingsView, type CatalogProvider, type SavedRole } from "../shared/agent-settings";
8
+ import { Button, errorText, text, type Theme } from "./kit";
9
+
10
+ const key = ["follow-through", "agent-settings"];
11
+ const SAME = "__same";
12
+ const DEFAULT = "__default";
13
+ /** Each provider's "don't ask" mode, used when a Paseo agent role moves to it. */
14
+ const BYPASS: Record<string, string> = { claude: "bypassPermissions", codex: "full-access" };
15
+
16
+ type Role = AgentSettingsView["roles"][number];
17
+
18
+ /**
19
+ * Settings → Agents: one card per special role. What it does and what it uses now, then provider, model, effort,
20
+ * mode and limits. The provider catalog is read once when this screen opens (cached on the server), never polled.
21
+ */
22
+ export function AgentSettings({ theme, compact }: Pick<PluginSurfaceProps, "theme"> & { compact: boolean }) {
23
+ const c = theme.colors; const t = text(c);
24
+ const read = useRpc(agentSettingsRpc); const write = useRpc(setAgentSettingRpc); const cache = useQueryClient(); const toast = useToast();
25
+ const query = useQuery({ queryKey: key, queryFn: () => read({ catalog: true }), staleTime: 5 * 60_000,
26
+ // Only while Paseo is still discovering providers (right after it starts): ask again until they settle.
27
+ refetchInterval: q => (q.state.data as AgentSettingsView | undefined)?.catalog?.providers.some(p => p.reason === "Still loading") && q.state.dataUpdateCount < 10 ? 5000 : false });
28
+ const change = useMutation({
29
+ mutationFn: (input: { role: AgentRole; entry: SavedRole | null }) => write(input),
30
+ onSuccess: (value, input) => {
31
+ cache.setQueryData(key, value);
32
+ void cache.invalidateQueries({ queryKey: ["follow-through", "about"] });
33
+ const r = value.roles.find(x => x.role === input.role);
34
+ if (r) toast.show(input.role === "overseer" ? `Overseer: ${r.summary}. Restart it from Home to switch.` : `${ROLE_INFO[input.role].title}: ${r.summary}`, { variant: "success" });
35
+ },
36
+ onError: error => toast.error(errorText(error)),
37
+ });
38
+ const data = query.data;
39
+ const info = "Which agent Follow-up uses for each of its own jobs. Defaults: Claude Haiku for overviews, Claude Opus for the Overseer, the main agent's own setup for recovery, Claude Sonnet for priority ranking. What's this about? and the ranker are one-shot jobs, so they run on Claude or Codex only; the Overseer and recovery can use any provider Paseo has. Changes apply from the next call; the Overseer switches when you restart it.";
40
+ return <SettingsSection title="Agents" info={info}>
41
+ {query.isPending && <ActivityIndicator accessibilityLabel="Loading agent settings" color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
42
+ {query.error && <SettingsCard><SettingsAction label="Couldn't load agent settings" hint={errorText(query.error)} actionLabel="Retry" onPress={() => void query.refetch()} /></SettingsCard>}
43
+ {data?.catalog?.error && <SettingsCard><SettingsAction label="Couldn't read Paseo's providers" hint={`${data.catalog.error} The current choices still work; pickers show only what's saved.`} actionLabel="Retry" onPress={() => void read({ catalog: true, fresh: true }).then(v => cache.setQueryData(key, v), e => toast.error(errorText(e)))} /></SettingsCard>}
44
+ {/* Once for the section, not per card: what can't be picked and why. */}
45
+ {!!data?.catalog?.providers.some(p => !p.available) && <Text style={[t.meta, { paddingHorizontal: 4 }]}>{`Not available in Paseo: ${data.catalog.providers.filter(p => !p.available).map(p => `${p.label} (${(p.reason ?? "unavailable").replace(/\.$/, "")})`).join(", ")}.`}</Text>}
46
+ {data && AGENT_ROLES.map(role => {
47
+ const r = data.roles.find(x => x.role === role);
48
+ return r ? <RoleCard key={role} r={r} invalid={data.invalid.includes(role)} catalog={data.catalog?.providers ?? []} busy={change.isPending}
49
+ save={entry => change.mutate({ role, entry })} theme={theme} compact={compact} /> : null;
50
+ })}
51
+ </SettingsSection>;
52
+ }
53
+
54
+ function RoleCard({ r, invalid, catalog, busy, save, theme, compact }: { r: Role; invalid: boolean; catalog: CatalogProvider[]; busy: boolean; save: (entry: SavedRole | null) => void; theme: Theme; compact: boolean }) {
55
+ const c = theme.colors; const t = text(c);
56
+ const role = r.role;
57
+ const jobs = isJobRole(role);
58
+ const usable = catalog.filter(p => p.available && (!jobs || (JOB_PROVIDERS as readonly string[]).includes(p.id)));
59
+ const current = catalog.find(p => p.id === r.provider);
60
+ const base: SavedRole = { provider: r.provider, model: r.model, thinking: r.thinking, ...(jobs ? {} : { mode: r.mode }), ...(role === "recovery" ? { same: r.same } : {}),
61
+ ...(jobs ? { dailyCap: r.dailyCap ?? undefined, maxPromptChars: r.maxPromptChars ?? undefined } : {}), ...(role === "ranker" ? { cadenceMinutes: r.cadenceMinutes ?? undefined } : {}) };
62
+ const set = (patch: SavedRole) => save({ ...base, ...patch });
63
+ const providerLabel = providerName(r.provider, current?.label);
64
+ // Saved on a provider Paseo can't use right now: say so plainly, with what happens and the way out.
65
+ const blocked = !r.same && catalog.length > 0 && !usable.some(p => p.id === r.provider);
66
+ const blockedReason = !current ? "not in Paseo's provider list" : !current.available ? (current.reason ?? "unavailable").replace(/\.$/, "") : "can't run one-shot jobs";
67
+
68
+ const providerOptions = [
69
+ ...(role === "recovery" ? [{ value: SAME, label: "Same as main agent" }] : []),
70
+ ...usable.map(p => ({ value: p.id, label: p.label })),
71
+ ...(!r.same && !usable.some(p => p.id === r.provider) ? [{ value: r.provider, label: `${providerLabel} · unavailable` }] : []),
72
+ ];
73
+ const pickProvider = (value: string) => {
74
+ if (value === SAME) return set({ same: true });
75
+ const p = catalog.find(x => x.id === value);
76
+ const defaults = ROLE_DEFAULTS[role];
77
+ const same = value === defaults.provider;
78
+ set({ same: false, provider: value, model: same ? defaults.model : null, thinking: null, ...(jobs ? {} : { mode: same ? defaults.mode : BYPASS[value] ?? p?.defaultMode ?? null }) });
79
+ };
80
+
81
+ const models = current?.models ?? [];
82
+ const model = r.model ? models.find(m => m.id === r.model) : null;
83
+ const providerDefault = models.find(m => m.isDefault);
84
+ const defaultModel = role === "overseer" && r.provider === "claude" ? "Default (newest Opus)" : providerDefault ? `Default (${providerDefault.label})` : "Default";
85
+ const modelOptions = [{ value: DEFAULT, label: defaultModel }, ...models.map(m => ({ value: m.id, label: m.label })),
86
+ ...(r.model && !model ? [{ value: r.model, label: modelName(r.model) }] : [])];
87
+ const thinking = (model ?? providerDefault)?.thinking ?? [];
88
+ const thinkingDefault = thinking.find(o => o.isDefault);
89
+ const modes = current?.modes ?? [];
90
+ const modeDefault = modes.find(m => m.id === current?.defaultMode);
91
+ const modeLabel = (m: { id: string; label: string }) => BYPASS[r.provider] === m.id ? `${m.label} · no prompts` : m.label;
92
+
93
+ const reset = <Button theme={theme} compact={compact} kind="ghost" icon="RotateCcw" title="Reset to default" accessibilityHint={`Back to ${roleDefaultText(role)}`} disabled={busy || (r.isDefault && !invalid)} onPress={() => save(null)} />;
94
+ return <SettingsCard>
95
+ <View style={{ paddingHorizontal: 16, paddingTop: 14, paddingBottom: 10, gap: 2 }}>
96
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
97
+ <Text accessibilityRole="header" style={[t.title, { flex: 1 }]}>{ROLE_INFO[role].title}</Text>
98
+ {!compact && reset}
99
+ </View>
100
+ <Text style={t.meta}>{ROLE_INFO[role].does}{role === "overseer" ? " A running Overseer keeps its model until you restart it from Home." : ""}</Text>
101
+ {invalid && <Text style={t.meta}>Part of the saved setting wasn't valid, so its default is used.</Text>}
102
+ {blocked && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusWarning }]}>{`${providerLabel} isn't available (${blockedReason}). ${role === "about" ? "Overviews will fail" : role === "ranker" ? "Ranking will fail" : role === "overseer" ? "Starting or restarting the Overseer will fail" : "Recovery agents won't start"} until you pick another provider or reset.`}</Text>}
103
+ </View>
104
+ <SettingsSelect label="Provider" value={r.same ? SAME : r.provider} options={providerOptions} disabled={busy || !catalog.length} onValueChange={pickProvider} />
105
+ {!r.same && <SettingsSelect label="Model" value={r.model ?? DEFAULT} options={modelOptions} disabled={busy || !catalog.length}
106
+ onValueChange={value => set({ model: value === DEFAULT ? null : value, thinking: null })} />}
107
+ {!r.same && (thinking.length > 0 || !!r.thinking) && <SettingsSelect label="Effort" hint={!thinking.length && !blocked && model ? "This model lists no effort levels in Paseo; the saved one is still passed on." : undefined} value={r.thinking ?? DEFAULT}
108
+ options={[{ value: DEFAULT, label: thinkingDefault ? `Default (${thinkingDefault.label})` : "Default" }, ...thinking.map(o => ({ value: o.id, label: o.label })), ...(r.thinking && !thinking.some(o => o.id === r.thinking) ? [{ value: r.thinking, label: r.thinking }] : [])]} disabled={busy}
109
+ onValueChange={value => set({ thinking: value === DEFAULT ? null : value })} />}
110
+ {!jobs && !r.same && modes.length > 0 && <SettingsSelect label="Permissions" hint="It runs unattended, so pick a mode that doesn't prompt." value={r.mode ?? DEFAULT}
111
+ options={[{ value: DEFAULT, label: modeDefault ? `Default (${modeLabel(modeDefault)})` : "Default" }, ...modes.map(m => ({ value: m.id, label: modeLabel(m) }))]} disabled={busy}
112
+ onValueChange={value => set({ mode: value === DEFAULT ? null : value })} />}
113
+ {role === "about" && <SettingsSelect label="Written ahead per day" hint="Overviews written in the background for workspaces in Needs you. Opening a workspace always writes one when needed."
114
+ value={String(r.dailyCap ?? 60)} options={withCurrent([0, 20, 60, 120, 200], r.dailyCap ?? 60).map(n => ({ value: String(n), label: n === 0 ? "None" : String(n) }))} disabled={busy}
115
+ onValueChange={value => set({ dailyCap: Number(value) })} />}
116
+ {role === "ranker" && <SettingsSelect label="Ranks every" value={String(r.cadenceMinutes ?? 60)} disabled={busy}
117
+ options={withCurrent([15, 30, 60, 120, 240], r.cadenceMinutes ?? 60).map(n => ({ value: String(n), label: n < 60 ? `${n} minutes` : n === 60 ? "Hour" : `${n / 60} hours` }))}
118
+ onValueChange={value => set({ cadenceMinutes: Number(value) })} />}
119
+ {role === "ranker" && <SettingsSelect label="At most per day" value={String(r.dailyCap ?? 24)} disabled={busy}
120
+ options={withCurrent([6, 12, 24, 48, 96], r.dailyCap ?? 24).map(n => ({ value: String(n), label: String(n) }))}
121
+ onValueChange={value => set({ dailyCap: Number(value) })} />}
122
+ {compact && <View style={{ flexDirection: "row", paddingHorizontal: 8, paddingVertical: 6 }}>{reset}</View>}
123
+ </SettingsCard>;
124
+ }
125
+
126
+ const roleDefaultText = (role: AgentRole) => role === "recovery" ? "the main agent's setup" : role === "overseer" ? "Claude, newest Opus" : role === "about" ? "Claude Haiku" : "Claude Sonnet, hourly";
127
+ const withCurrent = (list: number[], value: number) => [...new Set([...list, value])].sort((a, b) => a - b);