PR #219 added global→instance fallback for read methods but missed
resolve(), getAvailable(), and uninstall(). Also removed `as any`
cast on filePath (already readonly).
- resolve(): fall through to globalStore so agents can actually spawn
- getAvailable(): use merged installed entries for consistent listing
- uninstall(): distinguish local, global-only, and missing agents
- Constructor: use this.store.filePath directly instead of as any cast
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Walk up directory tree to find nearest parent .openacp/ when no
instance found in exact CWD. Shows as priority option with
"detected" label. Non-TTY and first-run also prefer parent over
global fallback.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AgentCatalog now loads both instance-local and global (~/.openacp/)
agent stores. Lookups check instance first, then fall back to global.
This ensures all globally installed agents are available in every
workspace instance without copying files.
Changes:
- AgentStore.filePath made readonly (was private) for path comparison
- AgentCatalog constructor detects if instance != global, loads both
- getInstalled/getInstalledEntries merge global into instance (instance wins)
- getInstalledAgent falls through: instance → global
- Removed hardcoded fallback from core.ts (no longer needed)
Walk up directory tree from agent CWD to find the closest running
.openacp/ instance instead of always targeting global ~/.openacp.
Skips dead instances, falls back to global if no local found.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- resolveInstanceRoot() already exists in instance-context.ts (sync)
- Add new async resolveRunningInstance() instead of replacing
- Reuse checkHealth() from instance-discovery.ts
- Reuse findPackageRoot() walk-up pattern from agent-instance.ts
- Note that adopt.ts is the only CLI command missing instanceRoot
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When multiple instances run on the same machine, handoff should
route to the nearest running instance by walking up the directory
tree from the agent's CWD, instead of always targeting global.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Step 3: return resolved full path for non-node commands found via `which`
(previously fell through silently)
- Step 4: search multiple locations for npx/uvx — process.execPath dir,
its realpath, /opt/homebrew/bin, /usr/local/bin
- Add logging for fallback resolution to aid debugging
Fixes spawn ENOENT when daemon's PATH doesn't include npx directory.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When openacp is installed globally (e.g. via Homebrew or nvm), npx lives
next to the same node binary executing the process. The user's shell PATH
may not include that directory in non-interactive shells, so resolve it
explicitly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Promise.allSettled() instead of sequential for...of loop in restore(),
so all user tunnels start concurrently rather than waiting for each one
to fully connect before starting the next.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- shutdown() now passes preserveState=true to providers, saves tunnels.json
before clearing entries, and guards against double-shutdown
- flush() becomes a no-op after shutdown to prevent overwriting preserved state
- restore() omits sessionId since sessions don't survive restart
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Agents like claude-acp and codex-acp wrap external CLIs (claude, codex)
and have an npx/binary distribution in the registry. Previously, missing
external CLIs caused available: false, hiding the Install button entirely
— even though the agent package itself CAN be installed independently.
agent-catalog: for uninstalled agents, available = dist !== null
Availability now means 'has a distribution to install', not 'all deps
met'. Missing deps are still surfaced via missingDeps for the UI.
agent-installer: remove hard dep-check block before installation
Installation proceeds even when external CLIs are absent. The required
setup steps (e.g. 'npm install -g @anthropic-ai/claude-code') are
returned in the result so callers can guide the user post-install.
The uvx runtime check is kept as it is a true hard requirement.
Display the resolved path from 'command -v node' alongside the version
so users and logs immediately show which node is active (e.g. nvm vs
system). Also bump installer version to 1.0.3.
Two related bugs caused npm install -g to fail with EACCES on machines
where both system node and nvm-managed node are installed:
1. ensure_default_node_active_shell returned early when system node met
the minimum version requirement, never sourcing nvm. This caused the
installer to use system npm (prefix /usr/local, root-owned) instead
of nvm's npm which has a user-writable prefix.
2. fix_npm_permissions checked -w $prefix/lib which can be writable on
Intel Macs with Homebrew (/usr/local/lib is user-owned) while
/usr/local/lib/node_modules remains root-owned from a prior pkg
install. The check now targets node_modules specifically.
fix_npm_permissions was only called in the npm install branch, but the
git install path also runs `npm install -g pnpm` as a fallback when
corepack is unavailable. On macOS with Homebrew/system Node, this would
fail with EACCES for the same reason as the main npm install.
Move fix_npm_permissions to run unconditionally before the install
method branch so both paths benefit from the permission fix.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix_npm_permissions() was guarded with `[[ "$OS" != "linux" ]]`, so it
was a no-op on macOS. Users with Node installed via Homebrew or a system
installer have /usr/local/lib/node_modules owned by root, causing EACCES
on `npm install -g`. Remove the OS guard so the function reconfigures npm
to use ~/.npm-global on any platform where the prefix is not writable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without selective, Telegram automatically opens the reply compose box
in private chats when bot sends a force_reply message.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the install script runs in a non-login shell (e.g. launched from
a GUI app), PATH-based node managers like nvm are not initialized.
Call ensure_default_node_active_shell before check_node so that an
already-installed node is discovered without triggering a redundant
install_node call.
API-sourced prompts (from the App) were bypassing MESSAGE_QUEUED and
MESSAGE_PROCESSING emission, so only the sending App window showed the
user message. Other connected windows only saw the AI response.
- routes/sessions.ts: generate turnId, emit MESSAGE_QUEUED before
enqueuePrompt, return turnId in response body
- session-bridge.ts: remove 'api' exclusion from MESSAGE_PROCESSING
so all connected SSE clients receive the streaming stub event