fix(kap-server): derive session title from first skill slash command - #1741
Merged
Conversation
The v1 REST skill-activation route called IAgentSkillService.activate directly and skipped the prompt-metadata update, so a session whose first message is a /<skill> slash command (e.g. from the web UI) kept the "New Session" placeholder until a later plain prompt set an unrelated title. Apply the same applyPromptMetadataUpdate + promptMetadataTextFromSkill used by the native RPC path so the first skill activation titles the session, matching the TUI behavior.
🦋 Changeset detectedLatest commit: fedc6f3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merged
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.
Related Issue
No linked issue — the problem is explained below.
Problem
When a session's first message is a skill slash command sent through the v1 REST API (
POST /sessions/{id}/skills/{name}:activate, used by the web UI), the session title is never derived from that message: the session stays at the "New Session" placeholder until a later plain prompt overwrites it with an unrelated title.The TUI / native RPC path already titles such sessions (
/<skill> <args>), because the legacy session RPC applies a prompt-metadata update onactivateSkill. The kap-server v1 port of the route bypassed that path and called the skill service directly, dropping the metadata update the old v1 server got for free.What changed
packages/kap-server/src/routes/skills.ts: after a successful activation, apply the sameapplyPromptMetadataUpdate+promptMetadataTextFromSkillused by the native RPC path, so a first/<skill>message titles the session. It is a no-op for custom titles and failed activations.packages/kap-server/test/skills.test.ts: added a test asserting the session title is derived from the first skill activation.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.