Adds /outputmode [low|medium|high] for adapter-level config and /outputmode session [low|medium|high|reset] for per-session override. Deprecates /verbosity as an alias that forwards to /outputmode. Prefixes unused verbosity params in adapter.ts with underscore to suppress TS warnings.
- Add OutputModeResolver field to TelegramAdapter; resolve mode per-call in handleToolCall, handleToolUpdate, handleThought, handleText, handlePlan instead of forwarding raw DisplayVerbosity
- Update getOrCreateTracker signature from verbosity: DisplayVerbosity to outputMode: OutputMode; pass tunnelService and sessionContext to ActivityTracker constructor
- Pass content, rawInput, and diffStats through onToolUpdate calls so ActivityTracker receives full update payload
Replace addTool/updateTool/verbosity calls with updateFromSpec(ToolDisplaySpec),
update snapshot field references (entries→specs, hidden→isHidden, visibleCount→totalVisible),
and remove the verbosity config param that was removed from ToolCardStateConfig.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rewrites activity.ts to use ToolStateMap for tool state tracking and
DisplaySpecBuilder for spec-driven rendering, removing all @ts-ignore
suppressions and as-any casts added in Task 7. Updates activity.test.ts
to match the new API (updateFromSpec instead of addTool/updateTool,
onThought takes a text param, ToolCard constructor drops verbosity arg).
Also fixes adapter.ts to pass thought text to onThought().
Replaces the old entries-based renderToolCard implementation with one that
reads from snap.specs (ToolDisplaySpec[]), rendering icon, title, description,
command, outputSummary, outputContent, diffStats, and viewer links per spec.
Fixes splitToolCardText to truncate single sections larger than 4096 chars
instead of passing them through untruncated. Updates formatting-extended tests
to use the new ToolDisplaySpec/specs API.
Replaces ToolCardEntry[]/addTool/updateTool with ToolDisplaySpec[]/updateFromSpec.
Updates primitives/index.ts to export ToolDisplaySpec instead of removed ToolCardEntry.
Adds @ts-ignore suppressions in activity.ts and formatting.ts as temporary bridge until Tasks 8/9.
Implements DisplaySpecBuilder that derives ToolDisplaySpec and ThoughtDisplaySpec
from a ToolEntry + OutputMode. Controls title logic per kind, output inlining
threshold (≤15 lines AND ≤800 chars for high mode only), noise hiding, and
diffStats pass-through. 14 tests, all green.
Implements ToolStateMap for accumulating ACP tool_call/tool_call_update
events with out-of-order delivery support, and ThoughtBuffer for
streaming thought chunk accumulation across turns.
Add OutputMode type as the new standard output mode type (replacing DisplayVerbosity
usage pattern). Maintain DisplayVerbosity as deprecated alias for backward compatibility.
Add outputMode to SessionRecord, channel config schema, and global config schema.
Add migration to auto-migrate displayVerbosity to outputMode in channel configs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Serialize per-session message dispatch to prevent out-of-order event processing
(tool_update arriving before tool_call due to concurrent fire-and-forget dispatch)
- Buffer tool updates that arrive before their tool_call and apply on addTool
- Allow post-finalize tool updates to flush immediately (late completion after seal)
- Track overflow message IDs and edit them instead of only sending once
- Forward tool updates to previous sealed card for late completions
- Count failed/error tools as done in header (Tools N/N ✅)
- Stop deleting thinking indicator messages to reduce Telegram API calls
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove @openacp/usage from builtin plugin lists (plugin was extracted
but registration entries remained, causing silent failures on first boot)
- Guard fs.readdirSync(nodeModulesDir) with existsSync check to prevent
crash when community plugins are registered but node_modules/ missing
- Clean up onboard.ts: remove redundant duplicate imports and local constants
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Combines setup wizard fixes (settingsManager/pluginRegistry passing,
ESM plugin resolution, path centralization) with develop's shell
injection validation and community adapter flow. Adds error handling
and tests for importFromDir.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrap package.json parsing with descriptive error messages and validate
entry point exists before importing. Add 7 unit tests covering all
resolution paths and error cases.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove redundant threadId assignment in lazy resume (already set via createSession param)
- Wrap patchRecord in archive with try-catch (topic already recreated, store update is best-effort)
- Add edge case comment in stripPattern for slow TTS synthesis
Archive rewrite (F3+F4):
- Archive now keeps agent alive and recreates topic instead of killing session
- Flow: delete old topic → create new topic → rewire session.threadId
- Session stays in memory and store with updated topicId
- Validates session state (must be active, not initializing)
- Rejects non-session topics with guidance message
- Tests updated to verify new behavior
TTS strip (F10):
- Add tts_strip AgentEvent type
- Emit tts_strip after successful TTS synthesis
- SessionBridge dispatches to adapter.stripTTSBlock()
- Telegram DraftManager retains finalized drafts for post-finalize strip
- [TTS]...[/TTS] block removed from visible message after audio sent
TTS fixes (F11+F12):
- /tts command now sets session voiceMode via kernel:access
- /tts on/off/next all work across adapters (not just Telegram)
- ttsProvider read from plugin config instead of hardcoded edge-tts
ThinkingIndicator fixes (F13+C17):
- dismiss() now deletes the Telegram message instead of just clearing state
- show() deletes just-sent message if dismissed during SendQueue wait
Plugin system (F22):
- Settings validation against settingsSchema enforced at boot
- Invalid settings prevent plugin from booting (marked as failed)
Session state machine:
- Guard processPrompt for finished state (prevents double-throw crash)
- Add cancelled to valid transitions from error state
- Wrap abortPrompt in try-catch in cancelSession (agent may be dead)
- Set session.threadId before createSession in lazy resume
- Skip cancelled sessions in lazy resume (spawn fresh instead)
- Backup corrupt sessions.json as .bak before starting empty
Error handling & stability:
- Validate config before writing to disk (prevents bricking on restart)
- Close session logger file descriptors on destroy
- Clean up spinner/logger on plugin boot failure
- Catch sendMessage middleware errors (prevent unhandled rejections)
- Unref permission gate timeout timer (unblock graceful shutdown)
Adapter primitives:
- Remove thinking indicator on maxThinkingDuration exceeded
- Remove draft from map after finalize in shared DraftManager
- ToolCardState appendUsage uses scheduleFlush instead of immediate flush
- Node stream adapters: add close/cancel/abort handlers
CLI/API field fixes:
- Fix CLI api session field access (.session wrapper + correct field names)
- Fix CLI api health field access (uptime in ms, memory.rss, tunnel object)
- Use AgentCatalog.resolve() in API sessions route instead of config.agents
TTS:
- Move voiceMode "next" reset after successful prompt (preserve on error)
- Updated session management to persist session state without terminating agent subprocesses.
- Renamed `destroyAll` to `shutdownAll` for clarity in session handling.
- Improved message formatting in the Telegram plugin to split tool card text into manageable chunks.
- Adjusted usage reporting to send as a separate message rather than appending to tool cards.
- Updated tests to reflect changes in usage handling and message formatting.
- Implemented logic to ensure sessions are properly removed from memory upon cancellation.
- Updated session lifecycle to auto-activate from cancelled or error states when processing prompts.
- Improved error handling in `SessionBridge` for message sending and agent event processing.
- Added cleanup functionality in `FileService` to remove old session files on startup.
- Enhanced `ConfigManager` to return a clone of the configuration object, preventing unintended mutations.
- Refined command unregistration to ensure both short and qualified names are removed.
- Introduced tests for new functionalities and improved existing test coverage.
- Updated `unregister` method to simplify command removal logic.
- Enhanced error handling in `AgentInstance` for event processing and subprocess termination.
- Added sorting of middleware handlers upon registration in `MiddlewareChain`.
- Improved `PermissionGate` to reject previous pending requests when a new one is set.
- Enhanced `NotificationManager` to handle notification failures gracefully without crashing the caller.
- Save community plugin registrations after setup wizard loop
- Replace dynamic import-based plugin name matching with static
openacp.pluginName field lookup in package.json (no code execution)
- Removed the Edge TTS provider implementation and its associated tests.
- Updated the SpeechService to support dynamic registration and unregistration of TTS providers.
- Enhanced the speech plugin to install the Edge TTS plugin dynamically if not already available.
- Adjusted configuration to exclude specific test directories and removed unnecessary dependencies from package.json.
- Replace execSync with execFileSync to prevent command injection
- Filter plugin scan by keywords/scope before importing to avoid executing arbitrary code
- Fix basePath inconsistency in setup-channels.ts (use plugins/data)
- Remove dangling Slack references from admin menu and ADAPTER_SCOPES
- Log warning instead of silently swallowing errors in configureViaPlugin
- Remove duplicate imports in onboard.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Load community plugins from registry on startup (main.ts)
- Fix path resolution for local and npm plugins (absolute paths, ESM entry point)
- Scan node_modules when plugin name differs from npm package name
- Align settings basePath to ~/.openacp/plugins/data/ across all CLI commands
- Initialize plugin system in onboard command
- Add debug logging for settings resolution in lifecycle-manager
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>