Skip to content

fix(kap-server): derive session title from first skill slash command - #1741

Merged
chengluyu merged 1 commit into
mainfrom
fix/skill-activation-title
Jul 15, 2026
Merged

fix(kap-server): derive session title from first skill slash command#1741
chengluyu merged 1 commit into
mainfrom
fix/skill-activation-title

Conversation

@chengluyu

Copy link
Copy Markdown
Collaborator

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 on activateSkill. 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 same applyPromptMetadataUpdate + promptMetadataTextFromSkill used 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.
  • Added a patch changeset (the symptom is visible in the bundled web UI).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

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-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fedc6f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 15, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@fedc6f3
npx https://pkg.pr.new/@moonshot-ai/kimi-code@fedc6f3

commit: fedc6f3

@chengluyu

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: fedc6f3bf1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chengluyu
chengluyu merged commit 8a3f1ff into main Jul 15, 2026
15 checks passed
@chengluyu
chengluyu deleted the fix/skill-activation-title branch July 15, 2026 07:42
@github-actions github-actions Bot mentioned this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant