- 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>
- Delete action-detect.ts and its tests (action detection removed)
- Remove interactive new-session flows (PendingNewSession, showAgentPicker, workspace/confirm steps)
- Remove handlePendingResumeInput from resume.ts
- Delete setupCommands() from commands/index.ts
- Remove assistant state (assistantSession, assistantInitializing) from adapter
- Replace spawnAssistant() with core.assistantManager.spawn()
- All topics (including assistant) now route through core.handleMessage()
- Replace hardcoded buildMenuKeyboard with MenuRegistry-based version
- Replace broad m: switch/case handler with generic MenuRegistry dispatch
- Clean up assistant.ts: remove spawnAssistant, buildAssistantSystemPrompt, handleAssistantMessage
- Remove action detection from DraftManager
- Update tests to match new behavior
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace 5 optional handler fields with a single cleanupFns array and listen() helper.
Inline wire*() methods into connect(). Extract dispatchAgentEvent(), resolvePermission(),
checkAutoApprove(), and emitAfterResolve() as clear helper methods.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Integrates new registries into OpenACPCore constructor, registers them
as services, adds connectSessionBridge method, exposes plugin context
methods for menu/assistant extension, and exports from core index.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds isAssistant field to Session, creates AssistantManager class with
spawn/respawn/get/isAssistant/waitReady methods, and exports from assistant index.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds MenuItem type to plugin/types.ts and a MenuRegistry class for managing
plugin-registered menu items with priority sorting and visibility filtering.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Task 9: add full code for each command handler (/new, /cancel, /status, etc.)
- Task 10: fix broken build — remove adapter imports of deleted functions before committing
- Task 7: add connectSessionBridge() method to OpenACPCore
- Task 11: fix placeholder for assistantTopicId in menu callback handler
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13-task plan covering MenuRegistry, AssistantRegistry, AssistantManager,
SessionBridge simplification, command handler migration, and Telegram
adapter cleanup. TDD approach with tests before implementation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Design doc for refactoring the three intertwined systems (command dispatch,
assistant session management, bot/chat flows) into clean, separated concerns
with plugin extensibility for assistant context and menu items.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Added a new entry for 'testing' in tsup.config.ts to include src/testing.ts.
- Updated tsconfig.json in the plugin-sdk package to include a path mapping for '@openacp/cli/testing' pointing to the generated testing type definition.
- Changed fastify-type-provider-zod version from ^6.1.0 to ~5.1.0 in package.json and pnpm-lock.yaml for compatibility.
- Enhanced the fail method in the Session class to be idempotent, preventing multiple transitions to the error state.
- Updated tests to reflect the new behavior of the fail method, ensuring it does not throw on repeated calls.
Updated the buildTitle function in display-spec-builder.ts to handle "fetch" and "web" kinds, returning truncated URLs or queries if they exceed 60 characters. Modified message-formatter.ts to ensure URLs and queries are checked for "undefined" before processing, improving robustness in tool summary and title formatting.
Updated the DebugTracer class to prevent circular reference issues when logging data. Introduced a WeakSet to track seen objects and replace circular references with a placeholder string "[Circular]" during JSON serialization. This change ensures that logging does not crash the application due to circular structures.
Clean up all remaining references to /enable_bypass and /disable_bypass:
- Remove handleEnableDangerous and handleDisableDangerous from admin.ts
- Update product-guide.ts to use /bypass_permissions
- Update help text in menu.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename command from /bypass to /bypass_permissions for clarity
- Remove /enable_bypass and /disable_bypass bot commands (replaced by
/bypass_permissions on|off which handles ACP + client-side fallback)
- Remove from STATIC_COMMANDS and bot.command() registration
- Update all references in admin.ts button callback and tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These commands already worked via the generic CommandRegistry
dispatcher but were missing from STATIC_COMMANDS, so they didn't
appear in Telegram's command autocomplete menu.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
storeControlMsgId had two bugs:
- Called itself recursively instead of this.controlMsgIds.set()
- patchRecord with { platform: { controlMsgId } } replaced entire
platform object, wiping topicId and skillMsgId
Also removed duplicate patchRecord calls in new-session.ts and
resume.ts that ran after onControlMessage and overwrote controlMsgId.
Co-Authored-By: Claude Opus 4.6 (1M context) <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.
The in-memory controlMsgIds Map was lost on daemon restart, causing
updateControlMessage to silently fail for /model, /mode changes. Now
controlMsgId is persisted in the session record (same pattern as
skillMsgId) and hydrated from the record on first access.
- Add controlMsgId back to TelegramPlatformData (optional, for persist)
- Add storeControlMsgId helper: writes to Map + persists to record
- Add getControlMsgId helper: reads Map with fallback to session record
- updateControlMessage uses getControlMsgId for reliable message lookup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Enable Bypass button now delegates to the /bypass command (via
CommandRegistry) instead of directly mutating clientOverrides — so the
agent is informed via ACP setConfigOption when it supports a native
bypass mode, with client-side fallback when it doesn't.
Display is unified: both ACP-mode bypass and clientOverrides bypass now
show as "Mode: ☠️ Bypass Permissions enabled" (merged into the Mode
line) instead of a separate status line.
- Add isBypassActive(session) helper: checks agent mode + clientOverrides
- setupDangerousModeCallbacks: use registry.execute("/bypass on|off")
- buildSessionStatusText: merge bypass into Mode line
- setupTTSCallbacks + updateControlMessage: use isBypassActive
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move Telegram-specific message ID storage from core to adapter, emit
session:configChanged events when /model, /mode, or /bypass commands
execute, and update both text and buttons inline when config changes.
- Remove controlMsgId/menuMsgId from TelegramPlatformData (core types)
- Store control message IDs in adapter Map<sessionId, msgId>
- Add session:configChanged event emission in config command handlers
- Update control message (text + buttons) when config changes
- Thread onControlMessage callback through new-session/resume commands
- Pass callback in all command and callback handler invocations
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Menu titles now show context: "Choose session mode (current: Code)"
- Success messages: "Mode switched to **Architect**."
- Better errors: "This agent does not support switching modes."
- Already-set check: "Already using **Code**." (no redundant agent call)
- Bypass status: descriptive sentences with emojis
- Already-in-state check: "Bypass is already enabled/disabled."
- Client-side bypass explains why with italic note
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update config-commands.test.ts to match renamed /bypass command (was /dangerous),
new menu titles, "switched to"/"Already using" messages, "Unknown option" errors,
already-in-desired-state checks, and direct configOptions assignment. Also fix
assistant-prompt.test.ts to expect "Bypass" instead of "Dangerous".
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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.
- Added detailed error logging for plugin setup failures in the LifecycleManager.
- Updated API server and SSE adapter permissions to include 'services:use' for enhanced functionality.
- Enhanced logging during API server setup and system readiness events for better traceability.
- Added error message handling in OpenACPCore to notify users of inactive sessions.
- Improved logging in the API server setup and startup process for better traceability.
- Updated Telegram adapter to use getOrResumeSession for session management, ensuring consistent session retrieval across commands.
- Enhanced retry logic in the API server to handle port conflicts more gracefully.
When a retry was already in-flight before shutdown set the flag, the
catch block would schedule another retry after shutdown killed the
process. Add shuttingDown guard in the catch path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When user presses Ctrl+C, SIGINT is sent to the entire process group.
cloudflared receives it directly, does graceful shutdown (reconnects to
edge), exits before our shutdown code runs, and triggers onExit retry.
Spawning with detached:true puts tunnels in their own process group so
only our code controls their lifecycle via stop().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changed the marker in CLAUDE.md from '.openacp/' to '## Local OpenACP Workspace' to better reflect the current workspace terminology and improve clarity for users.