Summary
The Pi workspace provider integration currently has two related configuration-layer problems:
- Once OpenAlice creates
<workspace>/.pi-agent, composeEnv() sets PI_CODING_AGENT_DIR to that directory. Pi then treats it as the complete agent directory, so user-level Pi package declarations, settings, and other agent-dir resources from ~/.pi/agent are no longer loaded.
- OpenAlice generates
.pi-agent/models.json with only id and optional contextWindow. It does not carry Pi's model-level reasoning capability, so reasoning-capable custom models are loaded as reasoning: false and Pi disables thinking-level controls.
These should be handled by the same global + workspace Pi configuration reconciliation path, rather than by copying global configuration into every Workspace template.
Environment
- OpenAlice
0.82.0-beta, commit 185f5f338f86b059745e509362c7a49d0ec42090
- Docker deployment, Linux arm64
- Bundled Pi
0.80.6
- Workspace provider using the
openai-responses wire shape
Reproduction A: workspace override hides global Pi resources
- Install/configure Pi packages and behavior in the normal user agent directory (
~/.pi/agent).
- Configure a Pi workspace provider in OpenAlice so that
.pi-agent/models.json and .pi-agent/settings.json are created.
- Start Pi through OpenAlice, or run Pi with
PI_CODING_AGENT_DIR=<workspace>/.pi-agent.
- Compare the loaded packages/settings with a normal Pi invocation using
~/.pi/agent.
Observed: the redirected invocation loads the workspace agent directory as a replacement. User-level package declarations and settings disappear unless they are manually repeated in the Workspace.
Expected: user-level Pi configuration remains the base layer, while OpenAlice's Workspace provider/model configuration is an additive Workspace override.
Reproduction B: generated model loses reasoning capability
OpenAlice currently generates a model entry equivalent to:
{
"id": "some_model",
"contextWindow": 256000
}
Using Pi RPC get_state without making an LLM request gives:
models.json reasoning absent -> model.reasoning=false, thinkingLevel=off
models.json reasoning=true -> model.reasoning=true, thinkingLevel=high
Adding the following field makes Pi expose and use its thinking-level controls:
{
"id": "some_model",
"contextWindow": 256000,
"reasoning": true
}
This manual edit is not durable because piAdapter.writeAiConfig() rewrites the generated models.json.
Source locations
src/workspaces/adapters/pi.ts: redirects the whole agent directory through PI_CODING_AGENT_DIR and generates .pi-agent/{models,settings}.json.
src/workspaces/cli-adapter.ts: WorkspaceAiCred models endpoint/model/context, but has no model capability field for reasoning.
src/workspaces/adapters/ai-config.spec.ts: currently asserts model entries containing only id and optional contextWindow.
Desired behavior
- Treat normal user-level Pi configuration as the base layer and OpenAlice Workspace configuration as an override. Global package declarations/settings should not need to be duplicated into every template or existing Workspace.
- Model reasoning support should be explicit and model-specific, not forced on for every custom model. OpenAlice should carry an optional reasoning capability through its central/default/Workspace config flow and write it into Pi's model entry.
readAiConfig() / writeAiConfig() should round-trip the capability, and later UI/default credential reconciliation should not silently drop it.
- Resetting a Workspace provider should remove only OpenAlice-derived Workspace state and restore normal global behavior.
- Add coverage for both global + Workspace config composition and
reasoning: true generation/round-trip.
Current workaround
A custom Workspace template can repeat global package paths/settings in project config, and reasoning: true can be added manually to .pi-agent/models.json. This works for current Workspaces but is brittle: existing Workspaces drift, global changes do not propagate, and later provider rewrites can discard the manual model field.
Summary
The Pi workspace provider integration currently has two related configuration-layer problems:
<workspace>/.pi-agent,composeEnv()setsPI_CODING_AGENT_DIRto that directory. Pi then treats it as the complete agent directory, so user-level Pi package declarations, settings, and other agent-dir resources from~/.pi/agentare no longer loaded..pi-agent/models.jsonwith onlyidand optionalcontextWindow. It does not carry Pi's model-levelreasoningcapability, so reasoning-capable custom models are loaded asreasoning: falseand Pi disables thinking-level controls.These should be handled by the same global + workspace Pi configuration reconciliation path, rather than by copying global configuration into every Workspace template.
Environment
0.82.0-beta, commit185f5f338f86b059745e509362c7a49d0ec420900.80.6openai-responseswire shapeReproduction A: workspace override hides global Pi resources
~/.pi/agent)..pi-agent/models.jsonand.pi-agent/settings.jsonare created.PI_CODING_AGENT_DIR=<workspace>/.pi-agent.~/.pi/agent.Observed: the redirected invocation loads the workspace agent directory as a replacement. User-level package declarations and settings disappear unless they are manually repeated in the Workspace.
Expected: user-level Pi configuration remains the base layer, while OpenAlice's Workspace provider/model configuration is an additive Workspace override.
Reproduction B: generated model loses reasoning capability
OpenAlice currently generates a model entry equivalent to:
{ "id": "some_model", "contextWindow": 256000 }Using Pi RPC
get_statewithout making an LLM request gives:Adding the following field makes Pi expose and use its thinking-level controls:
{ "id": "some_model", "contextWindow": 256000, "reasoning": true }This manual edit is not durable because
piAdapter.writeAiConfig()rewrites the generatedmodels.json.Source locations
src/workspaces/adapters/pi.ts: redirects the whole agent directory throughPI_CODING_AGENT_DIRand generates.pi-agent/{models,settings}.json.src/workspaces/cli-adapter.ts:WorkspaceAiCredmodels endpoint/model/context, but has no model capability field for reasoning.src/workspaces/adapters/ai-config.spec.ts: currently asserts model entries containing onlyidand optionalcontextWindow.Desired behavior
readAiConfig()/writeAiConfig()should round-trip the capability, and later UI/default credential reconciliation should not silently drop it.reasoning: truegeneration/round-trip.Current workaround
A custom Workspace template can repeat global package paths/settings in project config, and
reasoning: truecan be added manually to.pi-agent/models.json. This works for current Workspaces but is brittle: existing Workspaces drift, global changes do not propagate, and later provider rewrites can discard the manual model field.