Skip to content

feat: mention other sessions from the @ menu - #5068

Merged
wbxl2000 merged 7 commits into
mainfrom
qer/session-list-search
Nov 19, 2026
Merged

wbxl2000 merged 7 commits into
mainfrom
qer/session-list-search

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Requirement or Bug

在一个会话里经常需要参考另一个会话做过的事,比如「接着那个会话的结论往下做」。现在只能手动复制内容或描述那个会话,agent 也不知道去哪里找它的记录。

本 PR 之后,在 desktop 或 kimi web 的输入框输入 @,可以从「会话」子菜单搜索并引用其他会话。发送时 prompt 里会带上被引用会话主 agent wire.jsonl 的绝对路径,agent 用自己的工具去读。这是实验功能,默认关闭,在「设置 > 实验室 > 引用会话」打开。

Bug Reproduction Steps

N/A

Root Cause

N/A

Code Changes

核心思路:@ 根菜单多一个「会话」入口,进入后列出本机未归档的其他会话,当前工作区优先,按更新时间倒序。@ 后输入的文字先过滤客户端已加载的会话,停顿 150ms 后再用新增的 GET /api/v1/sessions?query= 查本机服务端,所以侧边栏没加载到的会话也能找到。选中后插入一个会话 pill,序列化为 [标题](kimi-code://session/<workspaceId>/<sessionId>)。发送时,客户端在提交副本末尾追加 <referenced_sessions> 块,每个被引用的会话一行 id、title、log。log 由 GET /api/v1/meta 新返回的 home_dir,加上用户文档「数据路径」里写明的布局 sessions/<workspaceId>/<sessionId>/agents/main/wire.jsonl 拼成。服务端不解析正文里的会话链接;输入框快照、用户气泡、会话标题和 last prompt 里都只显示 pill。整个入口受实验室开关控制:开关关闭,或者当前工作区在远程 SSH 设备上时,菜单里没有会话入口,也不发搜索请求。

概念 回答什么问题 本 PR 之后
session mention 用户引用了哪个会话 新的 mention kind session,path 为 <workspaceId>/<sessionId>
<referenced_sessions> 块 模型去哪里读被引用的会话 发送时追加到提交副本,只含 id、title、log
home_dir 服务端的数据目录在哪 GET /api/v1/meta 的新字段
query 怎么按文本找会话 GET /api/v1/sessions 的新参数:标题或最后一条消息包含该文本(不区分大小写),或会话 ID 完全相同
flowchart LR
  subgraph Renderer["desktop / kimi web 渲染端"]
    Pool[(已加载的会话)]
    Menu[会话入口与二级菜单<br/>本地排序 + 服务端搜索]
    Doc[输入框文档<br/>session pill]
    Submit[发送<br/>追加 referenced_sessions]
  end
  subgraph Server[kap-server]
    List["GET /sessions?query="]
    Meta["GET /meta:home_dir"]
  end
  Agent[agent<br/>读取 wire.jsonl]
  Pool --> Menu
  Menu -- 防抖查询,只查本机 --> List
  Menu -- 插入 --> Doc
  Doc --> Submit
  Meta -- 启动时读取 --> Submit
  Submit -- prompt --> Agent
Loading

菜单只负责找到会话并插入 pill,日志路径到发送时才拼出来。因此草稿、快照和历史消息里只保存会话身份,不保存某台机器上的绝对路径。服务端只补两项事实(按文本过滤会话、报告数据目录),不理解客户端的标记。

决策 选择 没选 理由
模型怎么拿到会话内容 prompt 里只给 wire.jsonl 的绝对路径,不附读取说明,模型用自己的文件工具读 服务端替它读、整理成转录文本,或 fork 被引用的会话 保持简单,不替模型决定怎么读
路径由谁拼 客户端用 home_dir 加文档里的目录布局拼 服务端识别正文里的会话链接并展开 服务端从不解析正文里的客户端标记(技能激活也走请求里的结构化字段 skills);目录布局已经写在用户文档「数据路径」里
根目录从哪来 GET /api/v1/meta 的 home_dir 桌面主进程自己解析 KIMI_CODE_HOME,web 猜 <home>/.kimi-code 路径必须对运行 agent 的服务端成立;连外部 server 或自定义 KIMI_CODE_HOME 时,只有服务端知道
怎么搜索 GET /api/v1/sessions?query= 复用 POST /api/v1/search 全局搜索默认关闭,要先给所有 wire.jsonl 建索引,结果按消息命中且不能按 ID 查
搜索范围 只查本机(请求不带 hosts=include) 扇出到所有 SSH 设备 远程设备上的日志本机 agent 读不到,候选里本来就排除;也避免每次输入都请求所有设备
ID 怎么匹配 完整 ID 精确匹配(不区分大小写) 子串匹配 所有 ID 都以 session_ 开头,子串匹配会让一两个字符的输入命中所有会话;界面里「复制会话 ID」拿到的就是完整 ID
HOST_API_LEVEL 不升级,只更新契约摘要 升级 客户端只读本机的 /meta,会话搜索也只查本机,不依赖远程设备支持新字段
实验开关放在哪 渲染端的本地偏好(kimi-web.session-mentions),和「多标签页的会话列表」一样在「设置 > 实验室」切换 服务端实验开关(registerFlagDefinition,环境变量加 [experimental]) 服务端开关的 surface 只有 core 和 TUI,这个功能完全在输入框里;服务端新增的 query 和 home_dir 对现有调用方没有可见影响,不需要开关

提交顺序:kap-server 的两个接口改动、app-composer 的类型声明修正、客户端功能、实验室开关。类型声明那个提交是为了加新图标:packages/app-composer/tsconfig.json 设了 "types": [],类型感知 lint 把每个 ~icons/*?raw 导入都当成 error 类型,图标表里每一项都报 unsafe assignment,原有 16 处冻结在 ratchet 基线里,新加一个图标就会变成 17 处。补上 ~icons/*?raw 的模块声明后这 16 处一起消失,基线相应下调。

建议阅读顺序:

  1. packages/app-client/src/composables/useMentionMenu.ts:会话入口和二级菜单的状态、本地排序,以及服务端搜索的防抖、取消与合并。
  2. packages/app-client/src/lib/sessionReferences.ts:候选会话的筛选排序,发送时 <referenced_sessions> 块和日志路径的生成。useKimiWebClient.ts 里的 sessionMentionsAvailable 是唯一的可用性判断(开关已打开,且当前工作区不在远程 SSH 设备上),候选列表和服务端搜索都经过它。
  3. packages/kap-server/src/routes/sessionList.ts、packages/kap-server/src/routes/meta.ts:query 过滤和 home_dir。
  4. packages/app-composer/src/model/wireCodec.ts、inlineLinks.ts:session mention 的序列化与解析规则,packages/app-composer/docs/wire-format.md 已同步。
  5. packages/app-client/src/lib/browserReferenceSubmission.ts、useModelProviderState.ts:追加引用块的接入点(普通发送、steer、side chat、技能参数)。

可以略读:MentionMenu.vue 的模板和样式、ComposerText.vue / Markdown.vue / tooltip 里对 session kind 的分支(会话 pill 不可点击,不做文件存在性探测)、useSessionMentions.ts 和 SettingsDialog.vue 里的开关行、track-events.ts 新增的 session-mentions 设置键、i18n 词条、测试、kap.md、契约摘要和 ratchet 基线。

发送时提交给服务端的文本,也就是模型看到的内容(示例里的 ID 和路径是占位值):

看看 [Fix login redirect](kimi-code://session/wd_api_3d6e578367e3/session_3bc1…) 最后是怎么定位问题的

<referenced_sessions>
<session id="session_3bc1…" title="Fix login redirect" log="/Users/you/.kimi-code/sessions/wd_api_3d6e578367e3/session_3bc1…/agents/main/wire.jsonl" />
</referenced_sessions>

正文里的会话链接原样保留,引用块追加在最后。同一个会话引用多次只列一行,属性值做 XML 转义,home_dir 里的反斜杠统一成 /。服务端没有返回 home_dir 时不追加引用块,消息照常发送。

会话菜单的细节:候选、排序与搜索
  • 候选来自客户端为侧边栏加载好的会话,启动时大约是最近 50 个,加上每个工作区各 5 个。只保留本机、未归档、不是当前会话的;当前工作区的排在前面,其余按更新时间倒序。没有标题的会话用最后一条消息代替,再没有就显示会话 ID。
  • 本地过滤的优先级依次是:会话 ID 完全相同、标题以输入开头、标题包含输入、最后一条消息包含输入、工作区名包含输入。
  • 停止输入 150ms 后请求 GET /api/v1/sessions?query=…&page_size=50&has_prompt=true,只查本机,结果和本地结果合并去重。新的输入会取消还没返回的旧请求,搜索进行中显示加载状态。
  • 最多显示 50 条;过滤框为空时按 Backspace 回到上一级菜单。

目前的边界:

  • 只能引用本机会话。当前工作区在远程 SSH 设备上时整个功能不可用,因为那里的 agent 读不到本机的日志。
  • 只给出主 agent 的 wire.jsonl,不包括子 agent 的日志。
  • 实验室开关按设备或浏览器分别保存:desktop 和浏览器里的 kimi web 要各自打开,KIMI_CODE_EXPERIMENTAL_FLAG=1 也打不开它(原因见上表「实验开关放在哪」)。
  • 没有在 Windows 上实际运行过,见验证记录。

Screenshots / Recordings

「设置 > 实验室」新增「引用会话」开关,默认关闭:

实验室页面里的「引用会话」开关

打开开关后,输入 @ 进入「会话」,二级菜单列出本机的其他会话,右侧是所属工作区和更新时间:

会话二级菜单

输入关键词后,子菜单找到了不在已加载列表里的目标会话(测试数据共 58 个会话)。上方是之前发送的消息:用户气泡只显示会话 pill,模型读取了被引用会话的 wire.jsonl:

按关键词搜索并发送

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
不带 query 的 GET /api/v1/sessions 现有过滤与分页 不变 所有客户端(desktop、web、TUI、外部 KAP 调用方) 不适用
带 query 的 GET /api/v1/sessions query 作为未知参数被忽略,返回未过滤的列表 只返回标题或最后一条消息包含该文本、或 ID 完全相同的会话 没有已知调用方会发送 query 不传 query
服务端升级前签发的 page_token 可以继续翻页 指纹多了一项,返回 40922,需要从第一页重来 跨服务端升级仍持有旧 token 继续翻页的调用方 丢弃 token 重新分页(40922 的提示里已有说明)
hosts=include 且带 query 不适用 query 转发给每台设备;旧版本设备会忽略它,返回该设备未过滤的会话 不适用 不带 hosts=include 只查本机
GET /api/v1/meta 的响应 没有 home_dir 多一个 home_dir(服务端数据目录的绝对路径) 严格校验响应字段集合的调用方 忽略该字段
设置的「实验室」页 两个开关 多一个「引用会话」开关,默认关闭 不适用 不适用
输入框的 @ 菜单 附件、文件、技能 默认不变;打开「引用会话」后多一个「会话」入口:没有输入时排在最前,有输入时排在文件和技能之后 desktop 与 kimi web 用户 保持开关关闭(默认)
不含会话引用的消息 原样提交 不变(正文里没有会话链接时直接原样返回) 所有用户 不适用
含会话引用的消息 不适用 提交副本末尾多一个 <referenced_sessions> 块,随消息存进会话记录;TUI 和 GET /turns 会看到这段 XML,desktop 与 web 的气泡按快照渲染,只显示 pill 不适用 不引用会话

契约文件的消费者:desktop 与 kimi web(本 PR 消费 query 和 home_dir)、外部 KAP agent(kap.md 由运行中的服务端直接下发,写了这两项就意味着这个服务端支持)。上一版本的客户端不发送 query、不读取 home_dir,行为不变。

受影响模块与测试覆盖:

  • kap-server 会话列表:sessionList.test.ts 新增「按标题、最后一条消息不区分大小写的子串或完整 ID 过滤」(覆盖 ID 片段不命中、空白参数不过滤、分组视图)和「query 计入 page_token 指纹」;hostAggregation.test.ts 新增「query 转发给本机列表和每台设备」。
  • kap-server meta:meta.test.ts 新增「home_dir 等于服务端的数据目录」;apiSurface.snapshot.test.ts 契约摘要更新,apiLevel 保持 1。
  • app-core:daemon-client.test.ts(只查本机的搜索请求不带 hosts=include)、configClient.test.ts(映射 home_dir)。
  • app-composer:composer-model.test.ts、snapshot.test.ts(session 链接的分类、round-trip、畸形链接保持纯文本、快照接受 session kind)。
  • app-markdown:MarkdownFilePathLinks.test.ts(助手消息里的会话链接渲染为不可点击的 pill)。
  • app-client:useMentionMenu.test.ts(入口位置、二级菜单进出、过滤与插入、lastPrompt 和完整 ID 匹配、服务端搜索的防抖、过期请求被忽略、加载状态、关闭后清空结果)、session-references.test.ts(候选筛选排序、引用块转义与去重、home_dir 未返回时不追加;实验室开关关闭时没有候选、不请求服务端搜索,打开后两者恢复,开关状态写入本地存储)。
验证记录
  • pnpm lint:通过(注释检查、oxlint、import 边界、guards、ratchet、说明文件检查)。
  • pnpm --filter kimi-code-app run typecheck、pnpm --filter @moonshot-ai/kap-server run typecheck:通过。
  • pnpm exec vitest run --reporter=agent 覆盖上述 4 个 kap-server 测试文件、全部 packages/app-* 和 apps/desktop/tests:651 个文件、10043 个用例通过。加上实验室开关之后,全部 packages/app-* 和 apps/desktop/tests 重跑:647 个文件、9962 个用例通过(kap-server 之后没有改动)。
  • rebase 到当前 main 之前:packages/kap-server 全量 1421 个用例通过;apps/kimi-code/test/cli/web/web.test.ts 76 个用例通过。
  • 端到端(macOS):从本分支启动 desktop,使用隔离的 KIMI_CODE_HOME 和一个兼容 OpenAI 的假模型。GET /meta 返回的 home_dir 是这个自定义目录;造 58 个会话,让目标会话不在已加载的列表里,按关键词和完整 ID 都能在子菜单里找到它;请求为 GET /api/v1/sessions?page_size=50&has_prompt=true&query=…,不带 hosts=include;模型收到的引用块里 log 指向自定义目录下的 wire.jsonl,模型调用 Read 后读到了被引用会话里的标记文字。
  • 实验室开关(同一套隔离环境):开关关闭时输入 @,菜单里没有「会话」入口(测试工作区没有文件,显示「无匹配」);在「设置 > 实验室」打开后,@ 菜单出现「会话」入口,二级菜单列出会话。
  • 未验证:Windows 上的真实运行。home_dir 里的反斜杠会被统一成 /,这一点有单元测试覆盖。

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a073486

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

This PR includes changesets to release 3 packages
Name Type
@moonshot-ai/kimi-code Patch
kimi-code-app Patch
@moonshot-ai/kap-server 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T06:21:18.728869Z a073486 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

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

commit: a073486

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aeaf63b549

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

activity: repeatedParam(sessionActivitySchema),
updated_after: isoDateTimeSchema.optional(),
updated_before: isoDateTimeSchema.optional(),
query: z.string().optional(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Advertise query support before clients rely on it

For external KAP clients, or hosts=include when a remote daemon is still on the previous release, the older listSessionsQuerySchema silently strips this unknown parameter and returns an unfiltered successful response. Because this change adds neither a /meta capability nor a host API-level gate, callers cannot distinguish that response from a filtered one and may present or reference unrelated sessions. Advertise a runtime capability and gate use of query, or enforce the filter while aggregating older hosts.

AGENTS.md reference: packages/kap-server/AGENTS.md:L7-L10

Useful? React with 👍 / 👎.

GET /api/v1/sessions accepts an optional query parameter. A session
matches when its title or last prompt contains the trimmed text
(case-insensitive), or when its id equals the text. A blank query is
ignored, and the text is bound into the page_token fingerprint.

The filter runs over the session index summaries the route already
scans in memory, so it works without the global search index. With
hosts=include the parameter reaches every host through the existing
query forwarding.
GET /api/v1/meta now includes home_dir, the absolute path of the Kimi
Code data directory the server runs on (KIMI_CODE_HOME or the default
~/.kimi-code). Clients that point the model at files under it, such as
a referenced session's agents/main/wire.jsonl, no longer have to guess
where the server keeps its data.
The package tsconfig sets types to an empty list, so oxlint's type-aware
pass saw every `~icons/*?raw` import as an error type and flagged each
entry of the icon map as an unsafe assignment. Declare the raw icon
module as a string in the package and drop the 16 frozen findings from
the ratchet baseline.
Typing @ offers a Sessions entry that opens a submenu of local,
unarchived sessions (current workspace first, newest first). The text
after @ filters the loaded sessions and, after a short pause, also
queries GET /api/v1/sessions?query= on this machine, so sessions outside
the loaded sidebar pages can be found by title, last prompt, or exact
session id. Picking one inserts a session pill serialized as
[title](kimi-code://session/<workspaceId>/<sessionId>).

On submit the client appends a <referenced_sessions> block that lists
each referenced session's id, title and the absolute path of its main
agent wire.jsonl, built from home_dir reported by GET /api/v1/meta and
the session layout documented under data locations. The composer
snapshot, user bubble, session title and last prompt keep showing only
the pill.
@wbxl2000
wbxl2000 force-pushed the qer/session-list-search branch from 00084d8 to bda5900 Compare November 19, 2026 05:31
@wbxl2000 wbxl2000 changed the title feat(kap-server): filter GET /sessions by a text query feat: mention other sessions from the @ menu Nov 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bda5900323

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

serverVersion: data.server_version,
serverId: data.server_id,
startedAt: data.started_at,
homeDir: data.home_dir,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle missing home_dir from older servers

When Desktop or Web connects to an older KAP daemon, /meta legitimately has no newly added home_dir, so this returns undefined despite the declared string type and configStore stores that value. After the user selects any session mention, sending the prompt calls sessionLogPath(), which invokes undefined.replaceAll(...) and rejects the send; map a missing field to '' and keep the wire field optional so session references degrade gracefully.

AGENTS.md reference: AGENTS.md:L188-L190

Useful? React with 👍 / 👎.

Comment on lines +44 to +46
export function sessionLogPath(home: string, ref: SessionMentionRef): string {
const root = home.replaceAll('\\', '/').replace(/\/+$/, '');
return `${root}/sessions/${ref.workspaceId}/${ref.sessionId}/agents/main/wire.jsonl`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Route session logs through the host filesystem

When the active session is bound to an SSH, Docker, or custom remote environment, its ordinary Read and Bash operations run in that environment, while home_dir identifies the daemon host's data directory. This host-local absolute path is therefore inaccessible to the model in remote-environment sessions, so every inserted session reference points to a log it cannot read; expose the log through a daemon-backed file reference or another host-filesystem access path instead of embedding the raw host path.

Useful? React with 👍 / 👎.

Comment thread .changeset/session-list-query.md Outdated
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Attribute changesets to the changed packages

This changeset is attributed only to the CLI package, but the diff changes the public kap-server API and adds a user-visible Desktop/Web session-mention feature. Without separate @moonshot-ai/kap-server and kimi-code-app entries, release tooling will omit the library version/changelog entry and the Desktop update notes will not announce the feature; add the required package-specific changesets while retaining the CLI entry if its bundled server is also affected.

AGENTS.md reference: AGENTS.md:L166-L167

Useful? React with 👍 / 👎.

The Sessions entry in the @ menu is now off by default. Settings > Lab >
Session mentions turns it on; while it is off the menu offers no sessions
and the composer sends no session search requests.

The switch is a local preference stored in the renderer, like the sidebar
tabs switch: server experimental flags only cover the core and TUI
surfaces, and this feature lives entirely in the composer.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17965090a8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


export function sessionLogPath(home: string, ref: SessionMentionRef): string {
const root = home.replaceAll('\\', '/').replace(/\/+$/, '');
return `${root}/sessions/${ref.workspaceId}/${ref.sessionId}/agents/main/wire.jsonl`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include the legacy root journal in session references

When a mention targets an older .kimi-code session whose history lives in <session>/wire.jsonl, or a resumed session containing both root and per-agent journals, this hard-coded path is either nonexistent or omits all pre-migration history. Search and export deliberately support the root journal, so these sessions remain selectable, but the model silently receives none or only part of the referenced conversation; resolve the actual journal set server-side or include the legacy root journal.

AGENTS.md reference: AGENTS.md:L109-L110

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a073486531

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

query.includeGit,
query.pageSize,
query.projection,
query.text ?? null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve queryless page-token fingerprints

When a client resumes an ordinary, unfiltered /sessions listing with a page_token issued before this upgrade, appending null to every fingerprint changes the hash even though the request semantics are unchanged, so decodePageToken rejects the token with 40922. This breaks pagination for existing KAP clients across an upgrade; include the new fingerprint component only when query is present, or retain compatibility with the previous queryless fingerprint.

AGENTS.md reference: packages/kap-server/AGENTS.md:L7-L10

Useful? React with 👍 / 👎.

Comment on lines +4 to +8
const sessionMentions = ref<boolean>(safeGetString(STORAGE_KEYS.sessionMentions) === '1');

function setSessionMentions(on: boolean): void {
sessionMentions.value = on;
safeSetString(STORAGE_KEYS.sessionMentions, on ? '1' : '0');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use the standard experimental flag mechanism

When operators enable experimental features through KIMI_CODE_EXPERIMENTAL_FLAG, the individual environment variable, or [experimental], session mentions remain disabled because this state is sourced exclusively from browser localStorage; it also bypasses the repository's required flag-precedence model. Back the Lab switch with an environment-driven registered experimental flag instead of a standalone local preference.

AGENTS.md reference: AGENTS.md:L119-L122

Useful? React with 👍 / 👎.

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.

2 participants