From 598ed4657153cb5e32ab7aae6739f89b3ae07f2c Mon Sep 17 00:00:00 2001 From: Joseph19820124 <164839249+Joseph19820124@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:42:49 +0000 Subject: [PATCH 1/4] docs: add gemini first-run workaround --- docs/gemini.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/gemini.md b/docs/gemini.md index 797cba99..d4e64d32 100644 --- a/docs/gemini.md +++ b/docs/gemini.md @@ -25,6 +25,20 @@ helm install openab openab/openab \ > Set `agents.kiro.enabled=false` to disable the default Kiro agent. +## First-Run Workaround + +Gemini CLI needs `~/.gemini/projects.json` to exist before the first ACP session starts. In ephemeral containers, the file may not be created yet, which can surface as `ENOENT` or `Unexpected end of JSON input` during the first run. + +If you control the container startup command, seed the directory before launching `openab`: + +```bash +mkdir -p /home/node/.gemini && echo '{}' > /home/node/.gemini/projects.json && exec openab /etc/openab/config.toml +``` + +For Kubernetes or Helm deployments, use the same idea with an init container and a shared volume mounted at `/home/node/.gemini`. + +The current chart does not expose `extraInitContainers`, `extraVolumes`, or `extraVolumeMounts`, so the workaround is easiest to apply in a custom manifest or wrapper image until those values are added. + ## Manual config.toml ```toml From b44d02740f1ed5fc4acedbfc477733caa23e94d3 Mon Sep 17 00:00:00 2001 From: Joseph19820124 <164839249+Joseph19820124@users.noreply.github.com> Date: Tue, 14 Apr 2026 22:58:48 +0000 Subject: [PATCH 2/4] docs: expand gemini workaround guidance --- docs/gemini.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/gemini.md b/docs/gemini.md index d4e64d32..e22d5029 100644 --- a/docs/gemini.md +++ b/docs/gemini.md @@ -29,15 +29,29 @@ helm install openab openab/openab \ Gemini CLI needs `~/.gemini/projects.json` to exist before the first ACP session starts. In ephemeral containers, the file may not be created yet, which can surface as `ENOENT` or `Unexpected end of JSON input` during the first run. +This is a workaround for the upstream Gemini CLI issue `google-gemini/gemini-cli#22583`. + If you control the container startup command, seed the directory before launching `openab`: ```bash mkdir -p /home/node/.gemini && echo '{}' > /home/node/.gemini/projects.json && exec openab /etc/openab/config.toml ``` -For Kubernetes or Helm deployments, use the same idea with an init container and a shared volume mounted at `/home/node/.gemini`. +The `exec openab /etc/openab/config.toml` part assumes the Docker image default config path. + +For Kubernetes or Helm deployments, use the same idea with an init container and a shared volume mounted at `/home/node/.gemini`. A minimal pattern looks like this: + +```yaml +extraInitContainers: + - name: seed-gemini-home + image: busybox:1.36 + command: ["sh", "-c", "mkdir -p /home/node/.gemini && echo '{}' > /home/node/.gemini/projects.json"] + volumeMounts: + - name: gemini-home + mountPath: /home/node/.gemini +``` -The current chart does not expose `extraInitContainers`, `extraVolumes`, or `extraVolumeMounts`, so the workaround is easiest to apply in a custom manifest or wrapper image until those values are added. +The current chart does not expose `extraInitContainers`, `extraVolumes`, or `extraVolumeMounts`, so the workaround is easiest to apply in a custom manifest or wrapper image until those values are added. Chart support for those passthrough fields is tracked in #344. ## Manual config.toml From f779a4b85ed5b2ead9c4e5c734ca90c3cbac1728 Mon Sep 17 00:00:00 2001 From: Joseph19820124 <164839249+Joseph19820124@users.noreply.github.com> Date: Thu, 16 Apr 2026 04:45:46 +0000 Subject: [PATCH 3/4] fix(gemini): initialize project registry on startup --- Dockerfile.gemini | 4 +++- docker/gemini/entrypoint.sh | 14 ++++++++++++++ docs/gemini.md | 24 +++++++++--------------- 3 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 docker/gemini/entrypoint.sh diff --git a/Dockerfile.gemini b/Dockerfile.gemini index d2230547..434a98e2 100644 --- a/Dockerfile.gemini +++ b/Dockerfile.gemini @@ -26,9 +26,11 @@ ENV HOME=/home/node WORKDIR /home/node COPY --from=builder --chown=node:node /build/target/release/openab /usr/local/bin/openab +COPY --chown=node:node docker/gemini/entrypoint.sh /usr/local/bin/docker-entrypoint-gemini.sh +RUN chmod +x /usr/local/bin/docker-entrypoint-gemini.sh USER node HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ CMD pgrep -x openab || exit 1 -ENTRYPOINT ["openab"] +ENTRYPOINT ["docker-entrypoint-gemini.sh", "openab"] CMD ["/etc/openab/config.toml"] diff --git a/docker/gemini/entrypoint.sh b/docker/gemini/entrypoint.sh new file mode 100644 index 00000000..08aa8b40 --- /dev/null +++ b/docker/gemini/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -eu + +GEMINI_DIR="${HOME:-/home/node}/.gemini" +PROJECTS_JSON="${GEMINI_DIR}/projects.json" + +# Gemini CLI expects a registry-shaped JSON object at startup. +# Keep existing files when they already advertise the registry shape. +mkdir -p "$GEMINI_DIR" +if [ ! -f "$PROJECTS_JSON" ] || ! grep -q '"projects"[[:space:]]*:' "$PROJECTS_JSON"; then + printf '{"projects":{}}\n' > "$PROJECTS_JSON" +fi + +exec "$@" diff --git a/docs/gemini.md b/docs/gemini.md index e22d5029..b994d6e2 100644 --- a/docs/gemini.md +++ b/docs/gemini.md @@ -31,27 +31,21 @@ Gemini CLI needs `~/.gemini/projects.json` to exist before the first ACP session This is a workaround for the upstream Gemini CLI issue `google-gemini/gemini-cli#22583`. -If you control the container startup command, seed the directory before launching `openab`: +The `openab-gemini` image now seeds this file automatically with the expected registry shape: -```bash -mkdir -p /home/node/.gemini && echo '{}' > /home/node/.gemini/projects.json && exec openab /etc/openab/config.toml +```json +{"projects":{}} ``` -The `exec openab /etc/openab/config.toml` part assumes the Docker image default config path. - -For Kubernetes or Helm deployments, use the same idea with an init container and a shared volume mounted at `/home/node/.gemini`. A minimal pattern looks like this: +If you build a custom Gemini image or override the entrypoint, seed the directory before launching `openab`: -```yaml -extraInitContainers: - - name: seed-gemini-home - image: busybox:1.36 - command: ["sh", "-c", "mkdir -p /home/node/.gemini && echo '{}' > /home/node/.gemini/projects.json"] - volumeMounts: - - name: gemini-home - mountPath: /home/node/.gemini +```bash +mkdir -p /home/node/.gemini && printf '{"projects":{}}\n' > /home/node/.gemini/projects.json && exec openab /etc/openab/config.toml ``` -The current chart does not expose `extraInitContainers`, `extraVolumes`, or `extraVolumeMounts`, so the workaround is easiest to apply in a custom manifest or wrapper image until those values are added. Chart support for those passthrough fields is tracked in #344. +The `exec openab /etc/openab/config.toml` part assumes the Docker image default config path. + +For Kubernetes or Helm deployments that use a custom Gemini entrypoint, use the same idea with an init container and a shared volume mounted at `/home/node/.gemini`. ## Manual config.toml From 492a1668440aeea03817b6af3a0605e7991da000 Mon Sep 17 00:00:00 2001 From: Joseph19820124 <164839249+Joseph19820124@users.noreply.github.com> Date: Thu, 16 Apr 2026 04:50:56 +0000 Subject: [PATCH 4/4] docs(gemini): narrow first-run workaround guidance --- Dockerfile.gemini | 4 +--- docker/gemini/entrypoint.sh | 14 -------------- docs/gemini.md | 10 ++++------ 3 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 docker/gemini/entrypoint.sh diff --git a/Dockerfile.gemini b/Dockerfile.gemini index 434a98e2..d2230547 100644 --- a/Dockerfile.gemini +++ b/Dockerfile.gemini @@ -26,11 +26,9 @@ ENV HOME=/home/node WORKDIR /home/node COPY --from=builder --chown=node:node /build/target/release/openab /usr/local/bin/openab -COPY --chown=node:node docker/gemini/entrypoint.sh /usr/local/bin/docker-entrypoint-gemini.sh -RUN chmod +x /usr/local/bin/docker-entrypoint-gemini.sh USER node HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ CMD pgrep -x openab || exit 1 -ENTRYPOINT ["docker-entrypoint-gemini.sh", "openab"] +ENTRYPOINT ["openab"] CMD ["/etc/openab/config.toml"] diff --git a/docker/gemini/entrypoint.sh b/docker/gemini/entrypoint.sh deleted file mode 100644 index 08aa8b40..00000000 --- a/docker/gemini/entrypoint.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -eu - -GEMINI_DIR="${HOME:-/home/node}/.gemini" -PROJECTS_JSON="${GEMINI_DIR}/projects.json" - -# Gemini CLI expects a registry-shaped JSON object at startup. -# Keep existing files when they already advertise the registry shape. -mkdir -p "$GEMINI_DIR" -if [ ! -f "$PROJECTS_JSON" ] || ! grep -q '"projects"[[:space:]]*:' "$PROJECTS_JSON"; then - printf '{"projects":{}}\n' > "$PROJECTS_JSON" -fi - -exec "$@" diff --git a/docs/gemini.md b/docs/gemini.md index b994d6e2..b335bd11 100644 --- a/docs/gemini.md +++ b/docs/gemini.md @@ -27,25 +27,23 @@ helm install openab openab/openab \ ## First-Run Workaround -Gemini CLI needs `~/.gemini/projects.json` to exist before the first ACP session starts. In ephemeral containers, the file may not be created yet, which can surface as `ENOENT` or `Unexpected end of JSON input` during the first run. +Gemini CLI needs `~/.gemini/projects.json` to exist before the first ACP session starts. In ephemeral containers, the file may not be created yet, which can surface as `ENOENT`, `Unexpected end of JSON input`, or a `ProjectRegistry` startup failure during the first run. -This is a workaround for the upstream Gemini CLI issue `google-gemini/gemini-cli#22583`. +This is a workaround for the upstream Gemini CLI issue: [google-gemini/gemini-cli#25509](https://github.com/google-gemini/gemini-cli/issues/25509). -The `openab-gemini` image now seeds this file automatically with the expected registry shape: +If you control the Gemini container startup command, seed the directory before launching `openab`: ```json {"projects":{}} ``` -If you build a custom Gemini image or override the entrypoint, seed the directory before launching `openab`: - ```bash mkdir -p /home/node/.gemini && printf '{"projects":{}}\n' > /home/node/.gemini/projects.json && exec openab /etc/openab/config.toml ``` The `exec openab /etc/openab/config.toml` part assumes the Docker image default config path. -For Kubernetes or Helm deployments that use a custom Gemini entrypoint, use the same idea with an init container and a shared volume mounted at `/home/node/.gemini`. +For Kubernetes or Helm deployments, use the same idea with an init container and a shared volume mounted at `/home/node/.gemini`, or wait for the Gemini CLI fix upstream. ## Manual config.toml