fix(context): fall back to in-process when daemon returns empty context#95
Open
bunny-bot-openclaw wants to merge 1 commit into
Open
fix(context): fall back to in-process when daemon returns empty context#95bunny-bot-openclaw wants to merge 1 commit into
bunny-bot-openclaw wants to merge 1 commit into
Conversation
The warm daemon can return ok=True with an empty result string when generate_session_context() silently fails inside the daemon process (e.g. after the daemon was started with stale code or a different cwd). Previously cmd_context accepted an empty string as the daemon result and skipped the in-process fallback because context was not None. This caused every session boot to print "No context generated" even though the graph was healthy, leaving Bunny with zero brain context for 3+ weeks. Fix: only accept the daemon result when it is a non-empty string. An empty result falls through to in-process generate_session_context(), the same path used when the daemon is unreachable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
cashew serve) can return{"ok": true, "result": ""}whengenerate_session_context()silently fails inside the daemon process (e.g. stale code, different cwd, or a swallowed exception inside the function'stry/except).cmd_contextwas accepting an empty string as a valid daemon result and settingcontext = "". Since"" is not None, the in-process fallback on line 98 was never reached.Fix
Only accept the daemon result when it is a truthy (non-empty) string. An empty result now falls through to in-process
generate_session_context(), the same code path used when the daemon is unreachable.Test plan
cashew_context.py context --hints "bunny identity"now returns full context with the warm daemon runningCASHEW_NO_DAEMON=1path works unchangedtest_embed_op_roundtrips) is a pre-existing unrelated failure in embedding model API🤖 Generated with Claude Code