Skip to content

Public user fixes: setup.sh, hardcoded names, duplicate tabs, keychain - #831

Merged
joelteply merged 3 commits into
mainfrom
fix/duplicate-tabs
Apr 6, 2026
Merged

joelteply merged 3 commits into
mainfrom
fix/duplicate-tabs

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

NOT MERGING UNTIL TESTED E2E

Fixes for public users who are not us:

  1. setup.sh: removed dead Electron code, uses Swift tray build
  2. setup.sh: auto-builds locally when pre-built images unavailable (arm64 Mac)
  3. setup.sh: docker logout before pull (prevents Keychain flood on macOS)
  4. setup.sh: creates ~/.continuum before Docker mount
  5. continuum CLI: removed hardcoded joel@ — uses $(whoami)
  6. Added .env.example template
  7. Duplicate tabs: deduplicate on initialize/update (Duplicate tabs — same room opens multiple tab entries #795)

Closes #795, #830

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
Copilot AI review requested due to automatic review settings April 6, 2026 19:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.sh to 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 continuum CLI use the current username (or an override env var) instead of a hardcoded account, and add a .env.example template.

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.

Comment on lines +60 to +67
// 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);

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
// 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;
}

Copilot uses AI. Check for mistakes.
Comment thread setup.sh
Comment on lines +103 to +107
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..."

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment thread setup.sh
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

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
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.
@joelteply
joelteply merged commit d43b7b5 into main Apr 6, 2026
4 checks passed
@joelteply
joelteply deleted the fix/duplicate-tabs branch April 6, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate tabs — same room opens multiple tab entries

2 participants