From 7e6588a99dfd9d5b404dfeb6d960770d89e1a229 Mon Sep 17 00:00:00 2001 From: Fusion Date: Thu, 21 May 2026 12:26:07 +0200 Subject: [PATCH] fix(opencode): ensure opencode binary is in PATH - Check if opencode binary exists at expected location before symlinking - Add ~/.opencode/bin to PATH in /etc/profile and /root/.bashrc - Provides warning if binary not found instead of silently failing Quality gates: code review --- apps/api/src/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/api/src/main.py b/apps/api/src/main.py index 64ab3e1..00137d9 100644 --- a/apps/api/src/main.py +++ b/apps/api/src/main.py @@ -170,7 +170,14 @@ services: command: > sh -c "apt-get update && apt-get install -y curl git tar && curl -fsSL https://opencode.ai/install | bash && - ln -sf $HOME/.opencode/bin/opencode /usr/local/bin/opencode && + OPCODE_BIN=$HOME/.opencode/bin/opencode && + if [ -f $OPCODE_BIN ]; then + ln -sf $OPCODE_BIN /usr/local/bin/opencode + echo 'export PATH=\"$HOME/.opencode/bin:$PATH\"' >> /etc/profile + echo 'export PATH=\"$HOME/.opencode/bin:$PATH\"' >> /root/.bashrc + else + echo 'Warning: opencode binary not found at expected location' + fi && mkdir -p /workspace && echo 'OpenCode installed. Run: opencode' && tail -f /dev/null"