You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ef60be8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,7 @@ projects/
80
80
- **Local model servers.** Two parallel discovery paths, deliberately not factored together: Ollama (`/ollama/models` → `OLLAMA_BASE_URL/api/tags`) and any OpenAI-compatible server (`/openai-compatible/models` → `OPENAI_COMPATIBLE_BASE_URL/v1/models`, default LM Studio's `:1234`). The latter's picker section stays hidden unless the env var was set (`configured`) or a server answers. Both URLs are live: `config.ts` exposes getters (`ollamaBaseUrl()`, `openaiCompatibleBaseUrl()`, `openaiCompatibleConfigured()`) read per call rather than import-time constants, and `api/credentials.ts` manages them as non-secret fields (`ollamaBaseUrl`, `openaiCompatibleBaseUrl`, echoed unmasked, http(s) `validate` hook) whose `onChange` calls `registerLocalProviders()` (`agent/models.ts`), so Settings → Providers → Local model servers applies without a restart and clearing one falls back to the default. Only `id` is read from `/v1/models`; refs are `openai-compatible/<id>` and may contain slashes, so only the prefix is stripped. Both providers are billed `local`/$0 in `cost/billing.ts`, `cost/ledger.ts`, and `agent/subagent-bridge.ts` — that trio must stay in sync or a local run defaults to `payg` and counts against the spend cap. Local-only by design: a hosted gateway would need real pricing, so route those through `OPENROUTER_BASE_URL` instead.
81
81
-**Outbound proxy.**`server/src/http-proxy.ts` installs undici's `EnvHttpProxyAgent` as the global dispatcher at boot (`index.ts`, `isMain` block) when `HTTP_PROXY`/`HTTPS_PROXY` is set, and is a no-op otherwise. Node's fetch ignores those variables on its own (`NODE_USE_ENV_PROXY` is Node ≥ 24 and we support ≥ 22.19), and Pi's `configureHttpDispatcher` isn't in the package's public exports — without this the lead agent would dial providers directly while the subagent runner honoured the proxy. Note undici tunnels with `CONNECT` even for `http://` targets.
82
82
- Pi OAuth tokens default to `~/.kady/pi-agent/auth.json`. `KADY_PI_AGENT_DIR` relocates that app-scoped directory; an explicitly supplied `PI_CODING_AGENT_DIR` takes precedence and can intentionally share a standalone Pi directory. The value is inherited by child `pi` processes, so lead and subagents share one auth store.
83
+
-**Provider authentication contract.**`ProviderAuthManager` passes Pi's `LoginOptions.getDeviceId`, backed by `SettingsManager.getOrCreateDeviceId()` in the global agent directory, for current ChatGPT sign-in. Do not promote `.env` keys to `setRuntimeApiKey`: that overlay masks stored OAuth and is invisible to child runtimes. Pi's stored credential wins over environment keys; an explicit Settings key save removes the previous stored credential to select environment-key auth. Clearing an environment key preserves an independent OAuth login and writes empty `.env` assignments (including aliases) so stale shell/legacy keys do not reappear at restart. `setupModelRuntime` normalizes `OR_API_KEY` into the inherited `OPENROUTER_API_KEY`. `/model-providers.configured` describes effective key-or-OAuth availability; `connected` describes OAuth specifically. Real-Pi callback/manual-login regressions with mocked token exchanges live in `server/test/provider-auth-integration.test.ts`.
83
84
- Settings exposes API keys (`/credentials`; model keys under Providers, web-search keys and the Modal pair under Services) plus Pi subscription authentication (`/model-providers`, `/model-auth/flows`; the row's **Sign in** button) for OpenAI (Sign in with ChatGPT; Pi 0.99 relabelled the older `openai-codex` login "OpenAI Codex (legacy)", kept for existing tokens), Anthropic (Claude Pro/Max), GitHub Copilot, xAI, Kimi Code, and Meta (Muse). OAuth browser/device/manual prompts are mediated by `server/src/agent/provider-auth.ts` and `server/src/api/model-providers.ts`. MCP servers, native web search (pi-web-access), and **durable Modal remote compute** (hybrid tools + per-chat selector + project Compute tab) are also implemented. **Not built in:** automated citation verification, first-party literature search, and document conversion (MCP connectors are the extension point).
84
85
85
86
**Capability hub.** The **Settings** dialog (`web/src/components/settings-dialog.tsx`, opened from the header gear) is the only customization surface, a grouped sidebar: **Models** (Providers · Defaults · Fusion), **Project · <name>** (General · Skills · Prompt templates · Specialists · Connectors) and **Workspace** (Services · Appearance). Panels live under `web/src/components/settings/` (`primitives.tsx`, `providers-panel.tsx`, `defaults-panel.tsx`, `project-settings-panel.tsx`, `services-panel.tsx`, `fusion-panel.tsx`, `key-row.tsx`, and `model-field.tsx` — the model picker with a "type a model id" escape hatch used by Defaults, Specialists and Watchdog). Providers merges OAuth sign-in and API-key entry into one row per provider (connected first; "Add a provider" has search, an All / Sign in / API key filter and "Show all"), plus Local model servers and Custom model servers cards; Services holds the web-search keys, the Modal token pair and a Remote cache card (`GET/DELETE /modal/cache`). Project → General replaces the old Edit project dialog (new projects still use the New project dialog) with four independently saved cards: General & budget, Agent instructions (AGENTS.md), Raw-data guard, Context compaction. Deep links go through `web/src/lib/settings-nav.ts` (`openSettings({tab, projectId?, section?})` dispatches `kady:open-settings`; legacy ids `model-providers`→`providers`, `api-keys`→`services`; last tab in localStorage `kady:settings:lastTab`) and `web/src/components/settings-link.tsx`; `app/page.tsx` listens gated on the active workspace and `project-view.tsx` gated on the Projects screen. Project settings are reached from the gear on a project row in the header switcher, "Project settings…" in a project card's ⋯ menu, spend-limit banner links, and the sliders button beside the context gauge (section `context`). With no usable model source (`useModels().hasAnyModelAccess === false`) an empty chat renders `connect-model-card.tsx` ("Connect a model to get started" → Providers), and the picker offers "Manage providers" and "Connect…" for a disconnected selection. Destructive actions in the Project tabs (delete specialist, restore default specialists/templates, clear memory, remove connector) confirm first. Enable/disable is non-destructive: skills move between `sandbox/.pi/skills/` and `sandbox/.pi/skills-disabled/`, project specialists between `sandbox/.pi/agents/` and `sandbox/.pi/agents-disabled/`, and MCP servers keep their entry with Pi's `enabled: false` (a legacy `sandbox/.pi/mcp-disabled.json` is folded in by `migrateDisabledMcpServers`). Builtin (pi-subagents package) specialists are disabled via `subagents.agentOverrides.<name>.disabled` in `sandbox/.pi/settings.json`. Sessions read only the canonical locations, so toggles apply to new chat tabs/subagent runs (live sessions keep their set).
0 commit comments