fix(cli): thin-client pre-connectEngine routing seam for CLI-only commands#2304
Open
2anoubis wants to merge 1 commit into
Open
fix(cli): thin-client pre-connectEngine routing seam for CLI-only commands#23042anoubis wants to merge 1 commit into
2anoubis wants to merge 1 commit into
Conversation
…mands graph-query, salience, anomalies, think, recall, forget, whoknows, and founder already contain isThinClient -> callRemoteTool branches in their handlers (v0.31.1 pattern), but handleCliOnly called connectEngine() before the switch statement could dispatch to them -- crashing thin-client installs with 'database_url is missing from config'. Add pre-connectEngine thin-client guards matching the exact pattern already used by 'status' (v0.41.19.0) and 'eval whoknows' (v0.33.1.3). Each passes null for the engine; the handler detects isThinClient and routes through the remote MCP op instead.
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.
Problem
gbrain graph-query,gbrain salience,gbrain anomalies,gbrain think,gbrain recall,gbrain forget,gbrain whoknows, andgbrain founderall crash on thin-client installs with:gbrain statusworks because it has a dedicated pre-connectEngine()thin-client guard.gbrain getworks because it routes through the op-layer dispatch path which has its own thin-client routing seam.Root Cause
Each of these commands has
isThinClient() → callRemoteTool()branches in their handlers (added in v0.31.1, commit 6ba7feb), buthandleCliOnly()callsconnectEngine()at line 1568 BEFORE the switch statement can dispatch to them. The handlers never reach their thin-client code.Fix
Add pre-
connectEngine()thin-client guards inhandleCliOnly(), matching the exact pattern already used bystatus(v0.41.19.0) andeval whoknows(v0.33.1.3). Each passesnullfor the engine argument — the handler detectsisThinClientand routes through the remote MCP op instead.Commands fixed
graph-querytraverse_graphsalienceget_recent_salienceanomaliesfind_anomaliesthinkthinkrecallrecallforgetforget_factwhoknowsfind_expertsfounderfind_trajectoryVerification
Tested on a thin-client install (remote MCP mode, no
database_url):gbrain graph-query people/bob✅ — produces graph traversal outputgbrain salience✅ — produces salience tablegbrain recall people/bob✅ — no crash (empty results, correct)gbrain status✅ — still works (no regression)