fix(core): reliable L3 persona writes for weak tool-calling models + warn on silent embedding misconfig#112
Open
Lorenzocolucci wants to merge 1 commit into
Open
Conversation
…g WARN L3 persona generation was unreliable on OpenAI-compatible models with weak tool-calling (e.g. Moonshot/Kimi): the prompt named tools the active runner did not expose, so the model emitted the persona as plain text and persona.md was never written — a silently lost generation. - prompts/persona-generation: parametrize file-tool names by runner dialect (standalone write_to_file/replace_in_file vs openclaw write/edit) - persona-generator: derive dialect from the injected runner; force write via tool; fall back to persisting the returned assistant text when the model answers with text instead of a tool call - llm-runner: forceWriteTool (toolChoice:"required" + hasToolCall stop, no forced-loop risk); maxRetries 4 for transient DNS blips; log forced tool calls - store/factory: WARN when a remote embedding provider is configured but the EmbeddingService is not initialised (empty apiKey -> silent keyword-only) - types: add LLMRunParams.forceWriteTool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small, independent core fixes I hit while running the standalone gateway with an OpenAI-compatible model (Moonshot/Kimi) for extraction.
1. L3 persona is silently dropped with weak tool-calling models
The persona prompt instructed the model to use the
write/edittools (OpenClaw names), but the standalone runner exposeswrite_to_file/replace_in_file. With a model that has weaker tool-calling, it returned the persona as plain text and called no tool, so the result was discarded andpersona.mdwas never written.This PR:
openclaw: write/edit — unchanged default;standalone: write_to_file/replace_in_file);toolChoice: "required"+ stop onwrite_to_file) so reliable tool-calling is guaranteed when needed;The non-forced branch is unchanged; I preserved main's conditional
toolsspread in the merge.2. Silent degradation when an embedding provider is misconfigured
When a remote embedding provider is configured but the service fails to initialize (e.g. an empty API key), search silently fell back to keyword-only with no signal. This adds a WARN at startup so the misconfiguration is visible instead of silent.
Testing
Built against current
main(build green). Verified the persona path writespersona.mdvia the tool (fallback count 0) and the WARN fires when the embedding key is missing.Happy to adjust naming or split these into two PRs if you'd prefer.