Debug/administer the Paperclip AI-company server on vps-openclaw — paths, CLI board auth, agent/adapter config, logs, DB, patch infra. Use whenever the user mentions Paperclip, its companies (quentinveys.be, SoloSpark, MyHousekeeper, or any `company list` result), its agents/adapters, or the paperclip container, or says `tailscale ssh vps-openclaw` then the Paperclip docker container.
Ships in paperclip-vps. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Connect with tailscale ssh vps-openclaw <cmd> only — plain ssh vps-openclaw fails Permission denied (publickey) from non-interactive sessions/subagents (1Password SSH agent locked or empty). Every subagent brief must say tailscale ssh vps-openclaw. Resolve the live container once and reuse that value for every container-specific command below — never re-type a remembered name, it may be stale or belong to another instance. Select exactly one container, the application one: CTN=$(docker ps --format '{{.Names}}' | grep -x paperclip) — the -x anchor matches only the container named paperclip, so the paperclip-hindsight-1 sidecar and the out-of-scope paperclip-bef-* stack can never land in CTN; if CTN comes back empty, stop there — the name changed, so list the candidates (docker ps --format '{{.Names}}\t{{.Image}}\t{{.Ports}}' | grep paperclip), pick the application container on 3100 (the one documented in Topology), assign it to CTN yourself, and only then continue; never run the docker inspect below or any docker exec with an empty CTN. Confirm its identity with docker inspect -f '{{.Name}} {{.Config.Image}}' "$CTN" before anything else, then keep passing "$CTN". paperclip-paperclip-1 is only the historical default, so a hard-coded name can inspect or patch the wrong instance (see Disk space below).
vps-openclaw (tailnet 100.100.10.60, hostname srv1453980). SSH: tailscale ssh vps-openclaw (tailnet-authenticated, no key/1Password needed; plain ssh depends on the 1Password agent and fails when locked; if you must use plain ssh, verify the host fingerprint out-of-band — provider console or tailscale ssh — before first connect; do NOT default to accept-new, it trusts whatever key a first-connection MITM presents).paperclip (image paperclip:local, built from /docker/paperclip via make build), API on 100.100.10.60:3100, UI served same port. Older notes saying paperclip-paperclip-1 are stale. Unrelated sidecars on the same host: paperclip-bef-paperclip-1, paperclip-bef-hindsight-1.paperclip sits alone on the Docker network internal (172.16.4.2) with no external DNS. Everything outbound goes through squid-proxy-squid-1 via HTTP(S)_PROXY=http://squid:3128 + NODE_OPTIONS=--use-env-proxy. A fetch that skips those vars dies on getaddrinfo EAI_AGAIN, not on a timeout../data/.config/github-app:/paperclip/.config/github-app:ro. Application data lives on the named volume mounted at /app/data (see Patch infrastructure)./app — PID 1 is node --import ./server/node_modules/tsx/dist/loader.mjs server/dist/index.js, running as uid 1000 (node), and the live logic is /app/server/dist/services/*.js (compiled from /app/server/src). Verified 2026-09-10: grep 'is not a git checkout' /usr/local/lib/node_modules/paperclipai returns nothing, /app/server/dist/services/heartbeat.js has it. The older claim that the global install /usr/local/lib/node_modules/paperclipai/ is PID 1 is stale — check before patching. For server logic the durable fix is the repo's /docker/paperclip/server/src/ plus a rebuild (make build). /app/server/dist/ is the tree PID 1 actually loads, but /app is not a bind mount: an edit made there is gone on the next --force-recreate, and because the checked-out /app/server/src can be older than the built dist, a blind make build can replace a live fix with older code. So land the change in /docker/paperclip and rebuild — treat a direct in-container edit as emergency-only, never as the record of the fix. Patching the global install or the npx caches leaves the running server on the old code entirely. The global install and the npx caches under /paperclip/.npm/_npx/<hash>/node_modules/@paperclipai/* (11 hashes exist) matter only for packages genuinely loaded from them — reading code there is fine, but a patch there does not reach the server. Don't repeat the mistake of patching a copy the process never loads./paperclip/.paperclip/plugins/node_modules/<pkg>/dist/{manifest,worker}.js. One forked worker per plugin, visible in /proc/*/cmdline (docker exec --privileged -u root is needed to read /proc/<pid>/environ).server/src/services/plugin-worker-manager.ts → buildWorkerProcessEnv, plugin-loader.ts → buildPluginWorkerEnv): process.env is never spread in, so anything a plugin needs must be explicitly passed through. Proxy vars were added there 2026-09-11 (commit 9152ea5dc, unpushed) — before that every http.outbound plugin was dead on this host.POST /plugins/<id>/config/test → the worker's onValidateConfig. Plugin-side error strings are usually catch-alls: @vectorize-io/hindsight-paperclip reports "Cannot reach Hindsight at " for any failure, DNS included. Reproduce with docker exec paperclip env -i PATH=... node -e 'fetch(...)' before believing the message.services/plugin-config-validator.ts), before the worker. Classic cause: the secret picker submits {type:"secret_ref",secretId,version} for format: "secret-ref" fields that plugins declare type: "string" (hit by company-wizard 2026-09-23). Fixed host-side in 949656dd1 (validates a copy with bindings collapsed to secretId) — no more per-plugin manifest patches like patches/hindsight-plugin/. Repro without a board key: docker exec -w /app/server "$CTN" node --input-type=module -e importing /app/server/dist/services/plugin-config-validator.js + the plugin's dist/manifest.js.secrets.resolve) needs ALL of: capability secrets.read-ref in the manifest, a {type:"secret_ref",secretId,version} object (a bare string is rejected), a companyId, and a binding at configPath (created when the config is saved for that company). Old bundled plugin SDKs send only { secretRef }. Without an echoed paperclipInvocationId, the host admits the call only if companyId is one of the plugin's configured companies (proactive scopes). validateConfig (the Test button) receives no company, so secrets can't be resolved there. Company-wizard fixed via passes 7-8 of entrypoint.d/37-company-wizard-secret-resolve.sh (de4ccc340). Manifest edits on disk are resynced to the DB at load, with no approval step. The current host rejects ANY worker→host call without paperclipInvocationId while an invocation is active (invalidInvocationScope, even config.get with no company) → company-wizard « Failed to load templates: 502 ». Fixed by pass 9 of script 37 (feb0d52f4): backports the SDK's AsyncLocalStorage echo into the bundled runtime. Host→worker performAction used the 30s default RPC timeout; LLM-backed actions (wizard ai-chat, ~45s) → « AI wizard failed » 502 + « received response for unknown request id ». Raised to 90s in routes/plugins.ts (f9fc6ffa8, stays under Cloudflare's 100s). push drops the exec bit: check git show --summary for mode change before make build.paperclipai (inside container)paperclipai binary and no /app/cli/dist, but the CLI RUNS FROM SOURCE (re-checked 2026-10-04; the 2026-09-10 « dead end, use the UI » note was wrong — and the UI has no board-key screen). /app/cli has src/ plus node_modules (tsx, commander, @clack, @paperclipai/*), so every command below works as docker exec -w /app/cli "$CTN" node_modules/.bin/tsx src/index.ts <args> (~15s cold start). Wherever this section says paperclipai <args>, read that. command -v paperclipai empty is NOT proof the CLI is missing: search before concluding (find / -xdev -name 'paperclipai*' finds the /app/node_modules/.pnpm/node_modules/paperclipai -> ../../../cli workspace link, then ls /app/cli). Do not npm run build it.~/.config/paperclip/board-token on the Mac can be stale or an agent key: the API answers 401 Agent token did not verify. Mint a fresh one with the command below.docker exec -it -w /app/cli "$CTN" node_modules/.bin/tsx src/index.ts connect --persona board --token-name <label> --api-base http://localhost:3100 — the « Paperclip API base » prompt is pre-filled with a truncated value: clear it and type http://localhost:3100. Interactive (user completes login; run it in the user's visible pane). Prints a pcp_board_… token (30-day expiry). The CLI context profile does NOT persist it for later docker execs — and never put the token in shell history or process args (-e KEY=… is visible in ps). Write it to a 0600 env file instead (paste via read, not on the command line), then pass it with --env-file:
umask 077; { echo PAPERCLIP_API_URL=http://localhost:3100; printf 'PAPERCLIP_API_KEY=%s\n' "$(read -rs t; echo "$t")"; } > /root/.pcp.env
docker exec --env-file /root/.pcp.env -w /app/cli "$CTN" node_modules/.bin/tsx src/index.ts <args> — rm /root/.pcp.env once the session is done.company list, agent list -C <companyId> (flag is -C, not --company), agent get <agentId> --json, agent update <agentId> --payload-json '<json>' (partial payload OK, e.g. just {adapterConfig}), agent resume <agentId> (clears error status), heartbeat run -a <agentId> --timeout-ms 90000 (triggers a REAL adapter run with live logs — the best end-to-end validation)./api/*, Authorization: Bearer <key>. Only ever call it over the tailnet address (100.100.10.60, already end-to-end encrypted by Tailscale's WireGuard between authenticated peers) or the container's own loopback (docker exec's http://localhost:3100, never leaves the box) — never bind/forward port 3100 beyond the tailnet, which would put the bearer token on a genuinely cleartext path. Routes: PATCH /api/agents/:id, GET /api/companies/:id/agents, POST /api/companies/:id/adapters/:type/test-environment.quentinveys.be = 92b95c2f-df76-47f8-acb8-17e7a6d0cb69 (13 agents; engineer Amelia d5b9099c… claude_local is the healthy reference config). Company SoloSpark = 217aab1b-90e2-48e1-bc29-1e531d3c7a3d (CEO + Engineer 006975a9…; Engineer has adapterType process with EMPTY adapterConfig → Process adapter missing command — user deferred fixing; SoloSparkApp project also lacks git init → WorkspaceValidationFailure on issues SOL-2..9).MyHousekeeper (live 2026-08 runs: plugin-sdk, OpenCode adapter, models not loading). Resolve current company/agent IDs with company list / agent list -C — do not assume only quentinveys.be and SoloSpark exist.9f7ee7bb-02b1-4217-a3b0-793ceb014705, adapter openclaw_gateway → gateway on the Mac via wss://macbook-openclaw.end-inconnu.ts.net (portail Caddy routes WS upgrades → 127.0.0.1:18789).~/.hermes/.env: PAPERCLIP_MCP_API_KEY (agent-scoped to quentinveys.be CEO — CANNOT list companies, "Board access required"), PAPERCLIP_CEO_KEY./app/data/instances/default/logs/server.log inside the container (HUGE, ~800MB — always docker exec "$CTN" tail -c 5000000 … | grep, never read the whole file). The old host path /docker/paperclip/data/instances/default/logs/server.log predates the move of application data onto the paperclip_paperclip-data named volume — do not expect it to exist. Container boot: docker logs. Instance config: instances/default/config.json, container-side /app/data/instances/default/config.json.index.js ~line 306 (look them up there at need — not reproduced here). NO psql binary anywhere (embedded pkg ships only initdb/pg_ctl/postgres). Query via docker exec node + the postgres npm package from the global install. NOTE: the permission classifier tends to flag direct DB access as credential exploration — prefer the CLI/API route with a board token; it covers almost everything.POST /api/companies/:id/secrets {name, value} → local_encrypted. In adapterConfig, {type:"secret_ref", secretId, version:"latest"} is resolved at runtime ONLY for (a) keys under env, and (b) fields the adapter's schema marks meta.secret:true (fallback table covers ONLY hermes_gateway: ["apiKey"]). openclaw_gateway has no schema → its password/authToken fields must be PLAINTEXT (get explicit user consent; do the PATCH from the Mac with the value in a shell var so it's never displayed).openclaw config get gateway.auth.password | tail -1 returns a TRUNCATED value (21 chars vs the real 28) — always read secrets from the canonical file: jq -r '.gateway.auth.password' ~/.openclaw/openclaw.json. Compare by shasum when debugging "password mismatch", never by printing.url must be ws:///wss:// — a https:// URL → agent error Unsupported gateway URL protocol: https:. Correct value: wss://macbook-openclaw.end-inconnu.ts.net. Field apiBaseUrl is NOT read by the adapter (dead config).test-environment probe is a FALSE NEGATIVE generator: the route doesn't pass adapterType (so secret_refs unresolved → "auth missing" warn) and the probe sends only authToken (never password, no device identity) → "challenge received, connect probe rejected" is EXPECTED with password auth. Judge with heartbeat run, not the probe.PROTOCOL_VERSION = 3; OpenClaw gateway ≥2026.6.x only accepts range including 4 → Error: protocol mismatch. Fixed by the repo-tracked patch /docker/paperclip/patches/openclaw-protocol-v4/ (baked to /app/patches/openclaw-protocol-v4/apply.sh by Dockerfile:46; bumps execute.js + test.js in every copy the adapter can load) and applied at build time by /opt/paperclip/build.d/42-openclaw-protocol-v4.sh via a RUN line — not an entrypoint.d step, which runs non-root and cannot write those paths (see the patch bullets below). Becomes a no-op when upstream ships v4; remove then.devicePrivateKeyPem) = 30a7cf4f… for the Orchestrator. Check pairing on the Mac: openclaw devices list. Adapter auto-pairs on first connect (autoPairOnFirstConnect default true) but never persists a deviceToken. First authenticated run may fail once with "pairing required" while auto-pairing lands — just retry.timeoutSec: 300 (9router auto brain can exceed the 120s default).PAPERCLIP_API_KEY from ~/.openclaw/workspace/paperclip-claimed-api-key.json (adapter config claimedApiKeyPath). File wired 2026-07-04 (mode 600): JSON {apiKey, key, agentId, agentName, companyId, apiUrl} where the key comes from paperclipai token agent create -C <companyId> --agent <agentId> --name <label> --json (board auth; token agent list/revoke need BOTH -C and --agent). Active key label openclaw-orchestrator id 11f36cfa…. Secrets are write-only in Paperclip (no API/UI read-back; only usage/access-events).~/Library/Logs/openclaw/gateway.log is launchd stdout only — stderr goes to /dev/null, so protocol mismatch warns are INVISIBLE there. Portail access log ~/Library/Logs/portail/access.log (JSON) shows whether the VPS WS upgrade arrived (status 101, X-Forwarded-For). To see the gateway's real answer, replay the handshake from the Mac with python websockets → ws://127.0.0.1:18789, wait connect.challenge, send connect req./dev/sda1 193G) — audited 2026-08-20overlay2 driver: images/layers live in /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs + .../io.containerd.content.v1.content, root-only (0710), invisible to du as qveys — use docker system df (accurate even non-root) or re-run as root to see the real files.docker builder prune -a -f (freed 29.45G) then docker image prune -a -f (freed 5.265G). Neither is zero-risk — re-check both conditions before every run. builder prune -a drops the entire build cache, so the next make build starts cold (the 2026-08-17 rebuild measured ~184s warm); that is a time cost, not data loss. image prune -a is the destructive one: it removes every image that no container references — any container counts, running or stopped (a stopped one still protects its image), and a tag does not protect anything from -a. The image is therefore at risk once the container itself is removed (docker rm, a recreate, or docker system prune -a, which deletes stopped containers first and their images second) — then the custom committed image (Topology) is unreferenced and goes with no rebuild path. Two hard rules: never run image prune -a in the same breath as removing or recreating the container; and if a specific image must survive a prune, keep a stopped container referencing it, or docker save -o paperclip-rollback.tar <image> first and docker load to restore./docker/<instance>/data/instances/default/companies/<Company>/projects/<repo>/.paperclip/worktrees — one git worktree per Paperclip issue, unbounded growth (TempMailX alone hit 132 worktrees / 8.2G before cleanup on 2026-08-20, on an instance distinct from the container resolved in Topology ($CTN) — resolve the real container name with docker ps --format '{{.Names}}' first, don't assume it's the same one). Worktree admin metadata is written from inside the container, so paths are recorded container-side (/paperclip/instances/...), not as the host bind-mount path — running git worktree commands from the host on the bind-mount path gives false-positive "prunable" results. Always operate via docker exec "$CTN" git -C /paperclip/instances/default/companies/<Company>/projects/<repo> worktree .... Cleanup is list-first, remove-second, never bulk-blind (user-approved, not automatic) — a worktree is the working state of a real Paperclip issue, so deleting an open one's tree discards its work. First, enumerate candidates and read the porcelain fields, not just the paths: docker exec -i "$CTN" sh -s with a heredoc running worktree list --porcelain and printing path + locked + detached per entry, plus git status --porcelain=v1 --untracked-files=all --ignored inside each — plain git status --porcelain hides ignored files, and worktree remove deletes without complaint a tree whose only content is ignored, so that set has to be inspected too. Second, classify and show the user: always keep the first entry (the main working tree — worktree remove refuses it anyway), skip and report every locked entry (unlock it deliberately first, never as a reflex), skip and report every detached entry (a detached HEAD can carry commits no branch retains, so a tree that looks clean can still be the only copy of that work), and skip and report every worktree whose status is not clean — only a tree whose issue is closed, whose status is clean, and whose HEAD is on a branch is a removal candidate. Third, remove only the paths the user explicitly approved, without --force; reserve --force for a candidate where the user has confirmed the uncommitted changes may be discarded, since it is required precisely for the dirty trees the classification step already flagged. Then worktree prune -v. Freed 8.2G on 2026-08-20 (part of the cumulative df 81%→49% drop from every cleanup in this section combined, not from this step alone).instances/default/config.json holds database.backup.{enabled,intervalMinutes,dir} per instance — each instance has its own file at its own path, and editing the wrong instance's copy leaves the running one unchanged. But database.backup.retentionDays in that file is never read by anything: server/src/index.ts → runServerDatabaseBackup reads retention from the Instance Settings stored in the database (backupSettingsSvc.getGeneral().backupRetention, logged at startup as retentionSource: "instance-settings-db"). The schemas are .passthrough(), so a wrong or stray key produces no error at all. Consequence: setting retentionDays: 7 in config.json changes nothing, restart or not — that fix was applied 2026-08-20 and was still inert a month later. The real knob is backupRetention = a GFS policy {dailyDays, weeklyWeeks, monthlyMonths} (code default 7/4/1), editable only via Instance Settings → General → Backup Retention in the UI (takes effect without restart). intervalMinutes, by contrast, is read from config.json — but only at startup, so it needs a container restart. Ground truth for what is actually applied is the per-run log line, which prints both: docker logs <ctn> | grep 'backup complete' → "retention":{"dailyDays":…} plus prunedCount. Measured 2026-09-16: paperclip-bef ran 14/4/6 with intervalMinutes: 360 (60 dumps, 11G); paperclip ran the 7/4/1 default with the default 60-minute interval (165 dumps, 6.5G). Editing config.json via sed -i in the visible cockpit was blocked by the Claude Code auto-mode classifier (config-file edit) — the user has to apply it in the pane, no workaround./home/qveys/skool-offline-archive removed on 2026-08-20 (below) was the WorkingDirectory= of three user-scope systemd units (skool-archive-media.service, skool-archive-worker@{1,2}.service, RestartSec=5). They have been restarting every 5s ever since — 167 282 restarts and ~167 500 journal lines per 24h measured 2026-09-16, which buried every real error in the journal for a month. They do not show up in systemctl --failed (system scope only), and the user manager you want is qveys's, not root's: in a root shell ~ is /root and $(id -u) is 0, so a bare systemctl --user inspects the wrong manager and misses units under /home/qveys/.config/systemd/user and /run/user/1000. Spell the target out — XDG_RUNTIME_DIR=/run/user/1000 systemctl --user list-units --all, or run the check as qveys — or spot them in the journal via [email protected]. Before rm -rf on any sizeable tree here, run grep -rl '<path>' /etc/systemd/system /home/qveys/.config/systemd/user 2>/dev/null — /home/qveys/... explicitly, never ~, which resolves to /root/... in a root shell — and disable the owners in the same breath./home/qveys on this host isn't just Paperclip data — unrelated files accumulate there too (found/removed a 28G skool-offline-archive, 2026-08-20). Always du -xh --max-depth=1 / first, as root — as qveys it silently misses /var/lib/containerd (see above) and undercounts Docker-side bloat. That -x (--one-file-system) confines the walk to /dev/sda1, so its output is the root filesystem only, not the whole picture: it deliberately skips every other mount, so a full disk can hide there. Pair it with df -hT for per-mount usage and docker system df for the snapshotter, and run the du per mount point when a mount other than / is the suspect.Do not start with a new patch. For adapter_failed / models-not-loading, inspect live OpenCode/Paperclip config and logs first and ask whether an existing patch is the break. Patch only after that, with user consent — and first establish which of the two layouts below the patch uses.
/docker/paperclip/scripts/entrypoint.d/NN-name.sh (tracked in the repo), baked to /opt/paperclip/entrypoint.d/ by Dockerfile:97. Edit the repo file then make build && restart — never docker exec into the image copy (lost at next rebuild). Read its README.md before adding. Conventions: set -uo pipefail, marker-gated idempotent, fail-SOFT (exit 0 always), .bg.sh suffix = background (races with server module load — never use for server-code patches)./docker/paperclip/patches/<name>/, baked to /app/patches/<name>/ by Dockerfile:46 (COPY patches/ patches/); the boot step just execs /app/patches/<name>/apply.sh. /paperclip/patches is NOT a mount — the only bind is ./data/.config/github-app:/paperclip/.config/github-app:ro. Anything found under /paperclip/patches is a leftover docker cp and dies at the next rebuild. (2026-09-01: 52-git-signed-push-guard.sh still pointed at the old /paperclip/patches/... path → payload never ran, 0/150 agents had GIT.md; fixed to /app/patches/....) Treat that as one layout, not a rule — verify per patch before editing anything, and note that this repo-tracked layout is the build-context case: a payload that must be root-owned from the image's first start belongs in the Dockerfile, not on a runtime volume.git-signed-push-guard lives in the repo: /docker/paperclip/patches/<name>/, tracked by git, baked in by Dockerfile:49 (COPY patches/ patches/), and executed from /app/patches/<name>/apply.sh. There is no data/patches/ copy (the comment in entrypoint.d/52-git-signed-push-guard.sh:5 claiming data/patches/... -> /paperclip/patches/... is stale — that path does not exist). Consequence: editing the host file changes nothing until make build; every container restart until then re-runs the old payload from the image. Resolve which of the two layouts a patch uses (ls /docker/paperclip/patches/<name> vs ls /docker/paperclip/data/patches/<name> + grep patches Dockerfile) before editing anything.-path "*/companies/*/agents/*" matches everything BELOW the agent dir, not the agent dir — the * of a -path traverses /. Combined with mkdir -p "$agent_dir/instructions" this made apply.sh create an instructions/ inside every directory it walked, including the ones the previous boot created: +1 nesting level per container start. Found 2026-09-11 at depth 26 — 1822 instructions dirs for 23 agents (1799 redundant), 3598 byte-identical duplicate files. Fixed in e645897fb by anchoring on the agent's AGENTS.md (find -type f -name AGENTS.md) and dropping GIT.md beside it, so no directory is ever created. Use -mindepth/-maxdepth, or anchor on a file, whenever a -path glob is meant to pin one level./docker/paperclip/data/entrypoint.d/ (volume) is DEAD — the entrypoint only reads /opt/paperclip/entrypoint.d.docker cp into a live container.paperclip_paperclip-data, mounted at /app/data (instances/, projects/, workspaces/) — NOT under /paperclip, and NOT on a host bind. Survives image rebuilds. Any older note describing /docker/paperclip/data ⇄ /paperclip for app data is wrong.paperclip (image paperclip:local), not paperclip-paperclip-1.base64 | tr -d '\n' locally, then echo <b64> | base64 -d > file remotely (avoids quoting hell in typed panes).entrypoint.d boot steps can't patch root-owned node_modules even when the script itself is written as root (2026-08-17, 42-openclaw-protocol-v4.sh): the boot step runs non-root at container start, so writes into the global install fail there. Fix: bake the patch in at build time instead — /opt/paperclip/build.d/NN-name.sh invoked via a RUN line in the image's Dockerfile (runs as root during docker build). Verified end-to-end for openclaw-protocol-v4 (global + npx caches patched, make build && restart, ~184s rebuild). Prefer build.d over entrypoint.d whenever the patch touches root-owned paths.TOOLS.md / AGENTS.md / SOUL.md / HEARTBEAT.md are regenerated at every boot by entrypoint.d/59-agent-prompt-diet.sh from patches/agent-prompt-diet/apply.cjs (renderTools() etc., all 36 bundles). Editing them on the volume is lost at restart — edit apply.cjs, then preview with docker exec -i -e PC_COMPANIES_ROOT=/app/data/instances/default/companies "$CTN" node - --dry-run < patches/agent-prompt-diet/apply.cjs or apply live with docker exec -i -e PC_COMPANIES_ROOT=/app/data/instances/default/companies "$CTN" node - < patches/agent-prompt-diet/apply.cjs (the flag is an exact token, so the two forms are separate commands), then make build (the boot step runs the baked copy, so a restart before the rebuild reverts the live edit). 2026-09-25 ba4956358: rule forbidding hardcoded API hosts — weak free models (opencode/nemotron-3-ultra-free) guessed localhost:3000, concluded the API was down and posted that claim on a GitHub PR it matched to the wrong issue. Correct in-container API = localhost:3100 (NO_PROXY covers it).omniroute-backed paperclip/* models fail 100% (agent-model-policy boot step is absent from entrypoint.d, policy inert); opencode/muse-spark-1.3-contributor-free 20/21 ok. Board key for API calls: ~/.config/paperclip/board-token on the Mac (7-day), called through docker exec "$CTN" node fetch to localhost:3100 — the tailnet 100.100.10.60:3100 hangs from macbook-pro.zcat /app/data/instances/default/data/backups/paperclip-<ts>.sql.gz | grep -A8 'COPY "public"."companies"'.
e7bc4ba4-3e10-4261-b25a-00d6ccb438ca = My-Housekeeper (project my-housekeeper)0c68c58b-93e9-465c-8d97-5db02d060598 = Markify (project markify)companies/MyHousekeeper/ (slug-named, frozen 2026-09-01) is a stale leftover — live data is under the UUID dirs./app/data/instances/default/projects/<companyId>/<projectId>/<repo>, owned by node (uid 1000).
Always docker exec -u node paperclip git -C <path> … — as root, git reports a different state (dubious ownership).
Paperclip-managed worktrees sit in <repo>/.paperclip/worktrees/<BRANCH>, one per issue./app/data/instances/default/data/run-logs/<companyId>/<agentId>/<runId>.ndjson.
Hourly DB dumps in .../data/backups/ are the cheapest way to read agent status, adapter_type and error_reason without a board key.ps/pgrep are unreliable in this container (procps missing) — enumerate /proc/[0-9]*/cmdline instead.promisify(execFile) loses its custom symbol — root cause of MYH-162 (2026-09-10)GIT_SENSITIVE_LOCAL_ADAPTER_TYPES: claude_local, codex_local, cursor, gemini_local, grok_local, hermes_local…) stuck in status=error with "Issue X requested isolated_workspace with git_worktree, but base workspace … is not a git checkout". The workspace is perfectly fine.execFile has lost its nodejs.util.promisify.custom symbol. Without it, promisify() resolves the first callback value — stdout as a plain string — instead of { stdout, stderr }. Callers then read result.stdout === undefined. Captured evidence:
resultType: "string", resultPreview: "\".git\\n\"", stdoutType: "undefined", hasPromisifyCustom: "undefined".isGitCheckout() never reaches its .catch() and never logs. readNonEmptyString(undefined) → null → false, silently. An empty grep isGitCheckout on the logs is the symptom, not an all-clear.execFile(...).stdout reader — including the materialization git clone, which explains the git_worktree_base_materialization_failed entries too.services/heartbeat.ts and services/git-credentials.ts, rather than patching each call site:
// Do not build this on `promisify(execFileCallback)`: without the custom
// symbol that promise resolves the first callback *value* (stdout as a plain
// string) and exposes no `.child` at all — so normalizing the shape afterwards
// cannot restore cancellation, because there is nothing to copy.
// Drive the callback API directly instead: the ChildProcess comes back from the
// call itself, so the promise always carries it.
const execFile = ((...args: unknown[]) => {
type Child = { kill?: (s?: unknown) => unknown };
let child: Child | undefined;
const promise = new Promise((resolve, reject) => {
child = (execFileCallback as unknown as (...a: unknown[]) => Child)(
...args,
// execFile attaches stdout/stderr to the error, so rejecting with it keeps
// the rejected-path contract identical.
(err: unknown, stdout: string, stderr: string) =>
err ? reject(err) : resolve({ stdout, stderr }),
);
}) as Promise<{ stdout: string; stderr: string }> & { child?: Child };
if (child !== undefined) promise.child = child;
return promise;
}) as unknown as typeof execFileCallback;
node_modules reassigns execFile or touches promisify.custom; plugins never reference child_process. Outside the server process — same container, same uid, CJS and ESM, with and without the tsx loader — the symbol is present (custom=function). Treat any new promisify(<node callback API>) in this codebase as suspect.POST /api/issues/:id/recovery-actions/resolve answers 404 (8 of 19 calls, plus 5× 400), so agents cannot close their own recovery loop — hence duplicated worktrees (pr-audit-merge-order ×4, auto-assign-unassigned-issues ×3).status does move on its own (CEO and Product Owner went error → idle unaided on 2026-09-10), but not reliably — several stayed stuck for 9 days. If one is still error after the underlying cause is fixed, agent resume (board key required) is the lever.WorkspaceValidationFailure after the rebuild, and the My-Housekeeper CEO (0b44e4bd…) started its first run since 2026-09-01, passing workspace validation on worktree MYH-88-…. VPS commit f6314abc0.d251ab209 + 9929c7396, unpushed)@opencode/[email protected] (V1 was opencode-ai, a different npm package — an unpinned opencode-ai never jumps to V2). Rollback image kept as paperclip:pre-opencode-v2: docker tag paperclip:pre-opencode-v2 paperclip:local && make restart.run/models connect by default to ONE shared background service on a fixed port → per-run XDG_CONFIG_HOME isolation silently lost. The adapter passes --standalone (must come AFTER the subcommand). --variant is gone → --model provider/model#variant. JSONL events (text, step_finish tokens/cost, tool_use, error) and --session are unchanged; unknown session = error.message: "Session not found", exit 1.opencode models --standalone (and opencode api model.list) ALWAYS returns empty: the catalog populates ~1s after server start and --standalone tears it down first. Discovery now spawns opencode serve --hostname 127.0.0.1 --port <free>, reads server password <PW> on stdout, polls GET /api/model (Basic opencode:<PW>) → providerID/modelID. Only configured providers are listed (97 in prod).permissions: [...{action:"external_directory",resource:"*",effect:"allow"}] (defaults to ask, headless would hang), providers plural; V1 input is converted, never mixed. V2 still reads V1 files.OPENCODE_ALLOW_ALL_MODELS is a Paperclip-side flag (not in the binary) — normal. paperclip-runner's opencode-server-driver.ts still pins 1.18.29 (hard-fails on mismatch) — unused, only for adapter_type=paperclip_runner + provider: opencode. /app/data/.config/opencode/package.json still lists V1 @opencode-ai/plugin (no plugin declared, harmless).opencode run anywhere in the cmdline (docker top paperclip -o pid,etime,args); runs are /usr/local/bin/opencode run …, while bare opencode lines are interactive docker exec -it sessions — a ^opencode filter counts the wrong ones. Run output lives in /app/data/instances/default/data/run-logs/<company>/<agent>/<run>.ndjson.adapter_failed « Cannot overwrite directory with non-directory: cp returned ENOTDIR » (fixed 2026-09-26, 32f34632b)902d632ca bridges /paperclip/.config/opencode → /app/data/.config/opencode as a symlink; opencode-local/src/server/runtime-config.ts then fs.cp'd it with dereference: false onto a pre-created dir → ENOTDIR on every opencode_local run. Fix: fs.realpath the source dir first (+ symlink test in runtime-config.test.ts). Any new home-dir bridge can break CLIs that copy their config the same way.src (package exports → ./src/*.ts), so no dist rebuild is involved. Deployed + restarted 07:01 UTC; end-to-end run NOT yet observed (no opencode run in the next 10 min).P=packages/adapters/opencode-local/src; docker run --rm --network none -u node -w /app/packages/adapters/opencode-local --entrypoint sh -v /docker/paperclip/$P:/app/$P:ro paperclip:local -c '/app/node_modules/.bin/vitest run src/server/'. The -v source MUST be an absolute host path that exists — a wrong one makes Docker create a root-owned empty tree on the host (cleaned with rmdir -p via a root container).HOME=/paperclip, not the compose's HOME=/app/data: the entrypoint's exec gosu node resets HOME from /etc/passwd (node:…:/paperclip). docker exec (root) shows /app/data — misleading. Check with docker exec "$CTN" gosu node sh -c 'echo $HOME'.codex_local takes the shared login from $CODEX_HOME or os.homedir()/.codex → /paperclip/.codex (missing, ephemeral layer), while the real login lives at /app/data/.codex/auth.json (volume). Each company's codex-home/auth.json is a symlink to that shared file, so with no shared file every new company demanded its own login.750a4dd56: scripts/docker-entrypoint.sh bridges /paperclip/.codex → /app/data/.codex (same pattern as .paperclip/adapter-plugins). Needs make build to be baked in; the live symlink was created by hand in the meantime. Check with evaluateCodexCredentialReadiness({companyId}) run as node via the tsx loader from /app/server.auth.json. If runs then fail with an auth error, log in once: codex login --device-auth with CODEX_HOME=/app/data/.codex, as node, in a visible pane.249d3d56c: .claude and .gemini are bridged the same way (a single loop over the three dirs). The live migration merged them with cp -a -u (newest file wins); the originals are kept under /paperclip/<d>.pre-bridge-20260924022146 until the container is recreated. /paperclip/.claude.json is NOT bridged: Claude probably rewrites it with an atomic rename, which would replace a symlink with a regular file without anyone noticing. Use CLAUDE_CONFIG_DIR if it ever needs to persist.3ba518b00)blocked, execution_reconciliation_required, and unblocking it (UI or POST /api/issues/:id/recovery-actions/resolve + executionReconciliation, board key) answers 200 but re-blocks within ~30s. Hit 118 issues across Markify / My-Housekeeper / OpenCode Mobile (MYH-334 had 64 holds).getExecutionBlocker() (services/execution-blocker.ts) blocks on any action with evidence.automaticRecovery.replay = 'blocked', but the resolve route only clears the latest one. (2) cancelStaleRunInTx (modules/run-dispatch/adapters/postgres.ts) cancels never-started runs on a blocked issue without resultJson.executionRecovery = {kind:"bootstrap", providerWorkStarted:false}, so legacyExecutionNeedsReconciliation() later sees a failed legacy run and terminalizeLegacyExecution mints a new hold → the gate generates its own next lock.3ba518b00 (both files + 2 tests, red/green checked) — inert until make build. Until then, per-issue data fix: scratchpad-style script in one transaction — strip automaticRecovery from every blocked action of the issue (keep it under operatorClearedAutomaticRecovery), backfill the bootstrap evidence on its runs with status='cancelled' AND error_code='execution_reconciliation_required' AND started_at IS NULL AND process_pid IS NULL, set the issue todo. Clearing holds alone is NOT enough (re-blocked in 23s by the unbackfilled runs). Verified on OPE-2/OPE-22: run started 70s later, no new hold. Also stamp evidence.executionReconciliation = {runId: <that action's run>, providerStopped: true, actionOutcome: "not_performed", …} on every cleared action (no continuationDelivery, so no wake storm): a periodic revisit of an older started failed run only skips it when a resolved action carries executionReconciliation.runId = that run (terminalizeLegacyExecution); without it OPE-7/OPE-39 re-blocked 40s after a plain clear, even with 3ba518b00 deployed. Honest only for a run that provably never started — started_at IS NULL AND process_pid IS NULL (the same gate as the backfill above) — and has empty result_json.stdout and null usage_json; last_output_bytes counts stderr, don't use it. A run with started_at/process_pid set is never not_performed from output alone (it can have worked and lost its output): list it for a human instead. Code gap still open: 3ba518b00 clears older holds on a UI reconcile but doesn't mark their runs reconciled, so a revisit can re-mint them.adapter_failed on antigravity_local in Sept 2026 was mostly RESOURCE_EXHAUSTED (429) Individual quota reached in result_json.stderr (stdout empty): the Antigravity subscription quota, not a Paperclip bug — agents on it re-fail until the reset.error (e.g. antigravity auth) fails again and re-locks. Runs that started (started_at/process_pid set, e.g. acpx_turn_failed mid-turn) are not provably not_performed whatever their output: list them for a human instead of stamping not_performed.todo with only resolved holds and still never run (MYH-198, 2026-09-25): executionBlockerPredicate matches replay='blocked' whatever the action status, and since e8bb6575f admission creates no run at all — silent. Same fix, unhold.cjs <ident>. It only flips blocked→todo, so an issue already in todo gets no wake: with heartbeat.enabled: false + wakeOnDemand, nudge it from the UI (comment, or status toggle) after the unhold. The auto-mode classifier refuses to let Claude run unhold.cjs, even dry — the user runs it in the pane. A follow-up action cancelled with cause legacy_execution_requires_reconciliation and no replay (e.g. after issue_reassigned) is harmless. Container /tmp/q.cjs gets overwritten by other sessions — use a unique file name for ad-hoc queries.unhold.cjs (dry run, then expectedCount = sum of holds), still todo with 0 holds 5 min later; 47 with model output (human review), 12 antigravity quota, 1 agent in error. Then, on explicit board decision (no per-run review), unhold-mixed.cjs (same transaction, actionOutcome: "mixed", actorId: operator:unhold-mixed, self-selects blocked issues whose hold runs have output) → 46 issues / 84 holds / 3279 gate-cancelled runs backfilled, none re-blocked. The auto-mode classifier refuses to let Claude write/run that no-review variant — the user runs it in the pane. Third hold source still open: a scheduled_retry cancelled with issue_dependencies_blocked (started_at null, no bootstrap evidence) re-minted a hold on MYH-200 3 min after unhold — resolve the blocking dependency first. Permanent fixes deployed 2026-09-25 08:57 UTC (both signed, unpushed): afeb36b64 — legacyExecutionNeedsReconciliation returns false when startedAt === null && processPid === null (never-started runs can't mint holds; checked before the retry-count rule; 7714 such runs in DB, none with stdout/usage/log); e8bb6575f — cherry-pick of upstream #13236 (execution-wait.ts: admission checks the hold BEFORE creating a run, so the dependency-wake backstop of upstream #13204 no longer spawns ~2 cancelled runs/min per held issue; UI collapses repeats into one « Waiting to resume » marker). Measured: 450 cancelled runs/h on OPE-6/14/18/31 → 0. Pre-existing unrelated test failures: 6 in ui TaskChatThread.test.tsx, 1-3 flaky in chat-channels.integration.test.ts. Remaining holds come from STARTED runs (opencode adapter_failed, antigravity quota) — legitimate, fix the adapters. Restart needs a no-run window that rarely comes (80 min without one) — user accepts interrupting the in-flight run. UI lever = the RECOVERY NEEDED card on the issue page (IssueRecoveryActionCard.tsx, « Resolve recovery » → « Try again » / « Mark task done »).docker run --rm --network none -u node -w /app/server --entrypoint sh -v /docker/paperclip/server/src:/app/server/src:ro paperclip:local -c './node_modules/.bin/vitest run <file>' (embedded Postgres, ~30s); mount an original file over one path for the red check. Writing into the live container's /app was refused by the auto-mode classifier.47-register-qveys-agent-router-adapter.sh + 58-qveys-agent-router.bg.sh (commit 21e237fb4) — OmniRoute router leftover; re-registered its adapter into /app/data/adapter-plugins.json on every boot and started router.mjs on 127.0.0.1:3188.58-agent-model-policy.bg.sh (commit 15106abbb) — applied patches/agent-model-policy/, which assigned paperclip/<role> models "across all companies" by role. Those models do not exist anywhere (neither in the paperclipai package nor in the router) → Markify's runs failed with "issue with the selected model (paperclip/pm)". The payloads stay in the repo as dead code, reactivatable.56-junie-omniroute-models.sh (writes junie model profiles only, does not touch agents).qveys-agent-router entry was also removed from /app/data/adapter-plugins.json (a .bak-<ts> sits beside it). That store is on the volume: deleting a boot step does not clean what it already wrote./home/qveys/.ssh/id_ed25519_signing (SHA256:nUWSPv7rL5MtqRJnxfb5bDGMbdLy2ibg67ykgxp7wec), no passphrase.
The 1Password key never reaches the VPS — SSH_AUTH_SOCK is empty under tailscale ssh, so git commit -S dies with Couldn't get agent socket?.
Trap: /docker/paperclip/.git/config held the Mac's literal public key as user.signingkey. ~/.ssh/allowed_signers is configured, so git log --format=%G? returns G.make build && restart deploys it (10832B, 4-fixture smoke test passed).module.exports vs export (CJS/ESM) mismatch — a fix was pushed, container verified serving the new file, but the browser still rendered the old CommonJS stub even after a Cloudflare cache purge (540B→10824B origin confirmed via direct fetch, network trace showed the stale version still reaching the client). Root cause NOT confirmed at last check — before touching this again, verify origin vs. edge vs. browser cache in that order rather than assuming CF purge is sufficient.paperclip (source checkout at /docker/paperclip) — 2026-09-01paperclip (this one, built from the source tree at /docker/paperclip, data under /app/data) and the older paperclip-bef-paperclip-1. docker compose exec "$CTN" bash from /docker/paperclip. /app is not a bind mount — anything written inside the container dies with --force-recreate.HostConfig.Init is NOT the way to check for a reaper here — read /proc/1/cmdline. docker inspect -f '{{.HostConfig.Init}}' paperclip returns <nil>, which looks like "no init", but the image's own entrypoint is /usr/bin/tini -- docker-entrypoint.sh …, so PID 1 is tini and reaping works (0 zombies, verified 2026-09-16). paperclip-bef-paperclip-1 gets the same guarantee by the other route: init: true → PID 1 is /sbin/docker-init. Conclusion: both instances are covered, adding init: true to prod is pointless. An audit that stops at HostConfig.Init reports a false gap — this exact mistake was made and corrected on 2026-09-16. Independently: neither reaper clears a zombie whose parent is still alive (that's the app failing to wait() on its own children — docker-init/tini only reap processes re-parented onto PID 1); the 2 stable zombies on bef are that second class and are harmless.paperclipai binary here (command -v paperclipai → nothing, /app/cli/dist absent, esbuild not in the store) but it does not need building: tsx is already in /app/cli/node_modules/.bin, so run it from source — cd /app/cli && ./node_modules/.bin/tsx src/index.ts <cmd>. Version 0.3.1.connect --persona board --token-name <label> is interactive; run it in the user's visible pane. Afterwards the profile alone is enough for later commands inside that same container shell — the one that docker compose exec opened, not the host shell — so no export PAPERCLIP_API_KEY, no env file, no token in argv. Not verified to survive a new docker compose exec, and the other container's profile explicitly does not (see the CLI section above): assume you re-connect in each new container shell. The token is printed in the pane though, so it lands in the tmux scrollback and the cockpit audit log: use a throwaway label and revoke when done.project-workspace list|update <projectId> [workspaceId], workspace list|get|update <id>, issue recovery-actions <issueId>, issue recovery:resolve <issueId> --outcome restored --source-issue-status todo, issue heartbeat-context <issueId> (resolves the workspace without running the adapter — the way to prove a workspace fix before triggering real agent work).workspace_validation_failed — read dist, not src/app/server/src is older than /app/server/dist (src 2026-08-18, dist 2026-08-30). The server runs dist. Always confirm a guard's behaviour in dist/services/*.js before reasoning about it.heartbeat.js defines its OWN isGitCheckout using git rev-parse --show-toplevel, unlike workspace-runtime.js which uses --git-dir. Consequence: a repo with core.bare = true passes the workspace-runtime check but fails the heartbeat guard with git_worktree_base_not_git_checkout — even though .git is right there. Reproduce with git -C <repo> rev-parse --show-toplevel (rc=128 "must be run in a work tree").core.bare (0 hits across src and dist), so bare = true on a project checkout is always external damage. Healthy checkouts (e.g. the markify project) are bare = false. Fix: git -C <repo> config core.bare false, then chown node:node <repo>/.git/config — git rewrites the file atomically, so doing it as root leaves it root-owned and the server (user node) can no longer write branch entries there.cwd: null and Paperclip materializes at projects/<companyId>/<projectId>/<repo-name> — the directory name comes from the repo name, not the workspace name. A hand-set cwd pointing at a missing path makes resolution fall back to the assignee agent's home (workspaces/<agentId>/ with just life/ + memory/) while still reporting resolvedWorkspaceSource: project_primary — misleading, check the path before trusting the source field. The company wizard creates exactly this: a local_path workspace whose cwd (companies/<Name>/projects/<Name>) is never created, and every run of the company then fails fallback_agent_home_cwd (hit 2026-09-24 on OpenCodeMobile, OPE-*). Each failed run also persists an execution workspace whose cwd IS the agent home, so creating the directory alone does not unblock the already-blocked issues — repoint them (bullet below). With an isolated_workspace project policy the directory must also be a git checkout with ≥1 commit (git_worktree_base_not_git_checkout otherwise); no signing key exists in the container, so that root commit is unsigned. Read-only DB access: embedded Postgres 127.0.0.1:54329 user/db paperclip, via /app/node_modules/.pnpm/pg@*/node_modules/pg + SET default_transaction_read_only = on.executionWorkspacePreference: reuse_existing) keeps its own stale cwd/providerRef; repoint it with workspace update <id> --payload-json '{"cwd":"<abs-path>","providerRef":"<provider-ref>"}' when the project workspace moves, otherwise the run restores the old path.Never assume the agent doctrine files sit at the agent dir root; check where AGENTS.md actually is before writing next to it.
companies/<Company>/agents/<name>/AGENTS.md, with HEARTBEAT.md, SOUL.md, TOOLS.md, MEMORY.md, plus life/, memory/, skills/ alongside.instructions/, and AGENTS.md/HEARTBEAT.md/SOUL.md/TOOLS.md all live inside it.default): docker exec paperclip find /app/data/instances -type f -path '*/companies/*/agents/*' -name AGENTS.md.<agent>/instructions/ wipes the doctrine of the 15 nested agents. Guard on content, not on the name: [ -f "$d/AGENTS.md" ] || rm -rf "$d".instructions/ directory (git grep over *.ts is empty) — it is a pure convention of the patch, so its contents are only ever reached via the pointer written into AGENTS.md./docker/paperclip git repo — shared between qveys and root (fixed 2026-09-11)A git run as root (rebase traces: ORIG_HEAD, REBASE_HEAD) had left 3806 of 7127 tracked files and 817 .git entries root:root, including .git/HEAD — git commit as qveys died on insufficient permission for adding an object to repository database .git/objects. qveys is not a sudoer on vps-openclaw (sudo prompts for a password).
chgrp -R claude-shared, chmod -R g+w, chmod g+s on every directory, plus git config core.sharedRepository group. The claude-shared group (gid 1001) already contains exactly qveys,root.claude-shared, so the drift does not come back. Without core.sharedRepository=group, git re-creates its own objects non-group-writable and breaks the sharing again at the next commit.id in the pane before committing. During that repair the pane was left as root; committing there would have recreated root-owned objects and signed with root's config instead of ~/.ssh/id_ed25519_signing. Host-local signing key, never 1Password, on this box.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/paperclip-vps:paperclip-vpsfrom paperclip-vps
npx claudepluginhub qveys/agent-skills --plugin paperclip-vps