What issue are you seeing?
In the kimi-web frontend, when drafting the initial prompt of a new conversation in a workspace (before any message has been sent), typing @ to mention a file always shows "No matches", no matter the query. After the first message is sent and the conversation exists, @ file mention works correctly.
What steps can reproduce the bug?
- Open a workspace in kimi-web.
- Start a new conversation (the empty draft state with no conversation history).
- In the composer, type
@ followed by the name of a file that exists in the workspace.
- The mention menu opens but always shows "No matches".
- Send any message, then type
@ again — file search now returns matches as expected.
What is the expected behavior?
@ file search should return matching files from the workspace while drafting the initial prompt, before the first message is sent.
Additional information: diagnosis
The @ search is keyed off the active session, and a new-conversation draft deliberately has no session, so the search short-circuits to empty before ever reaching the server:
apps/kimi-web/src/composables/client/useWorkspaceState.ts — searchFiles() returns [] immediately when rawState.activeSessionId is undefined.
- Entering the new-conversation draft state (
openWorkspaceDraft) calls clearActiveSession(). Per the comment there, this is by design: "No backend session is created until the user sends the first message" — the session is only created lazily by createDraftSession on the first send.
- The daemon endpoint is strictly session-scoped:
POST /sessions/{sid}/fs:search (apps/kimi-web/src/api/daemon/client.ts), resolved server-side from the session's ISessionFsService (packages/kap-server/src/routes/fs.ts). There is no workspace-scoped or cwd-scoped search endpoint the frontend could call while no session exists.
- The mention menu itself is wired correctly: the
searchFiles prop is always passed down (App.vue → ConversationPane → ChatDock → Composer), so on the draft screen the menu opens and then renders its empty state. It looks like "no files match", but the search never actually ran.
Reproduced on current main (c497af60).
What issue are you seeing?
In the kimi-web frontend, when drafting the initial prompt of a new conversation in a workspace (before any message has been sent), typing
@to mention a file always shows "No matches", no matter the query. After the first message is sent and the conversation exists,@file mention works correctly.What steps can reproduce the bug?
@followed by the name of a file that exists in the workspace.@again — file search now returns matches as expected.What is the expected behavior?
@file search should return matching files from the workspace while drafting the initial prompt, before the first message is sent.Additional information: diagnosis
The
@search is keyed off the active session, and a new-conversation draft deliberately has no session, so the search short-circuits to empty before ever reaching the server:apps/kimi-web/src/composables/client/useWorkspaceState.ts—searchFiles()returns[]immediately whenrawState.activeSessionIdisundefined.openWorkspaceDraft) callsclearActiveSession(). Per the comment there, this is by design: "No backend session is created until the user sends the first message" — the session is only created lazily bycreateDraftSessionon the first send.POST /sessions/{sid}/fs:search(apps/kimi-web/src/api/daemon/client.ts), resolved server-side from the session'sISessionFsService(packages/kap-server/src/routes/fs.ts). There is no workspace-scoped or cwd-scoped search endpoint the frontend could call while no session exists.searchFilesprop is always passed down (App.vue→ConversationPane→ChatDock→Composer), so on the draft screen the menu opens and then renders its empty state. It looks like "no files match", but the search never actually ran.Reproduced on current
main(c497af60).