Skip to content

fix: local embedding model compatibility (Qwen3/vLLM/Ollama) + configurable rerank timeout#264

Closed
yjjheizhu wants to merge 5 commits intoCortexReach:masterfrom
yjjheizhu:fix/issue-236-qwen3-local-embedding-compatibility
Closed

fix: local embedding model compatibility (Qwen3/vLLM/Ollama) + configurable rerank timeout#264
yjjheizhu wants to merge 5 commits intoCortexReach:masterfrom
yjjheizhu:fix/issue-236-qwen3-local-embedding-compatibility

Conversation

@yjjheizhu
Copy link

Summary

Fixes compatibility issues when using local embedding models (Qwen3, vLLM, Ollama) that don't support the dimensions parameter, and adds configurable rerank timeout for slow local rerank models.

Changes

1. Add omitDimensions config switch

  • New embedding.omitDimensions: boolean option (default: false)
  • When enabled, stops sending the dimensions parameter in embedding requests
  • Users opt-in explicitly, avoiding false positives for local models that do support matryoshka

2. Friendly error hint for matryoshka errors

  • Detects errors matching matryoshka, dimensions not supported, unknown param: dimensions
  • Returns actionable message: Set "embedding.omitDimensions": true in your config
  • Users can self-diagnose without reading documentation

3. Configurable rerank timeout

  • New retrieval.rerankTimeoutMs: number option (default: 5000)
  • Replaces hardcoded 5s timeout that fails for slow local rerank models
  • Fully backward compatible

Testing

  • All existing tests pass
  • New test cases for matryoshka error detection (3 variants covered)

Breaking Changes

None — all changes are opt-in with sensible defaults.

OpenClaw Contributor added 4 commits March 19, 2026 21:29
- Test matryoshka representation error detection
- Test unknown parameter: dimensions variant
- Test dimensions not supported phrase variant
- All verify omitDimensions hint is present
@yjjheizhu yjjheizhu force-pushed the fix/issue-236-qwen3-local-embedding-compatibility branch from ee52e05 to c5d96dc Compare March 19, 2026 13:39
@chenjiyong
Copy link
Collaborator

I validated PR #264 locally with the OpenClaw harness. The main omitDimensions change works as expected, and both the host functional test and the real agent E2E passed. However, I found one issue in the same PR: rerankTimeoutMs was added in src/retriever.ts, but it is not declared in openclaw.plugin.json. Because retrieval uses additionalProperties: false, adding retrieval.rerankTimeoutMs to plugin config currently fails openclaw config validate with “must NOT have additional properties”.

@AliceLJY
Copy link
Collaborator

Thanks for the contribution! 🙏

There are currently merge conflicts with main. Could you please rebase your branch against main so we can move forward with the merge?

If you need any help with the rebase, feel free to ask!

@AliceLJY
Copy link
Collaborator

Hey @yjjheizhu, thanks for addressing the rerankTimeoutMs feedback!

However, the latest commit (b60b58d) seems to have picked up unrelated changes during the rebase:

Could you clean up the branch so only the changes related to this PR (omitDimensions + error hints) remain? A quick git rebase -onto or interactive rebase to drop the extra changes should do it.

Let me know if you need a hand!

@yjjheizhu
Copy link
Author

Superseded by #315, which is the clean replacement PR containing only the omitDimensions fix and related schema/test updates. Closing this one to avoid merging the mixed-in unrelated changes and current merge conflicts.

@yjjheizhu yjjheizhu closed this Mar 23, 2026
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.

3 participants