MoonshotAI / MoonshotAI/kimi-code
Literal search accepts one-character queries only for live session
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace literal-query validation for requests with a live container.sessionId and requests routed to the search index, starting from the path that emits invalid_query 40001. Compare the Unicode-normalized length checks and centralize the validation so both paths have consistent behavior, then add or run tests covering the one-character query "苹" in live and indexed sessions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100