Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: polish quick task reviewer controls
[._.]/ Adam Eivyc75936e47f6d
diff --git a/client/src/components/cos/ReviewerPicker.jsx b/client/src/components/cos/ReviewerPicker.jsxindex 8ae74126a0..b7a8060885 100644--- a/client/src/components/cos/ReviewerPicker.jsx+++ b/client/src/components/cos/ReviewerPicker.jsx@@ -57,8 +57,8 @@ const normalizeReviewerValue = (value) => normalizeReviewerSlug(value);* however it persists them.** `modelOptions` is the resolved model-picker data, shaped like- * `useReviewerModelOptions()`'s return: `{ optionsByReviewer, freeText,- * unavailable, loaded }`. Callers keep owning their own+ * `useReviewerModelOptions()`'s return: `{ optionsByReviewer, defaultModels,+ * freeText, unavailable, loaded }`. Callers keep owning their own* `api.getLocalLlmStatus` / `api.getProviders` fetches (that's what the hook is* for) — passing nothing degrades every Model cell to a free-text input, which is* still fully usable, rather than hiding the column.@@ -361,7 +361,9 @@ export default function ReviewerPicker({const renderModelCell = (token) => {if (!MODEL_SELECTABLE_REVIEWERS.includes(token)) return renderNoPinCell(`${reviewerLabel(token)} takes no model`);const subject = reviewerLabel(token);- const value = models.get(token) ?? '';+ const pinnedValue = models.get(token);+ const value = pinnedValue ?? '';+ const defaultModel = modelOptions?.defaultModels?.[token] || '';const options = modelOptions?.optionsByReviewer?.[token] || [];const inputId = `${id}-model-${token}`;const listId = `${id}-modellist-${token}`;@@ -380,12 +382,14 @@ export default function ReviewerPicker({if (!freeText) {return renderPinSelect({selectId: inputId,- value,+ value: value || (defaultModel && options.includes(defaultModel) ? defaultModel : ''),options,onChange: (model) => setModel(token, model),ariaLabel: `Model for ${subject}`,title: value? `${subject} reviews with ${value}. Choose "default" to let it pick.`+ : defaultModel+ ? `${subject} uses ${defaultModel} by default. Choose another model to pin it for this run.`: `${subject} uses the model configured for its backend. Pick one to pin it for this run.`,staleSuffix: '(not installed)',setClass: 'text-port-accent border-port-accent/50',@@ -399,15 +403,17 @@ export default function ReviewerPicker({id={inputId}type="text"list={options.length ? listId : undefined}- value={value}+ value={value || defaultModel}disabled={disabled}maxLength={MAX_REVIEWER_MODEL_LENGTH}- placeholder="default"+ placeholder={defaultModel ? `${defaultModel} (default)` : 'default'}onChange={(e) => setModel(token, e.target.value)}aria-label={`Model for ${subject}`}title={value? `${subject} reviews with ${value}. Clear to let it use its own default.`- : (emptyHint || `${subject} uses its own default model. Type or pick an id to pin one.`)}+ : (defaultModel+ ? `${subject} uses ${defaultModel} by default. Type or pick another id to pin one.`+ : (emptyHint || `${subject} uses its own default model. Type or pick an id to pin one.`))}className={`w-full min-w-0 max-w-[190px] px-1.5 py-0.5 text-[11px] font-mono rounded border bg-port-bg min-h-[28px] disabled:opacity-40 focus:outline-none focus:border-port-accent ${value? 'text-port-accent border-port-accent/50': 'text-gray-500 border-port-border/60'}`}@@ -466,14 +472,15 @@ export default function ReviewerPicker({emit({ reviewers: next });};- // Shared row grid. Desktop is a 5-column table (order · provider · model ·- // optional · max · remove); under `sm` it collapses to a stacked 2-column- // label/value block so a narrow screen never needs horizontal scrolling. The- // header row is desktop-only — on mobile each cell carries its own inline- // label, since a header far above a stacked row doesn't associate.- const ROW_CLASS = 'grid grid-cols-[auto_1fr] sm:grid-cols-[2.5rem_minmax(5rem,1fr)_minmax(0,2fr)_minmax(0,7rem)_auto_3.25rem_auto] items-center gap-x-2 gap-y-1 px-1.5 py-1.5 rounded border border-port-border bg-port-bg sm:border-transparent sm:bg-transparent sm:py-0.5 sm:rounded-none';+ // Shared row grid. Desktop keeps minimum tracks for order, provider, model,+ // effort, optional, max, and remove; under `sm` it collapses to a stacked+ // 2-column label/value block so a narrow screen never needs horizontal+ // scrolling. The header row is desktop-only — on mobile each cell carries+ // its own inline label, since a header far above a stacked row doesn't+ // associate.+ const ROW_CLASS = 'grid grid-cols-[auto_1fr] sm:grid-cols-[2.5rem_minmax(5rem,1fr)_minmax(8rem,2fr)_minmax(7rem,1fr)_auto_3.25rem_auto] items-center gap-x-2 gap-y-1 px-1.5 py-1.5 rounded border border-port-border bg-port-bg sm:border-transparent sm:bg-transparent sm:py-0.5 sm:rounded-none';const CELL_LABEL_CLASS = 'sm:hidden text-[10px] uppercase tracking-wide text-gray-600';- const HEADER_CLASS = 'hidden sm:grid sm:grid-cols-[2.5rem_minmax(5rem,1fr)_minmax(0,2fr)_minmax(0,7rem)_auto_3.25rem_auto] items-center gap-x-2 px-1.5 text-[10px] uppercase tracking-wide text-gray-600';+ const HEADER_CLASS = 'hidden sm:grid sm:grid-cols-[2.5rem_minmax(5rem,1fr)_minmax(8rem,2fr)_minmax(7rem,1fr)_auto_3.25rem_auto] items-center gap-x-2 px-1.5 text-[10px] uppercase tracking-wide text-gray-600';return (<div className="flex flex-col gap-2 w-full">@@ -556,9 +563,12 @@ export default function ReviewerPicker({</div>{(selected.length > 0 || selectedUsernames.length > 0) && (- <span className="text-[11px] text-gray-600">- Tip: <span className="font-mono text-port-accent">Model</span> pins the model that reviewer runs (blank = its own default), and <span className="font-mono text-port-accent-2">Effort</span> pins how hard it reasons — higher is slower and pricier, and each reviewer only offers the tiers its own CLI accepts. The <span className="font-mono text-port-warning">~opt</span> badge marks a reviewer <em>non-blocking</em> — it still runs and its findings are still fixed, but an inconclusive verdict (timeout / no result) won't block the merge. A hard failure still does. <span className="font-mono text-port-accent-2">Max</span> caps that reviewer's review → fix → re-review rounds (blank = its built-in cap, <span className="font-mono">0</span> = loop until clean) — a small cap keeps a slow local model affordable.- </span>+ <details className="text-[11px] text-gray-600">+ <summary className="cursor-pointer text-xs text-gray-500 hover:text-gray-300">Tip: reviewer controls</summary>+ <p className="mt-1">+ <span className="font-mono text-port-accent">Model</span> pins the model that reviewer runs (the shown default is used when no override is saved), and <span className="font-mono text-port-accent-2">Effort</span> pins how hard it reasons — higher is slower and pricier, and each reviewer only offers the tiers its own CLI accepts. The <span className="font-mono text-port-warning">~opt</span> badge marks a reviewer <em>non-blocking</em> — it still runs and its findings are still fixed, but an inconclusive verdict (timeout / no result) won't block the merge. A hard failure still does. <span className="font-mono text-port-accent-2">Max</span> caps that reviewer's review → fix → re-review rounds (blank = its built-in cap, <span className="font-mono">0</span> = loop until clean) — a small cap keeps a slow local model affordable.+ </p>+ </details>)}{available.length > 0 && (diff --git a/client/src/components/cos/ReviewerPicker.test.jsx b/client/src/components/cos/ReviewerPicker.test.jsxindex 1053fb7841..31605b4880 100644--- a/client/src/components/cos/ReviewerPicker.test.jsx+++ b/client/src/components/cos/ReviewerPicker.test.jsx@@ -276,6 +276,7 @@ describe('ReviewerPicker', () => {codex: ['gpt-tier-a', 'gpt-tier-b'],claude: ['claude-tier-a', 'qwen2.5-coder:32b'],},+ defaultModels: { codex: 'gpt-tier-a' },freeText: { codex: true, claude: true, lmstudio: false, ollama: false },unavailable: { lmstudio: false, ollama: false },loaded: true,@@ -289,6 +290,12 @@ describe('ReviewerPicker', () => {expect(screen.queryByLabelText('Model for Copilot')).not.toBeInTheDocument();});+ it('shows the provider default when no per-reviewer model pin exists', () => {+ render(<ReviewerPicker reviewers={['codex']} modelOptions={modelOptions} onChange={() => {}} />);+ expect(screen.getByLabelText('Model for Codex')).toHaveValue('gpt-tier-a');+ expect(screen.getByLabelText('Model for Codex')).toHaveAttribute('title', expect.stringContaining('by default'));+ });+it('does not render a Model control for a @username reviewer', () => {render(<ReviewerPicker reviewers={['copilot']} usernames={['flaky-bot']} modelOptions={modelOptions} onChange={() => {}} />);expect(screen.queryByLabelText('Model for @flaky-bot')).not.toBeInTheDocument();@@ -546,4 +553,17 @@ describe('ReviewerPicker', () => {});});});+ });++ describe('help disclosure', () => {+ it('keeps the reviewer tip collapsed until opened', async () => {+ const user = userEvent.setup();+ render(<ReviewerPicker reviewers={['codex']} onChange={() => {}} />);+ const summary = screen.getByText('Tip: reviewer controls');+ const details = summary.closest('details');+ expect(details).not.toHaveAttribute('open');+ await user.click(summary);+ expect(details).toHaveAttribute('open');+ });+ });});diff --git a/client/src/hooks/README.md b/client/src/hooks/README.mdindex bb356e5a1b..f7e02c5e61 100644--- a/client/src/hooks/README.md+++ b/client/src/hooks/README.md@@ -170,7 +170,7 @@ grep -i "what you want to do" client/src/hooks/README.md| `usePostSession` | MeatSpace POST drill-run state, refresh snapshots, scoring, and idempotent test/training saves. | POST launcher and drill runners. || `useRecordMerge` | Duplicate Universe/Series merge flow: open → dry-run preview → resolve field conflicts → execute, with an `onMerged` refresh callback. Drives `<MergeModal>`. | Surfacing the merge-duplicates UI anywhere (Sharing → Duplicates, Universes page). Don't re-implement the preview/execute dance. || `useProviderModels` | AI providers + two-step provider→model selection. | Any UI that picks a provider + model. |-| `useReviewerModelOptions` | Selectable model ids per model-taking reviewer for `ReviewerPicker`'s Model column — local-LLM ids from `/api/local-llm/status`, codex/claude/antigravity tiers from `/api/providers` (claude's list also spans installed Ollama ids for an Ollama-backed CLI; agy's collapses to base ids since the row has its own Effort cell). Returns `{ optionsByReviewer, freeText, unavailable, loaded, reviewers }`. | Every surface that renders `ReviewerPicker` (Code Review Defaults, TaskAddForm, ScheduleTab, SlashDoRunDrawer) — the picker never fetches; pass this as its `modelOptions`. |+| `useReviewerModelOptions` | Selectable model ids and concrete provider defaults per model-taking reviewer for `ReviewerPicker`'s Model column — local-LLM ids from `/api/local-llm/status`, codex/claude/antigravity tiers from `/api/providers` (claude's list also spans installed Ollama ids for an Ollama-backed CLI; agy's list collapses to base ids since the row has its own Effort cell). Returns `{ optionsByReviewer, defaultModels, freeText, unavailable, loaded, reviewers }`. | Every surface that renders `ReviewerPicker` (Code Review Defaults, TaskAddForm, ScheduleTab, SlashDoRunDrawer) — the picker never fetches; pass this as its `modelOptions`. || `useLocalModels` | Live installed Ollama/LM Studio model ids per backend + the server's editorial recommendation, plus `installed` per backend (`null` until fetched) — the app-level verdict that counts a macOS bundle with no CLI shim. | Model pickers that must show currently-installed local models (not just a provider's stale stored `models`). Fold in via `mergeModelLists` + `localBackendForProvider`. || `useVisionModelIds` | `{ idsByProvider, loaded }` — vision-capable model ids the server reports (Ollama `/api/show` + LM Studio `type:'vlm'`), keyed by the provider id that serves them (`{ ollama: Set, lmstudio: Set }`), `null` until fetched; `loaded` flips once the fetch settles. Drops `backend:'cli'` rows (a blanket per-provider claim, not a per-model fact) and never vouches for a provider the server didn't enumerate. | Any VISION model picker — pass `idsByProvider` to `visionLocalModelFilter` / `assignmentModelOptions` so a new multimodal family (`gemma4`) isn't hidden by the stale client id regex, and so an installed VLM shows even when the provider's stored `models` snapshot is stale; gate any "none installed" messaging on `loaded` and on the provider being a local backend. || `useToolUseModelIds` | `{ idsByProvider, loaded }` — TOOL-USE (function-calling) capable model ids the server reports (Ollama `/api/show` `tools` capability + LM Studio catalog capabilities) via `/api/local-llm/tool-use-models`, keyed by the provider id that serves them (`{ ollama: Set, lmstudio: Set }`), `null` until fetched; `loaded` flips once the fetch settles. One module-shared fetch across every mounted caller, retried on a later mount if it failed. | Any AGENT model picker — pass `idsByProvider` to `localToolUseHint` / `withToolUseOptionLabel` so a tool-capable family the client id regex predates (`phi4-mini`) isn't mislabelled "⚠ no known tool use", and gate the annotation on `loaded` so the warning isn't asserted mid-fetch. |diff --git a/client/src/hooks/useReviewerModelOptions.js b/client/src/hooks/useReviewerModelOptions.jsindex a694b266df..d55eadb439 100644--- a/client/src/hooks/useReviewerModelOptions.js+++ b/client/src/hooks/useReviewerModelOptions.js@@ -38,7 +38,7 @@ import { reviewerEffortLevels, normalizeReviewerSlug } from '../lib/reviewerPins* reviewer returns its static ladder. Lives here rather than in the picker so the* picker keeps doing no fetching of its own.*- * @returns {{ optionsByReviewer: Record<string, string[]>, freeText: Record<string, boolean>, unavailable: Record<string, boolean>, modelEffortLevels: (reviewer: string, model?: string|null) => readonly string[]|null, loaded: boolean, reviewers: string[] }}+ * @returns {{ optionsByReviewer: Record<string, string[]>, defaultModels: Record<string, string|null>, freeText: Record<string, boolean>, unavailable: Record<string, boolean>, modelEffortLevels: (reviewer: string, model?: string|null) => readonly string[]|null, loaded: boolean, reviewers: string[] }}*/export default function useReviewerModelOptions() {const [localStatus, setLocalStatus] = useState(null);@@ -71,8 +71,11 @@ export default function useReviewerModelOptions() {// `grok` names one binary that ships as BOTH a `cli` and a `tui` provider, and// the reviewer is spawned non-interactively, so the CLI's catalog wins — the// broad predicate is the fallback for an install that only kept the TUI.+ const providerFor = (...matchers) =>+ matchers.reduce((found, match) => found || (providers || []).find(match), null);+const providerTiers = (...matchers) => {- const provider = matchers.reduce((found, match) => found || (providers || []).find(match), null);+ const provider = providerFor(...matchers);if (!provider) return [];// `models` may be empty on a CLI provider configured with only a// defaultModel — `[]` is truthy, so a bare `||` wouldn't fall through.@@ -84,6 +87,25 @@ export default function useReviewerModelOptions() {return filterSelectableModels(selectableModelsForProvider(provider, models));};+ // Show the configured provider default in the picker even when the user has+ // not saved a per-reviewer override. A concrete default is useful context;+ // configured-default sentinels intentionally resolve to null because the CLI+ // owns the choice and there is no model id PortOS can honestly display.+ const providerDefault = (...matchers) => {+ const provider = providerFor(...matchers);+ if (!provider?.defaultModel) return null;+ return filterSelectableModels(+ selectableModelsForProvider(provider, [provider.defaultModel])+ ).find(Boolean) || null;+ };++ // Local backend model lists come from the live runtime probe, so only show a+ // provider default when it is present in that authoritative list.+ const localDefault = (backend) => {+ const candidate = providerFor((p) => p.id === backend)?.defaultModel;+ return candidate && localIds(backend).includes(candidate) ? candidate : null;+ };+const ollama = localIds('ollama');const optionsByReviewer = {lmstudio: localIds('lmstudio'),@@ -101,6 +123,16 @@ export default function useReviewerModelOptions() {cursor: providerTiers((p) => p.id === 'cursor-cli', (p) => p.id === 'cursor-tui'),};+ const defaultModels = {+ lmstudio: localDefault('lmstudio'),+ ollama: localDefault('ollama'),+ codex: providerDefault((p) => p.id === 'codex'),+ claude: providerDefault((p) => p.id === 'claude-code'),+ antigravity: providerDefault(isAntigravityProvider),+ grok: providerDefault((p) => p.id === 'grok-cli', isGrokBuildCli),+ cursor: providerDefault((p) => p.id === 'cursor-cli', (p) => p.id === 'cursor-tui'),+ };+// The agy provider's RAW catalog — one id per effort tier// (`gemini-3.6-flash-low|-medium|-high`), which is exactly what the narrowing// reads. Deliberately NOT `optionsByReviewer.antigravity`: that list has@@ -121,6 +153,7 @@ export default function useReviewerModelOptions() {return {optionsByReviewer,+ defaultModels,modelEffortLevels,// A local backend's id list is authoritative (we probed it), so keep those// pickers a closed `<select>`. Every CLI reviewer is free-text: `claude` fordiff --git a/client/src/hooks/useReviewerModelOptions.test.jsx b/client/src/hooks/useReviewerModelOptions.test.jsxindex b46c09efee..79ee35f50f 100644--- a/client/src/hooks/useReviewerModelOptions.test.jsx+++ b/client/src/hooks/useReviewerModelOptions.test.jsx@@ -10,7 +10,7 @@ vi.mock('../services/api', () => ({}));const providers = [- { id: 'codex', models: ['gpt-5.6-sol', 'gpt-5.6-luna'] },+ { id: 'codex', models: ['gpt-5.6-sol', 'gpt-5.6-luna'], defaultModel: 'gpt-5.6-sol' },{ id: 'claude-code', models: ['claude-opus-5'] },// agy enumerates each effort tier as its own id; the reviewer row has a// separate Effort cell, so the picker must collapse them to base ids.@@ -46,6 +46,13 @@ describe('useReviewerModelOptions', () => {}});+ it('publishes concrete provider defaults without exposing configured-default sentinels', async () => {+ const { result } = renderHook(() => useReviewerModelOptions());+ await waitFor(() => expect(result.current.loaded).toBe(true));+ expect(result.current.defaultModels.codex).toBe('gpt-5.6-sol');+ expect(result.current.defaultModels.antigravity).toBeNull();+ });+// #3728: `agy --model <id>` is real, so the antigravity row gets a Model cell.// Its ids arrive effort-suffixed and would otherwise duplicate the Effort cell// (and hand agy a `--model X-high --effort high` pair it rejects).