From 8bdf11aa801eb2cd8fe551c55b799cdee04c52bd Mon Sep 17 00:00:00 2001
From: Jeff Scott Ward
PI WEB configuration covers the machine-local and project-local settings you usually need: bind address,
trusted development-host settings, UI preferences, PI WEB plugin enablement, file-explorer path access,
- manual upload defaults, upload limits, and session-daemon tools.
+ manual upload defaults, upload limits, agent runtime selection, and session-daemon tools.
Configure PI WEB where your agents work.
Configure PI WEB where your agents work.
Config matrix
External path access
Manual uploads
+ Agent runtime
Session tools
Completion tools
@@ -145,13 +146,16 @@ Precedence and reloads
Environment overrides include PI_WEB_HOST, PI_WEB_PORT / PORT,
- PI_WEB_ALLOWED_HOSTS, PI_WEB_MAX_UPLOAD_BYTES, PI_WEB_SPAWN_SESSIONS,
- and PI_WEB_SUBSESSIONS.
+ PI_WEB_ALLOWED_HOSTS, PI_WEB_MAX_UPLOAD_BYTES, PI_WEB_AGENT_COMMAND,
+ PI_WEB_AGENT_DIR, PI_WEB_AGENT_SESSION_DIR, PI_CODING_AGENT_DIR,
+ PI_CODING_AGENT_SESSION_DIR, OMP_CODING_AGENT_DIR,
+ OMP_CODING_AGENT_SESSION_DIR, PI_WEB_SPAWN_SESSIONS, and
+ PI_WEB_SUBSESSIONS.
host / port: restart the gateway web/API service or process.maxUploadBytes: restart both the web/API process and the session daemon on that machine.spawnSessions / subsessions: restart the session daemon on that machine.agent.command / agent.dir / spawnSessions / subsessions: restart the session daemon on that machine.pathAccess: applies on the next request; existing file views may need a browser refresh.uploads.defaultFolder: applies to newly opened Files upload dialogs and new direct drag/drop batches after config/workspace refresh.plugins: reload the browser tab after changing PI WEB plugin enablement.— are runtime-only environment variables, not config-file keys. Global means
machine-global. In Settings, selected-machine-safe global keys (pathAccess, uploads,
- maxUploadBytes, spawnSessions, subsessions, and plugins)
- are edited for the selected machine; gateway host/port/allowed-hosts, keyboard shortcuts, and machine
+ maxUploadBytes, agent, spawnSessions, subsessions,
+ and plugins) are edited for the selected machine; gateway host/port/allowed-hosts, keyboard shortcuts, and machine
registry/tokens stay local.
agent.commandPI_WEB_AGENT_COMMANDagent.dirPI_WEB_AGENT_DIR, PI_CODING_AGENT_DIR, OMP_CODING_AGENT_DIRspawnSessionsPI_CODING_AGENT_SESSION_DIRPI_WEB_AGENT_SESSION_DIR, PI_CODING_AGENT_SESSION_DIR, OMP_CODING_AGENT_SESSION_DIRPI_CODING_AGENT_DIRPI_WEB_AGENT_DIR, PI_CODING_AGENT_DIR, OMP_CODING_AGENT_DIR
+ agent.command controls which Pi-compatible CLI PI WEB checks in doctor/status/update flows.
+ It defaults to pi; set it to another compatible command when this machine should use a Pi-compatible fork.
+
+ agent.dir controls which compatible agent state directory PI WEB reads for auth providers,
+ model settings, settings, and session metadata. It defaults to the selected agent's conventional
+ directory (~/.pi/agent for pi; set an explicit path for compatible forks).
+
{
+ "agent": {
+ "command": "pi",
+ "dir": "~/.pi/agent"
+ }
+}
+
+ Environment variables take precedence over the config file. PI_WEB_AGENT_COMMAND selects the
+ command, PI_WEB_AGENT_DIR sets the state directory for any command, and command-specific
+ variables are honored for compatible runtimes.
+
+ Session directory overrides are environment-only. Set PI_WEB_AGENT_SESSION_DIR or the selected
+ command's session variable when you need to override session storage separately from agent.dir.
+
spawnSessionsEnter the API key for ${state.provider.name}. It will be stored by pi in auth.json.
Enter the API key for ${state.provider.name}. It will be stored in the configured agent auth.json.
${config.path}
pi commands require an explicit state directory, then a session daemon restart.
+ {
+async function getSessiondComponentStatus(daemon: PiWebStatusDaemon, options: PiWebStatusOptions = {}): Promise
Environment overrides include
+ For example, an OMP setup can use
Environment variables take precedence over the config file.
+ Command-specific environment names are derived from the selected command's basename by stripping common
+ executable extensions, replacing non-alphanumeric characters with underscores, and uppercasing the result.
+ For example,
Session directory overrides are environment-only. Set Precedence and reloads
PI_WEB_HOST, PI_WEB_PORT / PORT,
PI_WEB_ALLOWED_HOSTS, PI_WEB_MAX_UPLOAD_BYTES, PI_WEB_AGENT_COMMAND,
- PI_WEB_AGENT_DIR, PI_WEB_AGENT_SESSION_DIR, PI_CODING_AGENT_DIR,
- PI_CODING_AGENT_SESSION_DIR, OMP_CODING_AGENT_DIR,
- OMP_CODING_AGENT_SESSION_DIR, PI_WEB_SPAWN_SESSIONS, and
- PI_WEB_SUBSESSIONS.
+ PI_WEB_AGENT_DIR, PI_WEB_AGENT_SESSION_DIR,
+ PI_CODING_AGENT_DIR / PI_CODING_AGENT_SESSION_DIR for the default
+ pi command, the selected non-pi command's
+ <COMMAND>_CODING_AGENT_DIR / <COMMAND>_CODING_AGENT_SESSION_DIR,
+ PI_WEB_SPAWN_SESSIONS, and PI_WEB_SUBSESSIONS.
host / port: restart the gateway web/API service or process.maxUploadBytes: restart both the web/API process and the session daemon on that machine.agent.command / agent.dir / spawnSessions / subsessions: restart the session daemon on that machine.agent.command / agent.dir: restart the web/API process and the session daemon on that machine.spawnSessions / subsessions: restart the session daemon on that machine.pathAccess: applies on the next request; existing file views may need a browser refresh.uploads.defaultFolder: applies to newly opened Files upload dialogs and new direct drag/drop batches after config/workspace refresh.plugins: reload the browser tab after changing PI WEB plugin enablement.Global config example
},
"maxUploadBytes": 67108864,
"agent": {
- "command": "omp",
- "dir": "~/.omp/agent"
+ "command": "pi",
+ "dir": "~/.pi/agent"
},
"spawnSessions": true,
"subsessions": false,
@@ -323,15 +325,15 @@ Config matrix
PI_WEB_AGENT_COMMANDGlobal/session daemon
Not supported locally
- Restart session daemon on that machine; affects doctor/status/update checks
+ Restart web/API and session daemon on that machine; affects doctor/status/update checks
Agent state directory
- agent.dir
+ PI_WEB_AGENT_DIR, PI_CODING_AGENT_DIR, OMP_CODING_AGENT_DIRPI_WEB_AGENT_DIR, PI_CODING_AGENT_DIR for pi, selected non-pi command's <COMMAND>_CODING_AGENT_DIRGlobal/session daemon
Not supported locally
- Restart session daemon on that machine; affects auth, models, settings, and sessions
+ Restart web/API and session daemon on that machine; affects auth, models, settings, and sessions
Agent can spawn sessions
@@ -441,7 +443,7 @@ Config matrix
Agent session storage directory
—
-
+ PI_WEB_AGENT_SESSION_DIR, PI_CODING_AGENT_SESSION_DIR, OMP_CODING_AGENT_SESSION_DIRPI_WEB_AGENT_SESSION_DIR, PI_CODING_AGENT_SESSION_DIR for pi, selected non-pi command's <COMMAND>_CODING_AGENT_SESSION_DIRSession daemon env
Not supported locally
Restart session daemon; env-only session storage override
@@ -449,7 +451,7 @@ Config matrix
Agent config directory
—
-
+ PI_WEB_AGENT_DIR, PI_CODING_AGENT_DIR, OMP_CODING_AGENT_DIRPI_WEB_AGENT_DIR, PI_CODING_AGENT_DIR for pi, selected non-pi command's <COMMAND>_CODING_AGENT_DIRWeb/API + session daemon env
Not supported locally
Restart services
@@ -524,33 +526,46 @@ Manual upload defaults
Agent runtime
agent.command controls which Pi-compatible CLI PI WEB checks in doctor/status/update flows.
- It defaults to pi; set it to another compatible command when this machine should use a Pi-compatible fork.
+ It defaults to pi. PI WEB's embedded session runtime still uses the bundled SDK path; changing
+ this command does not load a different session implementation.
agent.dir controls which compatible agent state directory PI WEB reads for auth providers,
- model settings, settings, and session metadata. It defaults to the selected agent's conventional
- directory (~/.pi/agent for pi; set an explicit path for compatible forks).
+ model settings, settings, and session metadata. It defaults to ~/.pi/agent only when the
+ selected command resolves to pi. For any other command, set agent.dir,
+ PI_WEB_AGENT_DIR, or the selected command's <COMMAND>_CODING_AGENT_DIR explicitly.
{
"agent": {
- "command": "pi",
- "dir": "~/.pi/agent"
+ "command": "my-pi-fork",
+ "dir": "/opt/my-pi-fork/agent"
}
}"command": "omp" with
+ "dir": "~/.omp/agent" and, if needed, OMP_CODING_AGENT_DIR /
+ OMP_CODING_AGENT_SESSION_DIR environment overrides.
+ PI_WEB_AGENT_COMMAND selects the
command, PI_WEB_AGENT_DIR sets the state directory for any command, and command-specific
variables are honored for compatible runtimes.
my-pi-fork uses MY_PI_FORK_CODING_AGENT_DIR and
+ MY_PI_FORK_CODING_AGENT_SESSION_DIR.
+ PI_WEB_AGENT_SESSION_DIR or the selected
command's session variable when you need to override session storage separately from agent.dir.
pi-web restart on that machine (or restart its session daemon service) after changing these settings.`,
+ content: html`run pi-web restart on that machine after changing these settings. If restarting services manually, restart both web/API and session daemon after changing the agent command or state directory.`,
});
}
return notices;
@@ -143,24 +157,7 @@ export class SettingsSessiondPanel extends LitElement {
private async saveAgentField(field: "command" | "dir", event: Event): Promise