Skip to content

Pi workspace provider override hides global config and omits reasoning capability #662

Description

@dbydd

Summary

The Pi workspace provider integration currently has two related configuration-layer problems:

  1. 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.
  2. 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

  1. Install/configure Pi packages and behavior in the normal user agent directory (~/.pi/agent).
  2. Configure a Pi workspace provider in OpenAlice so that .pi-agent/models.json and .pi-agent/settings.json are created.
  3. Start Pi through OpenAlice, or run Pi with PI_CODING_AGENT_DIR=<workspace>/.pi-agent.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions