kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

Literal search accepts one-character queries only for live session

Open tagadearpit opened this issue 3 months ago • 1 comments

What version of Kimi Code is running?

0.39.0

Which open platform/subscription were you using?

Developer / Open Source

Which model were you using?

kimi-for-coding

What platform is your computer?

Linux 6.1.102 x86_64 x86_64

What issue are you seeing?

Literal search ( ) behaves inconsistently between live and indexed sessions. A one-character normalized Unicode query (e.g., "苹") is accepted and returns hits when a live session is active ( container.sessionId points to a live transcript), but the exact same query is rejected with an invalid_query error when routed to the search index.

What steps can reproduce the bug?

Reproduction payload: { "query": "苹", "mode": "literal", "container": { "sessionId": "" } }

Error message (when not live):

literal queries need at least 2 characters (after Unicode normalization) (Error code: 40001) The validation should be centralized to ensure consistent behavior regardless of the session's liveness state.

What is the expected behavior?

Error message (when not live):

literal queries need at least 2 characters (after Unicode normalization) (Error code: 40001) The validation should be centralized to ensure consistent behavior regardless of the session's liveness state.

Additional information

No response

Contribution

  • [ ] I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first)

tagadearpit avatar Aug 28 '26 06:08 tagadearpit

Hi maintainers, I’d like to contribute a fix for this bug. I reproduced the live/index inconsistency and have a local patch that moves normalized literal-query length validation to the shared query-normalization path, with regression coverage asserting the same invalid_query response for both routes. The full @moonshot-ai/kap-server suite passes locally (1,327 passed, 1 skipped), along with its typecheck, repository lint, and the documentation build. May I proceed with a PR? Please /approve if this approach is acceptable.

535628443 avatar Sep 08 '26 15:09 535628443