Skip to content

feat: channels config in settings — inject --channels into new sessions - #52

Merged
aterrylu merged 1 commit into
mainfrom
terry/channels-config
Mar 24, 2026
Merged

feat: channels config in settings — inject --channels into new sessions#52
aterrylu merged 1 commit into
mainfrom
terry/channels-config

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Summary

  • Add a channels field to AppSettings for persisting enabled channel plugins
  • New Channels section in the Settings panel with toggle buttons for Telegram, Discord, and autonomOS
  • Enabled channels are injected as --channels args on every new Claude Code session spawn (requires Claude Code v2.1.80+)

Changes

  • settings.ts: channels?: string[] added to interface; empty arrays cleaned up on save
  • routes/settings.ts: channels exposed in masked GET response; validated in PUT body
  • sessions.ts: channels read from settings and appended to spawn args; debug log added
  • SettingsStatusBarItem.tsx: AVAILABLE_CHANNELS registry, ChannelToggle component, pendingChannels state wired into save flow
  • Codicon.tsx: exports CodiconName type (used by ChannelToggle)

Testing

  • Toggle channels on/off in Settings panel, save, spawn a new session — verify --channels appears in the server console log
  • Save with all channels disabled — verify channels key is removed from settings.json (not stored as empty array)

Add a `channels` field to AppSettings and a Channels section in the
Settings panel that lets users toggle channel plugins (Telegram, Discord,
autonomOS) on/off. Enabled channels are persisted to settings.json and
automatically injected as `--channels` args when spawning any new Claude
Code session.

Changes:
- `settings.ts`: add `channels?: string[]` to AppSettings interface;
  treat empty arrays the same as empty strings on save (remove the key)
- `routes/settings.ts`: expose `channels` in masked response; accept
  and validate `channels` array in PUT body
- `sessions.ts`: read `channels` from settings and append `--channels …`
  to the spawn args; add a debug log line showing the full spawn command
- `SettingsStatusBarItem.tsx`: add AVAILABLE_CHANNELS registry
  (Telegram, Discord, autonomOS), ChannelToggle component, pendingChannels
  state, and wire everything into the save flow
- `Codicon.tsx`: export CodiconName type (needed by ChannelToggle)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterrylu
aterrylu force-pushed the terry/channels-config branch from 5a16a3e to 38bca05 Compare March 24, 2026 03:27
@aterrylu
aterrylu merged commit e053fa6 into main Mar 24, 2026
1 check failed
@aterrylu
aterrylu deleted the terry/channels-config branch March 24, 2026 03:27

@nox-0x nox-0x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Channels config is clean end-to-end — settings persistence, masked GET response, validated PUT, and UI toggle state all look right. One minor nit: the debug console.log on session spawn should be guarded or removed before merge.

args.push("--", options.prompt);
}

console.log(`[session] spawning: ${binary} ${args.join(" ")}`);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟢 Suggestion — This console.log prints the full spawn command on every session. Fine for debugging but worth guarding with a DEBUG_SESSIONS env flag before shipping to avoid log noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants