From e95885f4530371cab2db0023bdc075ffc4fbb4f4 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sat, 8 Nov 2025 01:18:06 -0800 Subject: [PATCH] Fix bd-yuf7: Add config to bd info JSON output - bd info now includes config in JSON output - Temporarily switches to direct mode to read config table - Fixes issue where bd config set worked but bd info showed null config Amp-Thread-ID: https://ampcode.com/threads/T-d2e6a5e4-7f85-4e9f-94bb-d20ea46ea13b Co-authored-by: Amp --- cmd/bd/info.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cmd/bd/info.go b/cmd/bd/info.go index c26754da..c6fa4408 100644 --- a/cmd/bd/info.go +++ b/cmd/bd/info.go @@ -86,6 +86,28 @@ Examples: } } + // Add config to info output (requires direct mode to access config table) + // Save current daemon state + wasDaemon := daemonClient != nil + var tempErr error + + if wasDaemon { + // Temporarily switch to direct mode to read config + tempErr = ensureDirectMode("info: reading config") + } + + if store != nil { + ctx := context.Background() + configMap, err := store.GetAllConfig(ctx) + if err == nil && len(configMap) > 0 { + info["config"] = configMap + } + } + + // Note: We don't restore daemon mode since info is a read-only command + // and the process will exit immediately after this + _ = tempErr // silence unused warning + // Add schema information if requested if schemaFlag && store != nil { ctx := context.Background()