[BUG] Knowledge Base kb:search fails with TypeError: Q.trim is not a function on Chatbox 1.23.5
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Search the project for the kb:search IPC handler and the code that builds the Knowledge Base tool arguments. Reproduce the failure using the reported Chatbox, Ollama, and Knowledge Base setup, then trace where the query becomes an object instead of a string. Done means the query reaches search as a string and the Knowledge Base search returns context without the TypeError.
Written by the indexing model from the issue text.
Description
Bug description
Knowledge Base search fails intermittently on Chatbox Desktop 1.23.5 with:
Error invoking remote method 'kb:search':
TypeError: Q.trim is not a function
The Knowledge Base is correctly created, documents are successfully parsed and chunked, and Ollama embeddings work correctly when tested independently.
However, when Chatbox attempts to search the Knowledge Base, kb:search fails before the retrieved context reaches the chat model.
Environment
Chatbox Desktop: 1.23.5
Operating system:
macOS
Hardware:
MacBook Pro Intel Core i9
16 GB RAM
Model provider:
Ollama
Ollama API Host:
http://127.0.0.1:11434
Chat model:
qwen2.5:3b
Embedding model:
nomic-embed-text
Knowledge Base parser:
Local
Rerank model:
None
Vision model:
None
Chat Mode:
Enabled
Smart Switching:
Disabled
Knowledge Base configuration
The Knowledge Base uses:
Embedding provider:
Ollama
Embedding model:
nomic-embed-text
The documents are parsed successfully and chunks are generated correctly.
Knowledge Base is explicitly selected in the Chatbox conversation.
Error shown by Chatbox
Chatbox displays:
Consult Knowledge Base - Failed
Error:
Error invoking remote method 'kb:search':
TypeError: Q.trim is not a function
Arguments shown by Chatbox
Chatbox displays this argument:
{
"query": {
"type": "string",
"value": "proyeccion ingresos totales 2027"
}
}
Expected behavior
The Knowledge Base search should receive a string query equivalent to:
{
"query": "proyeccion ingresos totales 2027"
}
and perform semantic search using the configured embedding model.
Actual behavior
The query appears to be passed as an object containing:
{
"type": "string",
"value": "..."
}
The kb:search operation then fails with:
TypeError: Q.trim is not a function
As a consequence, no retrieved Knowledge Base context reaches the chat model.
Ollama embedding test
The Ollama embedding API was tested independently with:
curl http://127.0.0.1:11434/api/embed -d '{
"model": "nomic-embed-text",
"input": "ingresos totales proyectados para 2027"
}'
The API successfully returns an embedding vector.
Therefore Ollama and nomic-embed-text appear to be working correctly.
Steps to reproduce
- Start Ollama locally.
- Configure Ollama in Chatbox with:
http://127.0.0.1:11434 - Configure qwen2.5:3b as Chat model.
- Configure nomic-embed-text as Embedding model.
- Create a local Knowledge Base.
- Upload a TXT document.
- Wait until parsing and chunk generation complete successfully.
- Start a new Chat Mode conversation.
- Select the Knowledge Base.
- Ask a question related to the document.
- Expand the Knowledge Base operation.
Result:
Error invoking remote method 'kb:search':
TypeError: Q.trim is not a function
Additional observation
Some Knowledge Base searches have worked successfully when the query shown by Chatbox was a simple text value.
The failure occurs when the search argument is represented as an object containing:
type: "string"
value: "..."
This may indicate a type normalization issue between the generated Knowledge Base tool argument and the kb:search IPC handler.
- Dominant language
- TypeScript
- Stars
- 42.5k
- Forks
- 4.4k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing 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.
More from chatboxai/chatbox
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
[BUG] Input box font size is hardcoded to 14px and ignores Settings → Appearance → Font SizePossibly taken @brainsparker claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
chatboxai/chatbox#4059 · 1 reaction ·
Maintainers usually reply within 1 day
-
[Feature]Add all five effort levels for Claude Fable 5.2, Opus 5.5, and Sonnet 5.5Possibly taken @PiesAvalon claimed this 10 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
chatboxai/chatbox#4046 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
All issues in chatboxai/chatbox
Similar issues
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Possibly taken @goranai claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Inbox permission: an allow sent with `updatedInput` is ignored by Claude Code on its own safety checksPossibly taken @Raj1v claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
backnotprop/plannotator#4046 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
traPtitech/knoQ_R-UI#290 ·
Maintainers usually reply within 24 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
farion1231/cc-switch#9981 · 2 comments ·
Maintainers usually reply within 1 day
-
account bug course exam iris lecture
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day