|
13 | 13 | - Minimal markdown markers, no unnecessary formatting, minimal emojis. |
14 | 14 | - Reference issue numbers in the format `#<issue-number>` for easy linking. |
15 | 15 |
|
16 | | -# [2026-07-21] Dev Log: traced launches die silently in freshly built images #414 |
17 | | -- Why: after rebuilding images, every `--trace` launch died with "failed to launch ephemeral container" and no error. |
| 16 | +# [2026-07-21] Dev Log: cloak always-on browser + VNC + persistent profile #456 |
| 17 | +- Why: three asks for auth sites in the cloak browser — (1) VNC auto-secured with a password, (2) an always-on browser the agent can drive freely, (3) mount what preserves the whole session to the host. Verified the load-bearing assumption first in a throwaway cloak container: a persistent CloakBrowser launched with `--remote-debugging-port` exposes a CDP endpoint a SEPARATE Playwright client reaches via connectOverCDP, drives, and the browser survives that client disconnecting. So one daemon can back both the human (VNC) and the agent (CDP). |
18 | 18 | - What: |
19 | | - - The #414 flock rework ended the CA-install subshell on `[ "$VERBOSE" = "true" ] && echo ...`; with VERBOSE unset the failed test became the subshell's exit status, and under `set -e` the entrypoint died right after the agent banner — silently, only in freshly built images (the entrypoint is baked). Fix: explicit `exit 0` before the subshell closes. Verified A/B: baked image dies, overlay-fixed image runs `deva.sh claude --trace --rm -Q -- --version` end-to-end (cctrace MITM up, trace file written). Rebuild images to pick this up. |
20 | | -- Result: traced launch verified live against the host daemon. |
| 19 | + - scripts/cloak-browserd.mjs: daemon holding launchPersistentContext (headed :99, userDataDir, `--remote-debugging-port=9222 --remote-debugging-address=127.0.0.1`), relaunch-on-close, SIGTERM-clean. Absolute import of cloakbrowser (lives outside $CLOAK_APP_DIR). Verified end-to-end (daemon up → agent connectOverCDP drives it → persists after disconnect). |
| 20 | + - docker-entrypoint.sh maybe_start_cloak_browser: starts the daemon AFTER setup_nonroot_user (post UID/GID remap) so the mounted profile is written as the host UID — starting it in cloak-entrypoint (pre-remap) would leave 1001-owned files the agent can't touch. Idempotent under flock + a CDP-port probe: boot (`tail -f /dev/null`) starts it once under PID 1's tree, later agent execs find it up and skip. Verified branch logic with mocks (gate off, port-up skip, start path). |
| 21 | + - deva.sh: `--cloak-browser`/`DEVA_CLOAK_BROWSER` (env + CDP endpoint + auto-mount `~/.config/deva/cloak-profile`→`/home/deva/.cloak-profile`, first-writer-wins). `--cloak-vnc` implies it (blank display otherwise). setup_cloak_runtime = one image guard + one warning + correct order. VNC auto-password: generated when unset, printed once in the announce; the var name contains PASSWORD so deva's existing redaction masks it in --debug. announce_cloak_browser prints the CDP endpoint + host profile path. |
| 22 | + - Bug caught in test: the VNC password gen `tr -dc ... </dev/urandom | head -c8` took SIGPIPE under `set -o pipefail` (head closes the pipe) → killed the whole launch. Fixed to read a finite `head -c 128 /dev/urandom` chunk then filter+cut. This is the [[feedback_bash_set_u_arrays]] family of set-flag footguns. |
| 23 | + - Makefile test-cloak: assert x11vnc + `node --check` the daemon. Skill rewritten: always-on browser (agent uses connectOverCDP, NOT its own launch()), VNC login flow, exactly which dir to mount (userDataDir = whole session) and which NOT (/opt/cloakbrowser = baked binary). |
| 24 | +- Result: full dry-run matrix green (vnc implies browser+profile+port+auto-pass; browser-only no port; off-profile warns; explicit password respected). NOT verified here: x11vnc serving RFB and a live daemon inside the built image — this env's network 502s the apt mirrors so I can't rebuild/apt-install. `make build-cloak && make test-cloak` on the host confirms; the CDP daemon itself is proven against the existing image. |
| 25 | + |
| 26 | +# [2026-07-21] Dev Log: cloak VNC for authenticated sites #456 (initial VNC cut; extended by the always-on-browser entry above) |
| 27 | +- Why: cloak agents need to reach sites behind a login. You can't mount the host's Chrome cookies — macOS encrypts cookie values with a Keychain key the Linux container can't reach, so the DB is undecryptable inside deva. And the interactive part of a login (MFA, captcha) needs a human at a real display, which headed-on-Xvfb doesn't offer. Verified the two load paths in the live container first: `launchContext({contextOptions:{storageState}})` loads (top-level `storageState` is silently dropped — a footgun, documented), and `launchPersistentContext({userDataDir})` persists cookies-with-expiry across reopens (session cookies are memory-only). |
| 28 | +- What: opt-in VNC into the cloak Xvfb display so a human logs in once, then a mounted profile carries the session to later headless runs. |
| 29 | + - Dockerfile.cloak: +x11vnc in the apt layer. |
| 30 | + - cloak-entrypoint.sh: when DEVA_CLOAK_VNC=1, start `x11vnc -display :99 -rfbport 5900 -forever -shared -bg`. Binds 0.0.0.0 in-container ON PURPOSE — the boundary is deva publishing to host loopback only; -localhost would make docker's port-proxy unreachable. DEVA_CLOAK_VNC_PASSWORD → -rfbauth, else -nopw with a loud warning. |
| 31 | + - deva.sh: `--cloak-vnc` flag (+ DEVA_CLOAK_VNC env), setup_cloak_vnc probes a free host port from 5900 and publishes `-p 127.0.0.1:PORT:5900` + passes the env in; guarded to the cloak image; announce_cloak_vnc prints the URL and warns when attaching to a warm container that was created without the port (reachability is fixed at create, same constraint as the trace UI). |
| 32 | +- Result: dry-run matrix verified (port+env only with -p cloak + vnc; off-profile warns; free-port probe skips a busy 5900→5901). Entrypoint VNC block branch/args verified via a mocked x11vnc (-nopw vs -storepasswd/-rfbauth). NOT verified here: x11vnc actually serving RFB — this env's network 502s the apt mirrors so x11vnc can't be installed/rebuilt in-container; confirm on the host rebuild (`make build-cloak`). |
| 33 | + |
| 34 | +# [2026-07-21] Dev Log: traced launches dead + -p cloak no-op — two field breakages |
| 35 | +- Why: after rebuilding images, every `--trace` launch died with "failed to launch ephemeral container" and no error; and `-p cloak` (and even env `DEVA_DOCKER_TAG=cloak`) kept launching the rust image when `~/.config/deva/.deva` pinned `DEVA_DOCKER_TAG=rust`. |
| 36 | +- What: |
| 37 | + - Trace: the #414 flock rework ended the CA-install subshell on `[ "$VERBOSE" = "true" ] && echo ...`; with VERBOSE unset the failed test became the subshell's exit status, and under `set -e` the entrypoint died right after the agent banner — silently, only in freshly built images (the entrypoint is baked). Fix: explicit `exit 0` before the subshell closes. Verified A/B: baked image dies, overlay-fixed image runs `deva.sh claude --trace --rm -Q -- --version` end-to-end (cctrace MITM up, trace file written). Rebuild images to pick this up. |
| 38 | + - Precedence: `apply_config_value` unconditionally clobbered `DEVA_DOCKER_IMAGE/TAG` and set `*_ENV_SET=true`, so config files beat the real environment and `resolve_profile` treated `-p` as already-satisfied. Now `*_SOURCE` (env|config) is tracked: config never overrides env, and an explicit CLI `-p` (new `PROFILE_FROM_CLI`) overrides a config-sourced tag. Contract: environment > config files > `-p` > default. scripts/test-image-precedence.sh pins all four cases and runs in CI; it `env -u`s the deva container's own `DEVA_DOCKER_TAG` so the harness env can't fake results — which is exactly how the bug hid in earlier dry-run smokes. |
| 39 | +- Result: both repro commands (`deva -p cloak`, `DEVA_DOCKER_TAG=cloak deva -p cloak claude` with a rust-pinned config) now resolve `:cloak`; traced launch verified live against the host daemon. |
| 40 | + |
| 41 | +# [2026-07-20] Dev Log: cloak profile — CloakBrowser stealth Chromium image #456 |
| 42 | +- Why: agents in the sandbox need a browser that passes bot detection (Cloudflare, FingerprintJS, reCAPTCHA scoring); plain Playwright headless in the rust image fails those checks. CloakBrowser is a source-patched Chromium with the same Playwright API — run it headed on a virtual display inside the container. |
| 43 | +- What: |
| 44 | + - Dockerfile.cloak extends :rust: apt layer (xvfb/openbox/xdotool + anti-bot font packages), wrapper+playwright-core installed into CLOAK_APP_DIR=/opt/cloak (not global — bare ESM specifiers don't resolve from a global install), `cloakbrowser install` bakes the Chromium binary at build time with auto-update off (hermetic; the free v146 binary stays on GitHub Releases forever). Kept tini as PID 1 and restated `CMD ["claude"]` — redeclaring ENTRYPOINT resets the inherited CMD. |
| 45 | + - cloak-entrypoint.sh: clean stale X locks, Xvfb :99 (1920x1080x24), poll display-ready via xdotool (bounded ~10s), openbox for --start-maximized, then exec docker-entrypoint.sh. |
| 46 | + - deva.sh: `-p cloak` profile, ghcr tag `cloak`, local-tag fallback cloak > rust > latest; skills/deva-cloak documents agent-side usage (DEVA_CLOAK=1 marker, run from $CLOAK_APP_DIR). |
| 47 | + - Version pin CLOAKBROWSER_WRAPPER_VERSION (wrapper hardcodes per-arch Chromium versions, so it pins Chromium too) wired through versions.env, Makefile (+VERSION_QUERY_OVERRIDES), version-pins.sh VERSION_PIN_VARS, update-version-pins.sh heredoc+refresh — the first draft omitted the heredoc entry, so `make versions-pin` would have silently deleted the pin. |
| 48 | + - CI: paths-filtered cloak-image.yml builds on ghcr :rust and runs make test-cloak; release pushes :cloak and :vX.Y.Z-cloak (BASE_IMAGE = the release's -rust tag). Nightly skips cloak: that layer has no agent CLIs, and the ~200MB Chromium bake would double nightly cost for nothing. |
| 49 | +- Result: cloak rides feat/kimi-agent (#455) — bundling two features on one branch violates our one-branch-per-issue rule; noted for the PR split. Build verified via docker on the host socket; test-cloak asserts cloakbrowser info + display geometry. |
21 | 50 |
|
22 | 51 | # [2026-07-20] Dev Log: add kimi agent (Moonshot Kimi Code CLI) #455 |
23 | 52 | - Why: Moonshot shipped an official coding-agent CLI (@moonshot-ai/kimi-code, bin `kimi`); deva should launch it like claude/codex/gemini/grok. Traced the grok integration (commit 93a59e0) via ccx as the template. |
|
0 commit comments