Skip to content

feat(channels): add channel schema, RPC controllers, and definition-driven UI#88

Merged
senamakel merged 5 commits into
tinyhumansai:mainfrom
senamakel:fix/channel-login
Mar 30, 2026
Merged

feat(channels): add channel schema, RPC controllers, and definition-driven UI#88
senamakel merged 5 commits into
tinyhumansai:mainfrom
senamakel:fix/channel-login

Conversation

@senamakel
Copy link
Copy Markdown
Member

Summary

  • Add a proper channel definition schema at the Rust core level with types for auth modes (API key, bot token, OAuth, managed DM), field requirements, and capabilities
  • Implement 6 RPC controllers in the channels namespace: list, describe, connect, disconnect, status, test
  • Wire the UI (MessagingPanel) to be fully backend-driven — channel list, auth modes, and input fields all come from the Rust definitions
  • Support 3 channels: Telegram, Discord, Web
  • Include 21 unit tests covering definitions, validation, and schema/handler parity
  • Add fallback definitions so the UI works even when the core sidecar is unreachable

Key design decisions

  • auth_action field: OAuth/managed auth modes return a descriptor (e.g. "discord_oauth", "telegram_managed_dm") so the frontend knows which auth flow to initiate
  • Credential storage: Reuses the existing credentials domain with provider key channel:{id}:{mode}
  • restart_required: true: Credential-based connections require a service restart to activate the channel listener (hot-reload can come later)
  • Fallback definitions: If the backend is unreachable, the UI renders hardcoded definitions so users can still see and interact with channels

New files

File Purpose
src/openhuman/channels/controllers/mod.rs Module re-exports
src/openhuman/channels/controllers/definitions.rs Channel types + static registry (Telegram, Discord, Web)
src/openhuman/channels/controllers/ops.rs Business logic for channel lifecycle
src/openhuman/channels/controllers/schemas.rs RPC controller wiring (6 methods)

Test plan

  • cargo check — zero warnings
  • cargo test --lib channels::controllers — 21 tests pass
  • yarn typecheck — clean
  • yarn lint — clean
  • yarn format:check — clean
  • Manual: open Settings → Messaging, verify channels render with correct auth modes and fields
  • Manual: enter a bot token, click Connect, verify credentials stored and restart message shown

🤖 Generated with Claude Code

… assertions

- Renamed the test function to better reflect its purpose: checking that the native dispatcher returns protocol-only instructions.
- Updated assertions to ensure the instructions contain the expected protocol information and do not inline tool names.
…agement

- Added new `controllers` module for channel definitions, connection management, and RPC controllers.
- Implemented channel connection logic, including connection status and credential management.
- Updated existing functions to extend support for new channel schemas and definitions.
- Enhanced documentation for channel-related functionalities, including descriptions for new RPC methods.
…efinitions and status management

- Introduced backend-driven channel definitions and status retrieval in MessagingPanel.
- Replaced hardcoded channel and auth mode definitions with dynamic data from the backend.
- Improved error handling and loading states for channel connections.
- Updated API service to support fetching channel definitions and connection statuses.
- Refactored state management for better clarity and maintainability.
…ns in MessagingPanel

- Added fallback definitions for Telegram and Discord channels to enhance messaging capabilities when backend is unreachable.
- Updated MessagingPanel to utilize fallback definitions if backend data is unavailable, improving error handling and user experience.
- Refactored API service methods to return results directly, streamlining data retrieval for channel definitions and statuses.
- Introduced a new 'web' channel definition in MessagingPanel, allowing chat via the built-in web UI.
- Updated channel connection state management to include the web channel, ensuring proper handling of connections.
- Enhanced routing logic to support fallback mechanisms across all defined channels, improving resilience in connection handling.
- Refactored channel type definitions to accommodate the new web channel, ensuring consistency across the application.
@senamakel senamakel merged commit 2746007 into tinyhumansai:main Mar 30, 2026
3 of 4 checks passed
@senamakel senamakel deleted the fix/channel-login branch March 30, 2026 19:34
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.

1 participant