Skip to content

modes() returns None for WorkspaceWrite sessions #179

@codefromthecrypt

Description

@codefromthecrypt

Problem

session/new and session/load responses omit the modes field for trusted projects using the default auto (WorkspaceWrite) preset.

modes() matches the runtime sandbox policy against presets using PartialEq. The auto preset has writable_roots: vec![] (via new_workspace_write_policy()), but config loading always appends memories_root to writable_roots for any WorkspaceWrite policy. The derived PartialEq compares all fields, so the match fails.

handle_set_mode works fine if called directly. The issue is only that modes() can't identify the current mode to advertise.

Repro

  1. Start codex-acp with a trusted project
  2. Send session/new
  3. Response has sessionId and models but no modes

Related: #57, #172

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