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
- The assistant must be able to rename the current session through a tool call.
- The tool must fail clearly when there is no active session context.
- Empty or whitespace-only titles must be rejected.
- The server bridge must forward the rename to the correct workspace instance with the correct HTTP method and auth.
- The implementation must reuse the existing session/worktree semantics instead of introducing a second title store.
Proposed Implementation
- Add a
rename_session tool under packages/opencode-config/plugin/lib/session.ts.
- Register that tool from
packages/opencode-config/plugin/codenomad.ts.
- Add a plugin endpoint under
packages/server/src/server/routes/plugin.ts for session title updates.
- Forward the request to the OpenCode instance so the session title is updated through the existing session system.
Verification
Suggested verification steps:
- Start CodeNomad with the updated plugin and server code.
- Ask the assistant to rename the current session.
- Confirm the title changes in the session list and active session UI.
- Confirm invalid titles are rejected.
- Confirm the rename still applies when the session is associated with a non-root worktree context.
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:
Requirements
Proposed Implementation
rename_sessiontool underpackages/opencode-config/plugin/lib/session.ts.packages/opencode-config/plugin/codenomad.ts.packages/server/src/server/routes/plugin.tsfor session title updates.Verification
Suggested verification steps: