Skip to content

P1d: ship the claude-code-bridge runtime (cloud-mirror) to brew devices#81

Merged
Agent-Aurelius merged 2 commits into
mainfrom
feat/ship-cloud-mirror-bridge
Jun 22, 2026
Merged

P1d: ship the claude-code-bridge runtime (cloud-mirror) to brew devices#81
Agent-Aurelius merged 2 commits into
mainfrom
feat/ship-cloud-mirror-bridge

Conversation

@LightDriverCS

Copy link
Copy Markdown

P1d · ship the claude-code-bridge runtime to brew devices

The enclave per-tenant memory architecture needs the cloud-mirror daemon on the customer's Mac: it federates the device's local vault into instances/{instanceId}/wikiEntries (write lane) and serve.mjs serves the tenant's own canon (recall read lane). The daemon already exists here, is instanceId-aware, and has a LaunchAgent template + README — but it never shipped to a brew install.

Root cause

The homebrew formula builds from source then npm packs, so only the files allowlist ships (dist/ + a few source dirs). extensions/claude-code-bridge/ is a plain .mjs runtime asset dir (no package.json, no build step → never emitted to dist/), so it was in neither. A brew device had the enrollment but no daemon.

Fix (one line)

Add extensions/claude-code-bridge/ to the published files.

Proof — npm pack --dry-run --ignore-scripts now includes

extensions/claude-code-bridge/cloud-mirror.mjs              14.4kB
extensions/claude-code-bridge/serve.mjs                     27.8kB
extensions/claude-code-bridge/mirror.mjs                    10.3kB
extensions/claude-code-bridge/ai.openclaw.wiki-mirror.plist.template
extensions/claude-code-bridge/{statusline.mjs,README.md}

Pairs with mono openclaw#2282

The enroll bootstrap resolves the bridge under the openclaw package root, probing both extensions/ (this fix) and dist/extensions/ layouts — so the daemon lands exactly where the device looks.

Deploy (operator)

After merge: tag v2026.6.8-bench.3 → bump homebrew-tap/Formula/openclaw.rb (url/sha/version) → customers brew upgrade benchagi/tap/openclaw. Tracked in the go-live runbook.

🤖 Generated with Claude Code

…loud-mirror

The customer harness install (homebrew-tap builds from source -> npm pack) shipped
only dist/, but claude-code-bridge is a plain runtime asset dir (no build step) --
so cloud-mirror.mjs, serve.mjs, mirror.mjs + the wiki-mirror LaunchAgent template
never reached a brew-installed openclaw.

Add extensions/claude-code-bridge/ to the published files so npm pack includes the
bridge. Verified via npm pack --dry-run: cloud-mirror.mjs (14.4kB), serve.mjs
(27.8kB), mirror.mjs (10.3kB), ai.openclaw.wiki-mirror.plist.template now ship.

Also corrects the plist template's stale __INGEST_KEY__ comment (was 'super-admin
API key' -> the device's tenant-scoped wiki:mirror key; writes ONLY this instance's
shard) and notes the enroll bootstrap automates the install.

Pairs with mono openclaw#2282 (enroll bootstrap enables the LaunchAgent).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Agent-Aurelius
Agent-Aurelius force-pushed the feat/ship-cloud-mirror-bridge branch from 9f7ed20 to eaf0cc9 Compare June 22, 2026 17:44
@Agent-Aurelius
Agent-Aurelius marked this pull request as ready for review June 22, 2026 18:12

@Agent-Aurelius Agent-Aurelius left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anvil auto-approval — verdict READY, non-code-owned. Approved under the dedicated Anvil reviewer identity.

@Agent-Aurelius
Agent-Aurelius merged commit 800d124 into main Jun 22, 2026
161 of 162 checks passed
@Agent-Aurelius
Agent-Aurelius deleted the feat/ship-cloud-mirror-bridge branch June 22, 2026 18:45
Agent-Aurelius added a commit that referenced this pull request Jun 23, 2026
…82)

These power the Aurelius web console under ultracode but were running ONLY as
uncommitted floating patches on the live detached gateway worktree (backed up at
origin/backup/gateway-patches-2026-06-22), NOT on main:
- C1: salvage clean assistant text from leaked raw Claude-CLI stream-json
  (salvageClaudeStreamJsonText in agent-event-assistant-text.ts, applied in
  writeAssistantContentChunk).
- C3: bridge a native AskUserQuestion into the console's openclaw_ask_choice card
  (buildAskChoiceFromArgs + request-scope blob buffering in the
  /v1/chat/completions handler) + extractAskUserQuestionFromClaudeStreamJson.

Merged onto current main (#81); #79's read-only-tools enforcement is preserved
(additive, different code paths). agent-event-assistant-text.ts + cli-runner/
execute.ts were untouched by main so taken whole; openai-http.ts merged
(import superset + salvage in writeAssistantContentChunk + the ask_choice bridge).

Companion to the gateway durability reconcile: once merged, both live gateways
rebuild from this main commit and stop running uncommitted detached patches.

Co-authored-by: Aurelius <[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.

2 participants