Archived
feat: generalize agent runtime config
This commit is contained in:
+25
-19
@@ -131,8 +131,7 @@
|
||||
Environment overrides include <code>PI_WEB_HOST</code>, <code>PI_WEB_PORT</code> / <code>PORT</code>,
|
||||
<code>PI_WEB_ALLOWED_HOSTS</code>, <code>PI_WEB_MAX_UPLOAD_BYTES</code>, <code>PI_WEB_AGENT_COMMAND</code>,
|
||||
<code>PI_WEB_AGENT_DIR</code>, <code>PI_WEB_AGENT_SESSION_DIR</code>, <code>PI_CODING_AGENT_DIR</code>,
|
||||
<code>PI_CODING_AGENT_SESSION_DIR</code>, <code>OMP_CODING_AGENT_DIR</code>,
|
||||
<code>OMP_CODING_AGENT_SESSION_DIR</code>, <code>PI_WEB_SPAWN_SESSIONS</code>, and
|
||||
<code>PI_CODING_AGENT_SESSION_DIR</code>, <code>PI_WEB_SPAWN_SESSIONS</code>, and
|
||||
<code>PI_WEB_SUBSESSIONS</code>.
|
||||
</p>
|
||||
<ul>
|
||||
@@ -165,8 +164,8 @@
|
||||
},
|
||||
"maxUploadBytes": 67108864,
|
||||
"agent": {
|
||||
"command": "omp",
|
||||
"dir": "~/.omp/agent"
|
||||
"command": "pi",
|
||||
"dir": "~/agent-profiles/research"
|
||||
},
|
||||
"spawnSessions": true,
|
||||
"subsessions": false,
|
||||
@@ -281,7 +280,7 @@
|
||||
<tr>
|
||||
<td>Agent state directory</td>
|
||||
<td><code>agent.dir</code></td>
|
||||
<td><code>PI_WEB_AGENT_DIR</code>, <code>PI_CODING_AGENT_DIR</code>, <code>OMP_CODING_AGENT_DIR</code></td>
|
||||
<td><code>PI_WEB_AGENT_DIR</code>, <code>PI_CODING_AGENT_DIR</code></td>
|
||||
<td>Global/session daemon</td>
|
||||
<td>Not supported locally</td>
|
||||
<td>Restart session daemon; affects auth, models, settings, and sessions</td>
|
||||
@@ -394,7 +393,7 @@
|
||||
<tr>
|
||||
<td>Agent session storage directory</td>
|
||||
<td>—</td>
|
||||
<td><code>PI_WEB_AGENT_SESSION_DIR</code>, <code>PI_CODING_AGENT_SESSION_DIR</code>, <code>OMP_CODING_AGENT_SESSION_DIR</code></td>
|
||||
<td><code>PI_WEB_AGENT_SESSION_DIR</code>, <code>PI_CODING_AGENT_SESSION_DIR</code></td>
|
||||
<td>Session daemon env</td>
|
||||
<td>Not supported locally</td>
|
||||
<td>Restart session daemon; env-only session storage override</td>
|
||||
@@ -402,7 +401,7 @@
|
||||
<tr>
|
||||
<td>Agent config directory</td>
|
||||
<td>—</td>
|
||||
<td><code>PI_WEB_AGENT_DIR</code>, <code>PI_CODING_AGENT_DIR</code>, <code>OMP_CODING_AGENT_DIR</code></td>
|
||||
<td><code>PI_WEB_AGENT_DIR</code>, <code>PI_CODING_AGENT_DIR</code></td>
|
||||
<td>Web/API + session daemon env</td>
|
||||
<td>Not supported locally</td>
|
||||
<td>Restart services</td>
|
||||
@@ -448,34 +447,41 @@
|
||||
<h2>Agent runtime</h2>
|
||||
<p>
|
||||
<code>agent.command</code> controls which Pi-compatible CLI PI WEB checks in doctor/status/update flows.
|
||||
It defaults to <code>pi</code>; set it to <code>omp</code> when this machine should use Oh My Pi.
|
||||
It defaults to <code>pi</code>. Set it only when diagnostics and package-managed update checks should target
|
||||
another compatible command; the embedded session runtime still uses PI WEB's SDK integration.
|
||||
</p>
|
||||
<p>
|
||||
<code>agent.dir</code> 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 (<code>~/.pi/agent</code> for <code>pi</code>, <code>~/.omp/agent</code> for <code>omp</code>).
|
||||
model settings, settings, and session metadata. It defaults to <code>~/.pi/agent</code>. Set it to another
|
||||
Pi-compatible state directory when you want an isolated profile or an alternate compatible agent's data.
|
||||
</p>
|
||||
<div class="code-card">
|
||||
<pre><code>{
|
||||
"agent": {
|
||||
"command": "omp",
|
||||
"dir": "~/.omp/agent"
|
||||
"command": "pi",
|
||||
"dir": "~/agent-profiles/research"
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
<p>
|
||||
Environment variables take precedence over the config file. <code>PI_WEB_AGENT_COMMAND</code> selects the
|
||||
command, <code>PI_WEB_AGENT_DIR</code> sets the state directory for any command, and command-specific
|
||||
variables such as <code>OMP_CODING_AGENT_DIR</code> are honored when the selected command is <code>omp</code>.
|
||||
For example, an Oh My Pi profile can set <code>agent.command</code> to <code>omp</code> and
|
||||
<code>agent.dir</code> to <code>~/.omp/agent</code>.
|
||||
</p>
|
||||
<p>
|
||||
Session directory overrides are environment-only. Set <code>PI_WEB_AGENT_SESSION_DIR</code> or the selected
|
||||
command's session variable (for example <code>OMP_CODING_AGENT_SESSION_DIR</code>) when you need to override
|
||||
session storage separately from <code>agent.dir</code>.
|
||||
Environment variables take precedence over the config file. <code>PI_WEB_AGENT_COMMAND</code> selects the
|
||||
command, <code>PI_WEB_AGENT_DIR</code> sets the state directory for any command, and
|
||||
<code>PI_WEB_AGENT_SESSION_DIR</code> overrides session storage separately from <code>agent.dir</code>.
|
||||
Existing Pi Coding Agent env names (<code>PI_CODING_AGENT_DIR</code> and
|
||||
<code>PI_CODING_AGENT_SESSION_DIR</code>) remain supported for compatibility.
|
||||
</p>
|
||||
<p>
|
||||
Session directory overrides are environment-only; use <code>PI_WEB_AGENT_SESSION_DIR</code> unless you need
|
||||
the legacy Pi-compatible <code>PI_CODING_AGENT_SESSION_DIR</code> name.
|
||||
</p>
|
||||
<div class="callout warning">
|
||||
Restart the session daemon after changing agent settings. The web/API process can display the new config
|
||||
immediately, but active session runtime ownership is intentionally long-lived.
|
||||
immediately, and status/plugin discovery may re-read it on later requests, but active session runtime
|
||||
ownership is intentionally long-lived.
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user