Repository navigation
Public user fixes: setup.sh, hardcoded names, duplicate tabs, keychain - #831
Conversation
1. setup.sh: removed dead Electron tray code, uses Swift build 2. setup.sh: auto-builds locally when pre-built images unavailable (arm64) 3. setup.sh: docker logout before pull (prevents Keychain flood) 4. setup.sh: creates ~/.continuum before Docker mount 5. continuum CLI: removed hardcoded joel@ — uses $(whoami) 6. Added .env.example template for grid config
Server can send duplicate items from stale persisted state. initialize() and update() now deduplicate input using contentItemsMatch() — same rules as addItem(). Fixes #795
There was a problem hiding this comment.
Pull request overview
This PR targets first-run and cross-platform usability issues for public users by improving setup behavior, removing hardcoded SSH usernames, and preventing duplicate tab entries from being restored or propagated.
Changes:
- Deduplicate incoming content/tab state during initialization and updates to prevent duplicate tabs (#795).
- Update
setup.shto create required directories early, install the Swift tray binary on macOS, avoid GHCR credential prompts, and fall back to local builds when pulls fail (#830). - Make SSH operations in the
continuumCLI use the current username (or an override env var) instead of a hardcoded account, and add a.env.exampletemplate.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/system/state/ContentStateService.ts | Adds deduplication of incoming openItems during initialize/update to prevent duplicate tabs. |
| setup.sh | Improves macOS tray install path, prevents GHCR keychain prompts, ensures ~/.continuum exists early, and adds pull→build fallback logic. |
| bin/continuum | Replaces hardcoded SSH username with ${CONTINUUM_SSH_USER:-$(whoami)} in several SSH paths. |
| .env.example | Adds a starter template for common environment variables (grid + GPU). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Guard: Skip if already initialized with same data | ||
| if (this.initialized && !this.hasStateChanged(openItems, currentItemId)) { | ||
| return; | ||
| } | ||
|
|
||
| // Deduplicate input — server may send duplicates from stale persisted state | ||
| const deduped = this.deduplicateItems(openItems); | ||
|
|
There was a problem hiding this comment.
In initialize(), the guard checks hasStateChanged() against the raw openItems before deduplication. If the service is already initialized with a deduped state, a subsequent initialize() call that only differs by duplicate entries will be treated as “changed” (length mismatch) and will reinitialize + notify unnecessarily. Deduplicate before calling hasStateChanged() (or have hasStateChanged() compare against a deduped view) so duplicates alone don’t defeat the guard.
| // Guard: Skip if already initialized with same data | |
| if (this.initialized && !this.hasStateChanged(openItems, currentItemId)) { | |
| return; | |
| } | |
| // Deduplicate input — server may send duplicates from stale persisted state | |
| const deduped = this.deduplicateItems(openItems); | |
| // Deduplicate input — server may send duplicates from stale persisted state | |
| const deduped = this.deduplicateItems(openItems); | |
| // Guard: Skip if already initialized with same data | |
| if (this.initialized && !this.hasStateChanged(deduped, currentItemId)) { | |
| return; | |
| } |
| if docker compose pull 2>&1 | tee /tmp/continuum-pull.log | grep -q "Pulled"; then | ||
| echo "✅ Images pulled from registry" | ||
| else | ||
| # Pull failed (arch mismatch, network, etc.) — build locally | ||
| echo "⚠️ Pre-built images not available for this platform. Building locally..." |
There was a problem hiding this comment.
The success condition for docker compose pull is currently grep -q "Pulled". A successful pull where images are already present/up-to-date often won’t print “Pulled”, which will incorrectly trigger the local build path. Consider keying this on the pull command’s exit code (and optionally handling the “no matching manifest” case explicitly) rather than matching output text.
| if docker compose pull 2>&1 | tee /tmp/continuum-pull.log | grep -q "Pulled"; then | |
| echo "✅ Images pulled from registry" | |
| else | |
| # Pull failed (arch mismatch, network, etc.) — build locally | |
| echo "⚠️ Pre-built images not available for this platform. Building locally..." | |
| docker compose pull 2>&1 | tee /tmp/continuum-pull.log | |
| pull_status=${PIPESTATUS[0]} | |
| if [[ $pull_status -eq 0 ]]; then | |
| echo "✅ Images pulled from registry" | |
| else | |
| # Pull failed (arch mismatch, no matching manifest, network, etc.) — build locally | |
| if grep -qi "no matching manifest" /tmp/continuum-pull.log; then | |
| echo "⚠️ Pre-built images are not available for this platform. Building locally..." | |
| else | |
| echo "⚠️ Failed to pull pre-built images. Building locally..." | |
| fi |
| echo "⚠️ Pre-built images not available for this platform. Building locally..." | ||
| echo " (This takes 15-20 minutes the first time. Subsequent starts are instant.)" | ||
| echo "" | ||
| docker compose build --parallel 2>&1 | tail -5 |
There was a problem hiding this comment.
docker compose build --parallel 2>&1 | tail -5 masks the build command’s exit status (the pipeline returns tail’s status). With set -e but no pipefail, a failed build can still fall through to “✅ Images built locally”, leading to confusing downstream failures. Avoid piping the build output (or enable pipefail / preserve the build exit code) so setup stops on build errors.
| docker compose build --parallel 2>&1 | tail -5 | |
| BUILD_LOG="$(mktemp)" | |
| if ! docker compose build --parallel >"$BUILD_LOG" 2>&1; then | |
| tail -5 "$BUILD_LOG" | |
| rm -f "$BUILD_LOG" | |
| exit 1 | |
| fi | |
| tail -5 "$BUILD_LOG" | |
| rm -f "$BUILD_LOG" |
Root cause: ~/.continuum bind mount as parent directory overrides the tmpfs ipc-sockets volume on Docker Desktop for Mac (especially with external drive symlinks). Unix sockets get ENOTSUP. Fix: - ipc-sockets volume uses tmpfs (in-VM RAM, no host filesystem) - Containers mount only specific files they need: - config.env for API keys (core + node-server + widget-server) - grid/ for Tailscale status (core) - sockets/ via tmpfs (core + bridge + node-server) - No more parent ~/.continuum bind mount overriding child volumes Tested: all services healthy, 10 API keys loaded, 13 personas activated.
NOT MERGING UNTIL TESTED E2E
Fixes for public users who are not us:
Closes #795, #830