Skip to content

Commit d012327

Browse files
committed
docs: thinking-level caveat (global settings persistence) + six-level comment fix
1 parent 965ac9a commit d012327

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ projects/
8686

8787
- **One flat agent.** For independent/parallel subtasks the agent calls the `subagent` tool from the **pi-subagents** package, which spawns child `pi` CLI processes in the sandbox (the binary resolves from `server/node_modules/.bin`). Specialist scientific agents are seeded into each project's `sandbox/.pi/agents/*.md` from `server/src/agent/subagents.ts` (write-if-missing; user edits win). Budget gating + cost ledgering for child runs lives in `server/src/agent/subagent-bridge.ts`.
8888
- **Interview tool (clarifying questions).** The `interview` custom tool (`server/src/agent/interview.ts`) blocks the run on a pending-answer promise; the questions ride the normal `tool_start` SSE frame and the chat UI renders them as an inline form (`web/src/components/interview-form.tsx`), POSTing answers to `/sessions/:id/interview/:toolCallId`. Tool `promptGuidelines` + the seeded `AGENTS.md` push the agent to interview liberally before assuming. Question schema mirrors pi-interview (single/multi/text/image/info, recommended/conviction/weight, code `content`, image/table/mermaid/chart/html `media`); user-uploaded images return to the model as image blocks. Deliberately NOT exposed to sub-agent child processes — they are headless and must not block on user input.
89+
- **Thinking level.** Each chat tab has a per-run thinking-level selector (`web/src/components/thinking-selector.tsx`, default `high`); the run body's `thinkingLevel` is validated by `server/src/agent/thinking.ts` and applied via Pi's `session.setThinkingLevel()` after `setModel`. Ollama and Fusion runs send no level (chip disabled). Caveat: like `setModel`, Pi's `setThinkingLevel` also persists the value as the **global default** in `~/.pi/agent/settings.json` — so the last level picked in any tab becomes the starting level for subagent child `pi` processes and for the user's own `pi` CLI. Pin a `thinking` level in a specialist's frontmatter if a subagent must not inherit it.
8990
- **Modal remote compute (`modal_run`).** Gated on `MODAL_TOKEN_ID`/`MODAL_TOKEN_SECRET` (managed live via `/credentials`; `modalConfigured()` in `server/src/config.ts`). `server/src/agent/modal-tool.ts` is an in-process custom tool, registered in `session-registry.ts` only when configured. It uses the `modal` JS SDK to create an isolated Sandbox on a chosen instance (`server/src/agent/modal-instances.ts` catalogue — `cpu`→`h100`, with GPU string + hourly rate), stages `files_in`, runs the command, copies `files_out` back into the local sandbox (which stays the canonical filesystem — no split-brain), and ledgers wall-time × rate as a `compute` row. The per-chat instance is picked in the UI (`web/src/components/compute-selector.tsx`, gated on `modalConfigured`) and threaded through the run body → `setSessionComputeTarget` → the tool's session default. Like `interview`, it is an in-process custom tool, so it is NOT seen by sub-agent child `pi` processes; promoting it to a Pi package (mirroring web-access) would extend it to them. No secrets are injected into the sandbox by default.
9091
- **OpenRouter cost** is read from Pi's `usage.cost` (computed from `model.cost`). For synthesized OpenRouter models the pricing comes from `web/src/data/models.json`; keep that catalogue current for accurate cost.
9192
- **Node ≥ 22.19** is what Pi targets; lower 22.x usually works but emits an `EBADENGINE` warning. Node < 22 (e.g. v20) fails to build/install the packages, so `start.sh` refuses to run on it.

web/src/lib/use-agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export function useAgent() {
368368
// backend runs a single flat agent. Skill/database hints are still injected
369369
// into the prompt text by the caller. `computeTarget` is the selected Modal
370370
// instance id, forwarded so the modal_run tool defaults to it. `thinkingLevel`
371-
// is the extended-thinking level ("off" / "low" / "medium" / "high").
371+
// is the extended-thinking level ("off" / "minimal" / "low" / "medium" / "high" / "xhigh").
372372
async (
373373
text: string,
374374
model?: string,

0 commit comments

Comments
 (0)