From d28988dcfc11589d9d7803ef035d8e40c9ea6e27 Mon Sep 17 00:00:00 2001 From: Andrew Hayzen Date: Tue, 24 Mar 2026 22:47:46 +0000 Subject: [PATCH] sandbox: add config.json to opencode passthroughs --- src/sandbox/opencode.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sandbox/opencode.sh b/src/sandbox/opencode.sh index 8f8c66c..2545fbd 100644 --- a/src/sandbox/opencode.sh +++ b/src/sandbox/opencode.sh @@ -3,6 +3,17 @@ # SPDX-License-Identifier: MPL-2.0 function sandbox_setup_opencode() { + # If there is an opencode config then mount it into the container + # + # NOTE: older versions of opencode use config.json + if [ -f "$HOME/.config/opencode/config.json" ]; then + # Ensure parent of mounted opencode folder exists + # otherwise .config is root in the container + mkdir -p "$PERSIST_FOLDER/home/.config/opencode" + + CONTAINER_RUN_ARGS+=(--volume="$HOME/.config/opencode/config.json":"$HOME/.config/opencode/config.json":ro) + fi + # If there is an opencode config then mount it into the container if [ -f "$HOME/.config/opencode/opencode.json" ]; then # Ensure parent of mounted opencode folder exists