chat: rename the pi-mono provider router + purge residual pi names (Stage 4b/2)

Renames the AI-harness/provider settings router into the chat namespace and
clears the remaining "pi" identifiers from the chat stack.

- server-settings/pi-mono.ts → chat-providers.ts; piMonoRouter → chatProvidersRouter;
  route /server-settings/pi-mono → /server-settings/chat-providers (+ all callers)
- piId → providerId (PROVIDERS map + AIHarnessesSection UI), PiProvider → ChatProvider,
  PI_MONO_* query keys → CHAT_PROVIDERS_*, installPiMono → installAgent
- data-path: PI_CONFIG_DIR → AGENT_CONFIG_DIR (path ~/.pi/agent unchanged);
  drop dead getPiMonoDir/getPiMonoSessionDir exports
- settings: flip the vestigial defaultProvider literal 'pi' → 'chat' (never read;
  only defaultModel drives behavior); access-policy config key 'pi-access-policy'
  → 'chat-access-policy'
- misc: ModelSelector fallback label, TaskDefaults model grouping, CapabilityPage
  chat var, a stale stream-parser comment

Intentionally left (genuine external `pi`/opencode references, not ours to rename):
the `pi` binary install/version flow (@mariozechner/pi-coding-agent, `which pi`),
the ~/.pi/agent config path, PI_TOOLS_DIRS/PI_SEARXNG_URL runtime env-var contract,
TOOL.md `targets: pi` metadata, and the "Pi Mono" installer UI label.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-24 15:52:58 +00:00
co-authored by Claude Opus 4.8
parent 49df1c0b0c
commit 669692355d
15 changed files with 140 additions and 144 deletions
@@ -16,7 +16,7 @@ import { useUserVisibleModels, type ModelOption } from 'state/useModels';
export const TaskDefaults = () => {
const { settings, saveSettings } = useSettings();
const piModels = useUserVisibleModels();
const models = useUserVisibleModels();
const [isSaving, setIsSaving] = useState(false);
const [model, setModel] = useState<string | null>(settings.tasks.defaultModel);
@@ -37,13 +37,13 @@ export const TaskDefaults = () => {
.map(([provider, models]) => ({ provider, models: models.sort((a, b) => a.name.localeCompare(b.name)) }));
};
const piGroups = useMemo(() => buildGroups(piModels, 'Pi'), [piModels]);
const modelGroups = useMemo(() => buildGroups(models, 'Chat'), [models]);
const handleSave = async () => {
if (isSaving) return;
setIsSaving(true);
try {
await saveSettings({ ...settings, tasks: { defaultProvider: 'pi', defaultModel: model } });
await saveSettings({ ...settings, tasks: { defaultProvider: 'chat', defaultModel: model } });
toast.success('Task defaults saved');
} catch {
toast.error('Failed to save settings');
@@ -61,7 +61,7 @@ export const TaskDefaults = () => {
<SelectValue placeholder="Same as chat default" />
</SelectTrigger>
<SelectContent className="z-[600] max-h-[300px]">
{piGroups.map(({ provider, models }) => (
{modelGroups.map(({ provider, models }) => (
<SelectGroup key={`pi-${provider}`}>
<SelectLabel>{provider}</SelectLabel>
{models.map((m) => (