Files
alzeo/dashboard/opencode-web.service.template
T
Hasan BasbunarandClaude Opus 5.5 21ecc040e4 Fixes found by a real uninstall and a real first install on the reference box
- oc and the Agent tab load the box's generated opencode config through
  OPENCODE_CONFIG: on a box emptied and installed with the published
  one-liner, both answered with opencode's hosted free model (big-pickle),
  not the model the box serves.
- uninstall.sh --yes takes the providers that read the API key out of
  opencode's config before deleting the key (opencode refused to start at
  all: "bad file reference"); a file with nothing else of the user's goes to
  a backup (oc-merge-limits.py --remove-providers).
- The uninstall inventory knows the image lane's checkpoint (31 GB), and the
  CI gate on inventory pins reads install-image.sh too.
- The docker room check asks only for the container's room when the image is
  already here (an update with 36 GB free was refused for want of 40).
- A commented-out opencode PATH line no longer counts as one.
- uninstall.sh says when there was nothing to remove.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 17:43:37 +02:00

42 lines
1.9 KiB
Plaintext

[Unit]
Description=opencode web server for the Spark Cockpit Agent tab (loopback :__OPENCODE_PORT__)
Documentation=https://github.com/hasso5703/dgx-spark-qwen38
After=network.target
[Service]
Type=simple
User=__USER__
Group=__GROUP__
WorkingDirectory=__HOME__
Environment=HOME=__HOME__
# Your PATH at install time, so the agent's tools (git, node, uvx for the MCP
# servers, opencode itself) resolve the way they do in your terminal.
Environment=PATH=__PATH__
# The Basic credentials the cockpit relay presents (OPENCODE_SERVER_USERNAME and
# OPENCODE_SERVER_PASSWORD), generated once by install-agent.sh, mode 0600.
EnvironmentFile=__HOME__/.config/qwen38/opencode-web.env
# Same cap as the oc launcher: without it long thinking is cut at 32000 tokens
# and the turn ends silently.
Environment=OPENCODE_EXPERIMENTAL_OUTPUT_TOKEN_MAX=__OUTPUT_TOKEN_MAX__
# The box's own providers and default model, whatever your global opencode config
# says: opencode loads this file over it (a missing file is ignored). Without it a
# fresh box's Agent tab had only opencode's hosted provider and answered with its free
# cloud model, big-pickle, instead of the model this box serves (2026-09-23).
Environment=OPENCODE_CONFIG=__HOME__/.config/qwen38/opencode.json
# Tool permissions. opencode's own defaults ask before a tool touches a path outside
# the session's project and on a repeated identical call; AGENT_AUTO=1 at install
# approves every tool call instead (explicit deny rules of your opencode config
# still apply), the same autonomy as the oc launcher's --yolo.
__AUTO_LINE__
# Loopback only: the cockpit relay is the one thing that reaches this server.
ExecStart=__OPENCODE_BIN__ serve --hostname 127.0.0.1 --port __OPENCODE_PORT__ --print-logs --log-level INFO
Restart=always
RestartSec=3
# A stop takes the MCP servers and any tool the agent still runs down with it.
KillMode=control-group
TimeoutStopSec=20
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target