Skip to content

Workspaces and threads

A workspace is a directory: every visible directory in the workspaces root (~/.omfp), plus each --workspace <dir>. It holds whatever the work needs (repositories, notes, skills) and, in .omfp/init.ts, what omfp looks like and does there. Its threads all run in that directory.

A thread is one conversation: a pi session with its own model, history and agent, running in a host of its own. Threads keep working when no window is open; the left column shows which are running, waiting for you, failed or unread.

An agent delegates with the task tool: each task becomes a child thread nested under its parent, running in parallel in the same workspace. You can watch a child as it works; it is read-only unless the parent made it interactive. When it ends, its last reply reaches the parent as a message (or through task_wait), and it is archived. Children can start their own children up to agents.maxDepth levels (default 2).

flowchart TB
  parent["Thread: fix the release"]
  a["Child: fix the parser bug"]
  b["Child: update the changelog"]
  parent -->|task| a
  parent -->|task| b
  a -.->|result message| parent
  b -.->|result message| parent

A thread and its children share a local:// folder for plans, notes and reports; an agent reads another thread’s transcript at thread://<id> and waits for one with omfp_thread_wait.

Two subagents fixing two bugs in parallel, the plan beside them, and the agent asking before shipping

A workspace’s MCP servers come from its .pi/mcp.json (pi’s project file), its mcp.json, its .mcp.json (Claude Code’s) and the servers its init files declare (ctx.mcp.define), then <data>/pi-agent/mcp.json for every workspace; the first source naming a server wins. Threads get their tools as mcp__<server>__<tool>; widgets call them through the daemon (useMcp, useMcpTool), with no thread running. The daemon keeps their OAuth logins in <data>/pi-agent/mcp-auth.json; the omfp:mcp widget shows the servers and what a thread’s session made of them.