Skip to content

fix(ops): the daily scan checks every container value came from its own docker.env - #177

Merged
cryptolir merged 4 commits into
mainfrom
fix/diagnostic-env-source
Sep 30, 2026
Merged

cryptolir merged 4 commits into
mainfrom
fix/diagnostic-env-source

Conversation

@cryptolir

Copy link
Copy Markdown
Owner

Summary

Fork half of the dashboard plan docs/plans/active/agent-keys-own-file-only.md (cryptolir/openclaw-dashboard#671, §2.3, HK3).

Compose fills ${NAME} from the shell that runs it before --env-file. A recreate from a shell with exported keys hands an agent a key it was never given (a Ceyo agent held 18 on 2026-09-09).

  • D4, a new block in agents_server_diagnostic.sh. For every gateway container, openclaw or hermes, in any state: Compose renders the agent's own docker.env with an empty environment, and every non-empty value in the container must equal the render. A difference is a P1 with the key names. Values are compared in memory; names only are printed. It prints how many containers it compared, and a container it cannot compare is its own finding.
  • The hand-run fix lines use env -i.
  • D3 accepts ANTHROPIC_API_KEY (in the dashboard's Core API list since feat(agent): auto-enable GLM-4.7 thinking mode openclaw/openclaw#443) without requiring it.
  • provision-agent.sh reads its four Core APIs from the Global Host, not from the first sibling agent's file, which may hold that agent's own key.

Tests

  • scripts/ops/test_env_source_check.py (new, 8 tests, runs in workflow-sanity): cuts the block's code out of the script and runs it against a stubbed docker. Seven mutations of the block each fail it.
  • Live, read-only, the D4 block alone on all three hosts: dev 8 of 8, eu 16 of 16, us 15 of 15 containers compared, no finding.
  • Live, DevAgents, a throwaway container with fake values: made the old way from a shell exporting GMAIL_APP_PASSWORD, the container holds it and D4 names it; made with env -i, it does not.
  • provision-agent.sh: the remote script rendered with ssh stubbed passes bash -n; its key-reading lines run on fixtures take the host's values, not the sibling's.

Review: internal only (owner's standing rule). Two plan reviewers and one code reviewer; findings folded.

🤖 Generated with Claude Code

Liran Peretz and others added 3 commits September 30, 2026 15:21
…wn docker.env

Compose fills ${NAME} from the shell that runs it before --env-file, so a
recreate from a shell with exported keys hands an agent a key it was never
given (dashboard plan agent-keys-own-file-only, HK3).

- D4: for every gateway container, openclaw or hermes, in any state, Compose
  renders the agent's own docker.env with an empty environment and every
  non-empty container value must equal the render. P1 if the file is not newer
  than the container, P2 'restart pending' if it is. Names only. It prints how
  many containers it compared.
- The hand-run fix lines use env -i.
- D3 accepts ANTHROPIC_API_KEY (in GLOBAL_KEYS since dashboard openclaw#443) without
  requiring it.
- provision-agent.sh reads its four Core APIs from the Global Host, not from
  a sibling agent's file, which may hold that agent's own key.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
One finding per container that cannot be compared, never a crash for the whole
host; a docker that does not answer is not a pass; only non-empty container
values are compared (a line added to the Compose file after a container was
made is not the agent losing a key); no file-date rule, which filed a real
leak as 'restart pending' whenever provisioning touched the file after the
recreate. The test runs in workflow-sanity. provision-agent.sh stops if the
Global Host file is missing.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@cryptolir
cryptolir force-pushed the fix/diagnostic-env-source branch from a8f66a0 to 0547800 Compare September 30, 2026 15:21
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@cryptolir
cryptolir merged commit 0d20e51 into main Sep 30, 2026
20 of 25 checks passed
cryptolir added a commit that referenced this pull request Sep 30, 2026
Co-authored-by: Liran Peretz <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant