Skip to content

[Producer] Protocol – Add Plan Mode config + events #23

@github-actions

Description

@github-actions

Context

Part of #17. Introduces the protocol/config surface needed for Plan Mode.

Requirements

  • Add a top-level config key plan_mode (boolean) with default false.
  • Add per-session override capability via environment context/turn context (like approval_policy).
  • Extend protocol with new events and requests to support planning:
    • PlanProposed event: includes a concise ordered list of steps (edits, commands, tests) and free‑form notes.
    • PlanDecision request/response: client sends Accept | Edit | Cancel; include edited plan if Edit.
  • Wire plan_mode through codex-core configuration and protocol types.

Acceptance Criteria

  • codex-protocol exposes plan_mode on SessionConfigured (or equivalent) and accepts overrides per turn.
  • New protocol enums/structs exist for PlanProposed and PlanDecision with serde + Display impls.
  • codex-core Config and EnvironmentContext include optional plan_mode and serialize in the XML context block.
  • Unit tests cover serde round‑trip and defaulting behavior.

Implementation Notes

  • Files to touch:
    • codex-rs/protocol/src/config_types.rs (add plan_mode)
    • codex-rs/core/src/config.rs and codex-rs/core/src/environment_context.rs
    • codex-rs/protocol/src/protocol.rs (new event/request types)
  • Follow patterns used by approval_policy for config/plumbing.

Dependencies

  • None.
  • Blocks: Core planning gate, TUI overlay, CLI toggle, tests, docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestproducerProducer-created planning/analysis taskproducer functionalityFunctional task generated by producer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions