Skip to content

Add plugin tool for renaming the active session title #306

@VooDisss

Description

@VooDisss

CodeNomad should support renaming the active OpenCode session title through the plugin tool bridge so the assistant can update a conversation title when the user explicitly asks for it.

Problem

Today, session renaming exists in the UI, but not through the plugin tool layer used by the assistant during a conversation.

That creates a gap between what users can do manually in the interface and what they can ask the assistant to do conversationally. A user can ask to rename the session, but there is no dedicated supported path for updating the actual session title through the assistant.

Goal

Add a dedicated plugin tool that renames the current session title.

Scope

In scope:

  • Add a plugin tool dedicated to session title renaming
  • Register the tool in the CodeNomad OpenCode plugin entry point
  • Add a server-side path that updates the current session title
  • Preserve the existing session targeting behavior so the correct session is renamed

Requirements

  1. The assistant must be able to rename the current session through a tool call.
  2. The tool must fail clearly when there is no active session context.
  3. Empty or whitespace-only titles must be rejected.
  4. The server bridge must forward the rename to the correct workspace instance with the correct HTTP method and auth.
  5. The implementation must reuse the existing session/worktree semantics instead of introducing a second title store.

Proposed Implementation

  1. Add a rename_session tool under packages/opencode-config/plugin/lib/session.ts.
  2. Register that tool from packages/opencode-config/plugin/codenomad.ts.
  3. Add a plugin endpoint under packages/server/src/server/routes/plugin.ts for session title updates.
  4. Forward the request to the OpenCode instance so the session title is updated through the existing session system.

Verification

Suggested verification steps:

  1. Start CodeNomad with the updated plugin and server code.
  2. Ask the assistant to rename the current session.
  3. Confirm the title changes in the session list and active session UI.
  4. Confirm invalid titles are rejected.
  5. Confirm the rename still applies when the session is associated with a non-root worktree context.

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