- Added a new test to verify that allowedPaths can override ignore patterns for paths within the current working directory, ensuring proper access control for file uploads.
- Updated the path-guard logic to clarify that allowedPaths take precedence over ignore patterns.
- Simplified the plugin configuration logic for the Telegram channel by removing unnecessary mapping, directly importing the plugin when the channelId matches.
- Added console log for stopping the daemon to enhance user feedback.
- Updated ConfigManager initialization to load from the specified config file.
- Refined the logic for determining the run mode, ensuring correct behavior when restarting a daemon based on its previous state.
After the plugin system migration, channel configuration (botToken, chatId,
etc.) is stored in SettingsManager (~/.openacp/plugins/data/) rather than
in config.channels. Several UI and diagnostic code paths still read from
the old location, causing channels to always appear as "Not configured"
even after a successful setup.
Fixes#194
Changes:
- getChannelStatuses(): make async, check SettingsManager before config.channels
- configureChannels(): accept settingsManager param, use it for status display
and when invoking plugin configure()
- editChannels(): check SettingsManager for configured/enabled display status
- editDiscord(): fix wrong SettingsManager basePath (plugins → plugins/data)
- summarizeConfig(): make async, check SettingsManager for channel status
- telegramCheck (openacp doctor): read botToken/chatId from plugin settings
first, fall back to legacy config.channels
- config.ts cmdConfig: fix SettingsManager basePath (plugins → plugins/data)
- onboard.ts cmdOnboard: pass settingsManager to runReconfigure()
- runReconfigure(): accept and propagate settingsManager to sub-functions
Tests: add setup-channels, helpers, and telegram-check unit tests covering
the plugin-settings-first read behavior.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix 1 (IMPORTANT): Use jsonError() for error paths in cmdInstancesCreate
when --json flag is active. Missing --dir and already-registered cases
now call jsonError() before the console.error/process.exit path.
Fix 2 (IMPORTANT): Move wantsHelp(args) check to the very top of
cmdInstances() so `openacp instances --help` is handled before the
subcommand dispatch, preventing it from falling through to "Unknown
subcommand" error.
Fix 3 (MINOR): Move fs.mkdirSync(instanceRoot) inside each branch
(--from, --no-interactive, interactive) to avoid leaving an orphaned
empty directory if copyInstance throws or config write fails.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirror the same extended JSON output shape from start.ts into default.ts
for both the daemon start path and the foreground start path.
Output shape: { success: true, data: { pid, instanceId, name, directory, dir, port } }
- Imports isJsonMode, jsonSuccess, jsonError, muteForJson, ErrorCodes
- Daemon path: resolves instanceId from registry, reads api.port file,
falls back to config.api.port, calls jsonSuccess with full payload
- Foreground path: outputs JSON with process.pid before starting server
- Error path: calls jsonError(DAEMON_NOT_RUNNING, ...) in JSON mode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extend the JSON output of `openacp start --json` to include `name`
(from config.instanceName), `directory` (path.dirname of root),
and `port` (from api.port file or config fallback). The `dir` field
is kept for backward compatibility. instanceId is resolved from the
instance registry when available, falling back to path.basename(root).
Add cmdInstances to the noInstanceCommands object so it reads directly
from the global registry without requiring an existing instance root.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement cmdInstancesCreate with support for --dir (required), --from (copy existing instance), --name, --agent, and --no-interactive flags. Handles three cases: .openacp already registered (error), .openacp exists but unregistered (register it), and fresh creation (write minimal config).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements `openacp instances list` command with buildInstanceListEntries
helper that maps the InstanceRegistry to InstanceListEntry objects with
status/port/directory fields. Adds 4 passing unit tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Added `--json` flag descriptions to various CLI commands in the help text.
- Updated command usage examples to include `--json` for machine-readable output.
- Clarified that commands supporting `--json` will output results in a consistent JSON format.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New instances created via setup wizard now get a UUID as their ID
instead of a slug derived from the instance name. This guarantees
uniqueness across instances without collision handling.
- wizard.ts: use randomUUID() instead of generateSlug + uniqueId
- default.ts / restart.ts: look up existing registry entry first,
fall back to a fresh UUID for unregistered instances
- cli.ts: replace 'unknown' fallback with randomUUID()
- main.ts: look up registry before falling back to randomUUID()
Existing instances with slug/hardcoded IDs remain fully compatible —
the registry lookup ensures their stored IDs are reused on subsequent
starts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add muteForJson() to version command
- Fix wrong error code in setup.ts (MISSING_ARGUMENT → CONFIG_INVALID)
- Use ErrorCode type in jsonError signature for type safety
- Add process.exit re-throw guards to adopt.ts and remote.ts
- Remove dead return statements after jsonError calls
- Fix any types in doctor.ts
- Update spec for apiPort/tunnelPort naming
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Preserve existing channels and ensure the SSE adapter is enabled during setup.
- Update configuration schema to provide a default for channels.
- Implement desktop app detection for the SSE channel, checking common installation paths across platforms.
- Adjust setup integrations to remove unnecessary config parameter and streamline integration checks.
- Update wizard to include desktop app in channel options and handle installation prompts accordingly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds `openacp setup` command for programmatic configuration by the desktop app, accepting --workspace, --agent, --run-mode, and --json flags.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove case "--json": from switch statement in agents.ts to prevent undocumented behavior like "openacp agents --json gemini" silently misbehaving. The "list" and "undefined" cases are sufficient.
- Update test 2 to use ['list', '--json'] instead of ['--json'] now that the undocumented case is removed.
- Normalize mock pattern to use standard vi.fn().mockImplementation() with class syntax for better maintainability.
- Add afterEach(() => vi.restoreAllMocks()) to ensure proper cleanup between tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Updated the API command output to include the channel ID and thread ID for better session tracking.
- Modified prompt constants to emphasize the necessity of passing `--channel <current_channel>` when creating sessions to avoid headless sessions.
- Enhanced session creation instructions to clarify the importance of specifying the channel to ensure user visibility in Telegram.
- Use closure core variable instead of args.coreAccess in command handlers
- Remove pendingResumes state machine from resume.ts
- Replace silent fallback with delegated in command-registry
- Fix plugin template signatures for registerMenuItem and registerAssistantSection
- Add delegated type to CommandResponse docs in plugin template
- Update test to match silent->delegated change
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add registerMenuItem/unregisterMenuItem and registerAssistantSection/unregisterAssistantSection
to PluginContext API docs in claude-md.ts and plugin-guide.ts templates.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updated argument indexing across multiple CLI command files to ensure the first argument is consistently used for the primary command. This change affects the `adopt`, `agents`, `api`, `config`, `install`, `integrate`, `tunnel`, and `uninstall` commands, improving usability and reducing confusion in command usage.
- Changed argument references from `args[1]` to `args[0]` for primary commands.
- Adjusted subsequent argument references accordingly to maintain correct functionality.
- Updated all references from 'dangerous mode' to 'bypass permissions' in CLI commands, API documentation, and internal logic.
- Adjusted command usage and descriptions to reflect the new terminology for clarity and consistency.
- Removed warmup functionality from session management as part of the refactor.
Args were off-by-one (args[2] instead of args[1]) after refactoring
the CLI dispatch. Also added help text for local directory install.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Updated the ConfigSelectChoice interface to replace 'label' with 'name'.
- Adjusted related code in API commands and tests to reflect this change.
- Ensured consistency across configuration options and improved clarity in the codebase.
Changes include:
- Updated `.gitignore` to include `.openacp` for local workspace secrets.
- Refactored CLI commands to replace "instance" with "workspace" for consistency.
- Enhanced workspace setup and registration logic, including deduplication of entries.
- Improved user prompts and error messages related to workspaces.
- Added functionality to protect local workspace secrets from being tracked by git.
This commit aims to clarify the distinction between workspaces and instances, enhancing user experience and code maintainability.
Add `openacp api session-config` subcommand group to manage ACP session
config options via the REST API: list options, set a value, show
clientOverrides, and toggle bypassPermissions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the deprecated setMode() and setModel() methods from AgentInstance
since all config changes now go through setConfigOption(). Also remove the
mode:beforeChange and model:beforeChange middleware hooks from
MiddlewarePayloadMap and plugin templates, keeping config:beforeChange as
the single unified hook.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>