Skip to content

Add session rename API parity with Copilot CLI (/rename and /session rename) #462

@brunoborges

Description

@brunoborges

Copilot CLI supports renaming the active session via /rename <name> (alias of /session rename <name>), but this capability is not exposed in the SDK APIs.

Please add first-class session rename support in copilot-sdk so applications can rename sessions programmatically without invoking CLI commands manually.

Problem

Today, SDK consumers cannot rename the current session after creation. CLI users can, through:

  • /rename <name>
  • /session rename <name>

Both commands behave the same way.

Why this matters

  • Increases feature parity between CLI and SDK experiences
  • Supports chat UIs/workbenches that allow conversation renaming
  • Avoids brittle workarounds that shell out to CLI command text
  • Improves metadata management for long-lived and resumed sessions

Requested capability

Add APIs to name / rename a session. Suggestions:

  • add name to SessionMetadata
  • session.rename(name)
  • session.getName() returns the name of the session
  • client.renameSession(sessionId, name)
  • client.getSessionName(sessionId) returns the name of the session
  • client.listSessions() should include names, if set, in the SessionMetadata objects / data structures

Expected behavior

  • Renames the target/current session
  • Follows the same validation rules as CLI rename commands
  • Returns success and/or updated session metadata
  • Works consistently for active and resumed sessions

Acceptance criteria

  • Session rename is available through the official SDK API surface
  • Behavior matches CLI (/rename and /session rename)
  • Documented in SDK docs with examples
  • Covered by tests (including invalid names and resumed sessions)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions