Skip to content

Plugin: add a /codex_new flow for new threads #18

@huntharo

Description

@huntharo

Problem

We need a /codex_new flow that feels like the sibling of /codex_resume, but starts a fresh Codex thread instead of rebinding an existing one.

If worktrees land, this becomes a major entrypoint rather than just a convenience wrapper.

Current Findings

  • The plugin already has project/thread picker flows for /codex_resume.
  • Codex App Server supports starting new threads with explicit cwd and config overrides.
  • I did not find an App Server protocol method for "add this directory as a new project folder" or a first-class project-management RPC in the same sense as Desktop's project list UX.
  • I also did not find protocol-level worktree lifecycle support, so richer /codex_new behavior would likely need client/plugin-owned worktree creation.

Proposed Scope

  • Add /codex_new to present a project picker.
  • Start a new thread in the selected project/worktree and optionally bind immediately to the current conversation.
  • If/when worktrees land, let /codex_new optionally create a worktree before thread start.
  • Evaluate whether we can expose "add a new directory" in a sane way, or whether that belongs in OpenClaw/core configuration rather than the Codex App Server protocol.

Source Notes

  • Existing resume/project picker command flow: src/controller.ts:982
  • Thread start support in App Server: codex-rs/app-server-protocol/schema/typescript/ClientRequest.ts:56
  • Thread start params (cwd, config overrides): codex-rs/app-server-protocol/schema/typescript/v2/ThreadStartParams.ts:10
  • Plugin thread picker/project grouping: src/thread-picker.ts:12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions