feat(plugin): add session title rename tool#307
Open
VooDisss wants to merge 1 commit intoNeuralNomadsAI:devfrom
Open
feat(plugin): add session title rename tool#307VooDisss wants to merge 1 commit intoNeuralNomadsAI:devfrom
VooDisss wants to merge 1 commit intoNeuralNomadsAI:devfrom
Conversation
Add a CodeNomad plugin tool for renaming the active session title and wire it through the existing plugin bridge to the workspace OpenCode instance. This gives the assistant a dedicated, explicit tool for session renaming without introducing a second title storage path or any UI-only workaround.
The implementation follows the repo's existing plugin architecture: the plugin registers a new
ename_session tool, validates the active session context, and calls a CodeNomad server plugin endpoint. On the server side, that endpoint validates the payload, reuses the workspace instance port and authorization header, and forwards the request to OpenCode using the worktree-aware directory context from the tool execution environment.
This commit also fixes the initial proxy bug discovered during validation. OpenCode's generated SDK updates sessions with PATCH /session/{sessionID}, but the first proxy implementation forwarded the request as POST, which allowed the tool to report success without actually renaming the session. Switching the forwarded request to PATCH aligns the bridge with the real SDK contract and makes session title updates apply correctly.
Description persistence and UI display remain intentionally out of scope for this checkpoint. The goal of this snapshot is to make title renaming reliable end-to-end with the smallest correct change and without touching unrelated session metadata behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #306
Summary
This change adds a dedicated plugin tool for renaming the active session title and wires it through the existing CodeNomad plugin bridge to the correct OpenCode workspace instance.
The goal is to let the assistant perform the same session title rename operation that already exists in the UI, without introducing a separate metadata store or bundling in the still-unsettled description feature.

Why
Users can already rename sessions manually in the UI, but there was no supported end-to-end conversational path for the assistant to do the same thing.
That mismatch meant the assistant could acknowledge a rename request without having a repo-native implementation path to update the actual session title. This PR closes that gap with the smallest correct change and keeps the scope intentionally limited to title renaming only.
What Changed
rename_sessionplugin tool inpackages/opencode-config/plugin/lib/session.ts.packages/opencode-config/plugin/codenomad.ts.packages/server/src/server/routes/plugin.tsthat proxies title updates to the workspace OpenCode instance.directoryso the rename follows the existing worktree-aware session targeting behavior.PATCH, matching the real OpenCode SDKsession.updatecontract.Scope Boundaries
Included:
Not included:
Technical Notes
The OpenCode SDK contract for session updates is not
POST; it isPATCH /session/{sessionID}with a body containing the updatable fields such astitle.That detail matters because the first implementation path could appear successful while failing to apply the rename if the bridge used the wrong HTTP method. The final implementation aligns the server proxy with the generated SDK contract so the rename is applied by the actual OpenCode session update endpoint.
Files Changed
packages/opencode-config/plugin/codenomad.tspackages/opencode-config/plugin/lib/session.tspackages/server/src/server/routes/plugin.tsVerification
Performed:
session.update.POSTtoPATCH.packages/serversuccessfully.Build note:
Risks and Follow-up