From 5d9b117442ab5e5a45a27985e61fd48bec48b672 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 19 Sep 2026 13:54:15 +0800 Subject: [PATCH] fix(agents): keep opencode inline config quoting intact home.sessionVariables writes export NAME="value" without escaping embedded double quotes, so the JSON {"share":"disabled"} reached opencode as the shell word {share:disabled} and failed config parsing. Emit the export with sessionVariablesExtra instead. --- home/base/tui/agent-env.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/home/base/tui/agent-env.nix b/home/base/tui/agent-env.nix index 455c4e93..84de98be 100644 --- a/home/base/tui/agent-env.nix +++ b/home/base/tui/agent-env.nix @@ -8,9 +8,14 @@ CRUSH_DISABLE_METRICS = "1"; CRUSH_DISABLE_PROVIDER_AUTO_UPDATE = "1"; - OPENCODE_CONFIG_CONTENT = builtins.toJSON { - share = "disabled"; - }; OPENCODE_DISABLE_AUTOUPDATE = "1"; }; + + # home.sessionVariables wraps every value in double quotes without escaping + # them (home-manager's lib.shell.export), which turns JSON like + # {"share":"disabled"} into the shell word {share:disabled}. Emit the export + # by hand so the quotes survive. + home.sessionVariablesExtra = '' + export OPENCODE_CONFIG_CONTENT='{"share":"disabled"}' + ''; }