1
0
Fork
You've already forked ai-agent-coding
0

Features/updates #11

Merged
peterwwillis merged 35 commits from features/updates into main 2026年03月29日 04:08:30 +02:00
peterwwillis commented 2026年03月29日 04:07:59 +02:00 (Migrated from github.com)
Copy link
No description provided.
gemini-code-assist[bot] (Migrated from github.com) reviewed 2026年03月29日 04:11:04 +02:00
gemini-code-assist[bot] (Migrated from github.com) left a comment
Copy link

Code Review

This pull request significantly expands the local AI development environment by adding several new services (LocalAI, Memos, noVNC, Open WebUI, SearXNG, ttyd, and VS Code) and refactoring the shared Docker Compose infrastructure to support subdomain-based routing via Caddy. The changes also include enhanced AI agent workflows and system-level optimizations like enabling zswap. Review feedback highlights several critical issues, including missing 'include' directives in new Makefiles and a typo in a network variable name. Improvement opportunities were also identified regarding the portability of hardcoded absolute paths, the security of sudoers modifications, and the efficiency of container startup commands.

## Code Review This pull request significantly expands the local AI development environment by adding several new services (LocalAI, Memos, noVNC, Open WebUI, SearXNG, ttyd, and VS Code) and refactoring the shared Docker Compose infrastructure to support subdomain-based routing via Caddy. The changes also include enhanced AI agent workflows and system-level optimizations like enabling zswap. Review feedback highlights several critical issues, including missing 'include' directives in new Makefiles and a typo in a network variable name. Improvement opportunities were also identified regarding the portability of hardcoded absolute paths, the security of sudoers modifications, and the efficiency of container startup commands.
@ -0,0 +62,4 @@
- `gh pr comment [<NUMBER | URL | BRANCH>] [--body <COMMENT>] [--edit-last [--create-if-none]] [--delete-last]` - Add a comment to a pull request
- `gh api graphql -f query='query($owner: String!, $repo: String!, $pr: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $pr) { reviewThreads(first: 50) { nodes { id isResolved comments(first: 1) { nodes { body } } } } } } }' -f owner='<OWNER>' -f repo='<REPO>' -F pr=<PR_NUMBER>` - API call to find review thread IDs for a pull request
- `gh api graphql -f query='mutation($threadId: ID!) { resolveReviewThread(input: { threadId: $threadId }) { thread { id isResolved } } }' -f threadId='<THREAD_ID>'` - API call to update a pull request comment/conversation thread THREAD_NODE_ID as resolved
- `gh release list [--exclude-drafts] [--exclude-pre-releases] [--order <asc|desc>]` - Update a pull request branch with changes from the base branch
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

medium

The description for gh release list appears to be a copy-paste error from another command. It should be updated to reflect the command's actual function, which is to list releases.

 - `gh release list [--exclude-drafts] [--exclude-pre-releases] [--order <asc|desc>]` - List releases in a repository
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) The description for `gh release list` appears to be a copy-paste error from another command. It should be updated to reflect the command's actual function, which is to list releases. ```suggestion - `gh release list [--exclude-drafts] [--exclude-pre-releases] [--order <asc|desc>]` - List releases in a repository ```
@ -0,0 +6,4 @@
DOCKER_COMPOSE_FILE := compose.linux-vulkan.yml
ADD_GROUPS = 110:render
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

medium

The GID for the render group is hardcoded as 110. This GID can differ across Linux distributions, which could cause issues with GPU access inside the container. To make this more portable, you can dynamically get the GID from the host system.

ADD_GROUPS = $(shell getent group render | cut -d: -f3 || echo 110):render
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) The GID for the `render` group is hardcoded as `110`. This GID can differ across Linux distributions, which could cause issues with GPU access inside the container. To make this more portable, you can dynamically get the GID from the host system. ``` ADD_GROUPS = $(shell getent group render | cut -d: -f3 || echo 110):render ```
@ -0,0 +9,4 @@
if [ "$(id -u)" = "0" ] ; then
groupadd -g ${GID} ${USER} || true
useradd -l -u ${UID} -g ${GID} -m ${USER} -d "/home/${USER}.linux" || true
printf "%s\t%s\n" "${USER}" "ALL=(ALL:ALL) ALL" >> /etc/sudoers
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

medium

Directly modifying /etc/sudoers is generally discouraged as it can be risky. A safer and more maintainable approach is to add a separate configuration file in the /etc/sudoers.d/ directory. This isolates your changes and prevents accidental corruption of the main sudoers file.

 echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" > "/etc/sudoers.d/90-user-sudo" && chmod 0440 "/etc/sudoers.d/90-user-sudo"
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) Directly modifying `/etc/sudoers` is generally discouraged as it can be risky. A safer and more maintainable approach is to add a separate configuration file in the `/etc/sudoers.d/` directory. This isolates your changes and prevents accidental corruption of the main `sudoers` file. ```suggestion echo "${USER} ALL=(ALL:ALL) NOPASSWD: ALL" > "/etc/sudoers.d/90-user-sudo" && chmod 0440 "/etc/sudoers.d/90-user-sudo" ```
@ -0,0 +1 @@
../../make/docker-compose.Makefile
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

critical

This Makefile appears to be missing the include directive. To inherit the common Docker Compose targets, it should be include ../../make/docker-compose.Makefile.

include ../../make/docker-compose.Makefile
![critical](https://www.gstatic.com/codereviewagent/critical.svg) This Makefile appears to be missing the `include` directive. To inherit the common Docker Compose targets, it should be `include ../../make/docker-compose.Makefile`. ``` include ../../make/docker-compose.Makefile ```
@ -0,0 +1 @@
../../make/docker-compose.Makefile
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

critical

This Makefile appears to be missing the include directive. To inherit the common Docker Compose targets, it should be include ../../make/docker-compose.Makefile.

include ../../make/docker-compose.Makefile
![critical](https://www.gstatic.com/codereviewagent/critical.svg) This Makefile appears to be missing the `include` directive. To inherit the common Docker Compose targets, it should be `include ../../make/docker-compose.Makefile`. ``` include ../../make/docker-compose.Makefile ```
@ -0,0 +1 @@
../../make/docker-compose.Makefile
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

critical

This Makefile appears to be missing the include directive. To inherit the common Docker Compose targets, it should be include ../../make/docker-compose.Makefile.

include ../../make/docker-compose.Makefile
![critical](https://www.gstatic.com/codereviewagent/critical.svg) This Makefile appears to be missing the `include` directive. To inherit the common Docker Compose targets, it should be `include ../../make/docker-compose.Makefile`. ``` include ../../make/docker-compose.Makefile ```
@ -0,0 +1,4 @@
DOCKER_CONTEXT := colima-ai-agent-1
DOCkER_NETWORK_NAME := ai-agent-lab
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

high

There's a typo in the variable name DOCkER_NETWORK_NAME. It should be DOCKER_NETWORK_NAME to be correctly recognized by the main docker-compose.Makefile.

DOCKER_NETWORK_NAME := ai-agent-lab
![high](https://www.gstatic.com/codereviewagent/high-priority.svg) There's a typo in the variable name `DOCkER_NETWORK_NAME`. It should be `DOCKER_NETWORK_NAME` to be correctly recognized by the main `docker-compose.Makefile`. ``` DOCKER_NETWORK_NAME := ai-agent-lab ```
@ -0,0 +14,4 @@
# If you do not, your requests to remote OpenAI API servers will be sent (and charged to you),
# but you will get a JSON error in response. Check the server logs when it starts up
# to make sure there are no CORS errors.
- "CORS_ALLOW_ORIGIN=https://openwebui.thinkpaddy.local;https://openwebui.thinkpaddy;https://thinkpaddy.local;https://thinkpaddy;https://open-webui:8080;http://open-webui:8080"
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

medium

The CORS_ALLOW_ORIGIN value is hardcoded with a long list of domains. This can be difficult to manage and adapt for different environments. Consider parameterizing this value using an environment variable from a .env file for better flexibility.

- "CORS_ALLOW_ORIGIN=${OPENWEBUI_CORS_ORIGINS}"
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) The `CORS_ALLOW_ORIGIN` value is hardcoded with a long list of domains. This can be difficult to manage and adapt for different environments. Consider parameterizing this value using an environment variable from a `.env` file for better flexibility. ```yaml - "CORS_ALLOW_ORIGIN=${OPENWEBUI_CORS_ORIGINS}" ```
@ -0,0 +22,4 @@
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
ghcr.io/open-webui/open-webui:main
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

high

This shell script seems to be a redundant and incomplete method for starting the open-webui service. It duplicates some settings from docker-compose.yaml but omits critical environment variables like CORS_ALLOW_ORIGIN and OLLAMA_BASE_URL. This could lead to a misconfigured or non-functional service. To ensure consistency and avoid confusion, it would be best to rely solely on the docker-compose.yaml file for service management. I recommend removing this script.

![high](https://www.gstatic.com/codereviewagent/high-priority.svg) This shell script seems to be a redundant and incomplete method for starting the `open-webui` service. It duplicates some settings from `docker-compose.yaml` but omits critical environment variables like `CORS_ALLOW_ORIGIN` and `OLLAMA_BASE_URL`. This could lead to a misconfigured or non-functional service. To ensure consistency and avoid confusion, it would be best to rely solely on the `docker-compose.yaml` file for service management. I recommend removing this script.
@ -10,3 +10,4 @@
- ai-agent-lab
command:>
/bin/sh -lc "npx -y playwright@1.58.2 run-server --port 3000 --host 0.0.0.0"
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

medium

The mcr.microsoft.com/playwright image comes with Playwright pre-installed. The current command uses npx to download and run a specific version of Playwright, which is redundant and inefficient as it will re-download it on every container start. You can directly use the binary included in the image.

/bin/sh -lc "playwright run-server --port 3000 --host 0.0.0.0"
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) The `mcr.microsoft.com/playwright` image comes with Playwright pre-installed. The current command uses `npx` to download and run a specific version of Playwright, which is redundant and inefficient as it will re-download it on every container start. You can directly use the binary included in the image. ```yaml /bin/sh -lc "playwright run-server --port 3000 --host 0.0.0.0" ```
@ -0,0 +41,4 @@
networks:
- ai-agent-lab
# Linux: uncomment to make host services reachable as host.docker.internal
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

high

The docker-compose.yml file uses hardcoded absolute paths with ~ for volumes and the env_file. This makes the setup dependent on the project being cloned into a specific location (~/aia1), which is not portable. Using relative paths would make the configuration more robust and work regardless of the project's location.

To fix this, you could:

  1. Change the paths in this file to be relative (e.g., ./Caddyfile, ./certs, ./.env).
  2. Adjust the caddy-install and other targets in svcs/reverse-proxy/caddy/Makefile to work with these relative paths, for instance by setting CADDY_CONFIG_DIR := . in svcs/reverse-proxy/caddy/Makefile.inc.
![high](https://www.gstatic.com/codereviewagent/high-priority.svg) The `docker-compose.yml` file uses hardcoded absolute paths with `~` for volumes and the `env_file`. This makes the setup dependent on the project being cloned into a specific location (`~/aia1`), which is not portable. Using relative paths would make the configuration more robust and work regardless of the project's location. To fix this, you could: 1. Change the paths in this file to be relative (e.g., `./Caddyfile`, `./certs`, `./.env`). 2. Adjust the `caddy-install` and other targets in `svcs/reverse-proxy/caddy/Makefile` to work with these relative paths, for instance by setting `CADDY_CONFIG_DIR := .` in `svcs/reverse-proxy/caddy/Makefile.inc`.
@ -0,0 +2,4 @@
include ../../make/docker-compose.Makefile
install:
cp config/settings.yml ~/aia1/svcs/searxng/
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

medium

The install target uses a hardcoded path ~/aia1/svcs/searxng/. This is not portable and makes the setup fragile. It's better to use a variable for this path, defined in Makefile.inc, and ensure the directory exists before copying.

install:
	mkdir -p $(SEARXNG_CONFIG_DIR)
	cp config/settings.yml $(SEARXNG_CONFIG_DIR)/
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) The `install` target uses a hardcoded path `~/aia1/svcs/searxng/`. This is not portable and makes the setup fragile. It's better to use a variable for this path, defined in `Makefile.inc`, and ensure the directory exists before copying. ``` install: mkdir -p $(SEARXNG_CONFIG_DIR) cp config/settings.yml $(SEARXNG_CONFIG_DIR)/ ```
@ -0,0 +9,4 @@
- ~/aia1/svcs/searxng:/etc/searxng:ro
environment:
- SEARXNG_SECRET=password
- SEARXNG_BASE_URL=https://thinkpaddy.local/searxng/
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

high

The SEARXNG_BASE_URL is set to a value that implies path-based routing (.../searxng/). However, the new Caddy reverse proxy is configured for subdomain-based routing (e.g., searxng.thinkpaddy.local). This mismatch will likely cause routing and URL generation issues within SearXNG. The base URL should be updated to match the subdomain configuration.

- SEARXNG_BASE_URL=https://searxng.${PROXY_DOMAIN}/
![high](https://www.gstatic.com/codereviewagent/high-priority.svg) The `SEARXNG_BASE_URL` is set to a value that implies path-based routing (`.../searxng/`). However, the new Caddy reverse proxy is configured for subdomain-based routing (e.g., `searxng.thinkpaddy.local`). This mismatch will likely cause routing and URL generation issues within SearXNG. The base URL should be updated to match the subdomain configuration. ```yaml - SEARXNG_BASE_URL=https://searxng.${PROXY_DOMAIN}/ ```
@ -0,0 +1 @@
../../make/docker-compose.Makefile
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

critical

This Makefile appears to be missing the include directive. To inherit the common Docker Compose targets, it should be include ../../make/docker-compose.Makefile.

include ../../make/docker-compose.Makefile
![critical](https://www.gstatic.com/codereviewagent/critical.svg) This Makefile appears to be missing the `include` directive. To inherit the common Docker Compose targets, it should be `include ../../make/docker-compose.Makefile`. ``` include ../../make/docker-compose.Makefile ```
@ -0,0 +14,4 @@
volumes:
- ~/aia1/svcs/vscode:/config
- ~/git:/config/workspace/git:ro
- ~/aia1:/config/workspace/aia1
gemini-code-assist[bot] (Migrated from github.com) commented 2026年03月29日 04:11:05 +02:00
Copy link

medium

The volume mounts use hardcoded absolute paths with ~ (e.g., ~/aia1/...). This makes the setup not portable as it assumes a specific directory structure on the host. It would be better to use environment variables defined in a .env file to specify these paths, making the configuration more flexible.

- ${VSCODE_CONFIG_DIR}:/config- ${GIT_DIR}:/config/workspace/git:ro- ${AIA1_DIR}:/config/workspace/aia1
![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) The volume mounts use hardcoded absolute paths with `~` (e.g., `~/aia1/...`). This makes the setup not portable as it assumes a specific directory structure on the host. It would be better to use environment variables defined in a `.env` file to specify these paths, making the configuration more flexible. ```yaml - ${VSCODE_CONFIG_DIR}:/config - ${GIT_DIR}:/config/workspace/git:ro - ${AIA1_DIR}:/config/workspace/aia1 ```
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mutablecc/ai-agent-coding!11
Reference in a new issue
mutablecc/ai-agent-coding
No description provided.
Delete branch "features/updates"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?