Skip to content

refactor(channels): consume tinychannels providers - #6339

Merged
senamakel merged 7 commits into
tinyhumansai:mainfrom
senamakel:channels-to-tinychannels
Sep 18, 2026
Merged

senamakel merged 7 commits into
tinyhumansai:mainfrom
senamakel:channels-to-tinychannels

Conversation

@senamakel

@senamakel senamakel commented Sep 18, 2026

Copy link
Copy Markdown
Member

Summary

  • replace OpenHuman provider shim files with direct TinyChannels provider re-exports
  • delegate portable model-route command parsing, provider aliases, and help rendering to TinyChannels
  • move Telegram portable helpers into TinyChannels
  • consume the split runtime and bus helpers for listener supervision, typing, acknowledgements, and inbound identity derivation
  • retain OpenHuman-only agent prompt wording, persistence, credentials, event-bus, health, and backend policy locally

Dependency

Validation

  • cargo +1.96.1 fmt --all -- --check
  • TinyChannels: cargo +1.96.1 test providers::telegram:: (152 passed)
  • TinyChannels: cargo +1.96.1 test -p tinychannels-runtime
  • TinyChannels: cargo +1.96.1 check -p tinychannels-bus
  • TinyChannels: cargo +1.96.1 check -p tinychannels

Known validation blocker

  • The root core suite cannot complete because unrelated ConnectedServerOverview.instructions API drift currently fails the core build.

Summary by CodeRabbit

  • New Features

    • Portable channel commands now support provider and model discovery, selection, and status responses through a shared command experience.
    • Provider aliases and help responses use a consistent, up-to-date channel catalog.
    • Telegram remote commands and approval prompts use shared formatting and parsing behavior.
  • Reliability

    • Channel connection, disconnection, and restart events are now surfaced consistently through observability.
    • Typing indicators and listener supervision use shared channel runtime behavior for more consistent operation.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel requested a review from a team September 18, 2026 17:06
@tinysweeper

tinysweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 4 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Changes requested
Priority: critical
Reviewed head: 72b4e3bfff0c
Updated: 1789767584 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 22 Active findings 5
Tests 3 Noted findings 0
Documentation 0 Resolved findings 7
Configuration 0 Pending checks/questions 4

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

  • medium · critique · Cover runtime command parsing changes with an end-to-end test — This now delegates runtime-command parsing unconditionally to the portable tinychannels parser. Previously, non-Telegram/non-Discord channels returned `None` before parsing, so cha (crates/openhuman\-core/src/channels/routes\.rs:41)
  • medium · security · Cover portable runtime command changes with an end-to-end test — This removes the previous channel allowlist and delegates runtime-command parsing unconditionally, so channels that previously ignored `/models` and `/model` can now respond. The r (crates/openhuman\-core/src/channels/routes\.rs:41)
  • critical · description · Restore the WhatsApp Web feature gate — The re-export `pub use tinychannels::providers::whatsapp_web;` unconditionally exposes the module, but it should be gated behind the `whatsapp-web` feature like the old `pub mod wh (\(pull request description\))
  • high · description · Ensure Channel trait compatibility in typing wrapper — The new `spawn_scoped_typing_task` wrapper passes `channel: std::sync::Arc<dyn crate::channels::Channel>` to `tinychannels::runtime::spawn_scoped_typing_task`. If `tinychannels::ru (\(pull request description\))
  • medium · description · Cover runtime command parsing changes with an end-to-end test — The `parse_runtime_command` function now unconditionally delegates to `parse_portable_runtime_command` from tinychannels, removing the previous channel-level gating. This means cha (\(pull request description\))

Resolved this pass

  • Re-import std::path::Path after removing its use line
  • Re-import std::path::Path after removing its use line
  • Restore the WhatsApp Web feature gate
  • Re-import std::path::Path after removing its use line
  • Restore the WhatsApp Web feature gate
  • Re-import std::path::Path after removing its use line
  • End-to-end job `Rust Feature-Gate Smoke (gates off)` did not pass on this head

Pending checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)

Before merge

  • Address Restore the WhatsApp Web feature gate (\(pull request description\)).
  • Address Ensure Channel trait compatibility in typing wrapper (\(pull request description\)).
  • Wait for Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS).

How this fits together

flowchart LR
  n0["TelegramApprovalSurfaceSubscriber<br/>changed"]:::changed
  n1["build_new_session_response<br/>changed"]:::changed
  n2["build_sessions_response<br/>changed"]:::changed
  n3["build_status_response<br/>changed"]:::changed
  n4["parse_runtime_command<br/>changed<br/>2 findings"]:::flagged
  n5["join"]:::impacted
  n6["build_remote_command_response"]:::impacted
  n7["handle_runtime_command_if_needed"]:::impacted
  n8["start_channels_inner"]:::impacted
  n9["format"]:::impacted
  n10["vec"]:::impacted
  n1 -->|calls| n9
  n1 -->|calls| n10
  n2 -->|calls| n5
  n2 -->|calls| n9
  n2 -->|calls| n10
  n3 -->|calls| n9
  n4 -->|calls| n5
  n5 -->|calls| n9
  n6 -->|calls| n1
  n6 -->|calls| n2
  n6 -->|calls| n3
  n7 -->|calls| n4
  n7 -->|calls| n6
  n7 -->|calls| n9
  n8 -->|uses| n0
  n8 -->|calls| n10
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 7 files; 1 finding. (2 earlier finding(s) still open) _The code index is behind this pull request (indexed at `87f80e5c3e67`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._
  • Evidence: crates/openhuman\-core/src/channels/routes\.rs — Cover runtime command parsing changes with an end-to-end test

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 7 files; 1 finding. (3 earlier finding(s) still open) (1 observation(s) grouped into shared inline comments) _The code index is behind this pull request (indexed at `87f80e5c3e67`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._
  • Evidence: crates/openhuman\-core/src/channels/routes\.rs — Cover portable runtime command changes with an end-to-end test

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: This PR moves channel provider and runtime logic into tinychannels, replacing local implementations with re-exports and delegated calls. The WhatsApp Web feature gate is now correctly applied. However, it removes the `load_cached_model_preview` function from `routes.rs` without updating the tests in `routes_tests.rs` that call it, causing a compilation failure. These tests must be updated or removed before merging. (1 finding discarded for not matching a changed line) (3 earlier finding(s) still open) _The code index is behind this pull request (indexed at `87f80e5c3e67`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Failure
  • Scope reviewed: all assigned evidence
  • Lane summary: This pull request refactors channel behaviors to consume TinyChannels providers and runtime helpers. The critical WhatsApp Web feature gate is still missing, the Channel trait compatibility in the typing wrapper is uncertain, and the earlier request for an end-to-end test for runtime command parsing remains unaddressed. Merge is not recommended until these issues are resolved. (1 earlier finding(s) still open) _The code index is behind this pull request (indexed at `87f80e5c3e67`), so retrieved context may be out of date._ _3 memory call(s) failed (model: cortex: v1/answer answered 502 Bad Gateway), so this review saw part of what the engine holds._
  • Evidence: \(pull request description\) — Restore the WhatsApp Web feature gate
  • Evidence: \(pull request description\) — Ensure Channel trait compatibility in typing wrapper
  • Evidence: \(pull request description\) — Cover runtime command parsing changes with an end-to-end test

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: This refactor delegates provider logic to tinychannels, moving command parsing, response rendering, supervision, and thread-id derivation out of OpenHuman. The changes have external surface (Telegram remote commands, `/model`/`/models` responses, channel lifecycle events) but no end-to-end test drives the new delegated paths. The earlier finding about runtime command parsing e2e coverage remains unfixed, and additional behaviour (telegram remote command handling, supervision events) is also uncovered. (1 finding discarded for not matching a changed line) Waiting on end-to-end jobs: `Rust E2E (mock backend)`, `Build Playwright E2E Artifact`, `E2E (Playwright / web lane)`, `Desktop E2E (full suite, 3 OS)`. 1 end-to-end job passed on this head. (1 earlier finding(s) still open)
  • Unresolved questions/checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)
Evidence and run details
  • Models: ladder/vectors, gpt-5.6-luna, deepseek-v4-flash
  • Spend: $0.027738
  • Tokens: 534314 input · 38065 output · 14796 cached · 1279 embedding
Head State Pass summary
23586db66cf4 changes requested 4 active finding(s), 0 resolved finding(s) (at 1789751847)
72b4e3bfff0c changes requested 5 active finding(s), 7 resolved finding(s) (at 1789767584)

tinysweeper 0.1.0

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8f1f26c9-57f4-4628-b056-652a63475463

📥 Commits

Reviewing files that changed from the base of the PR and between fed1742 and 72b4e3b.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • crates/openhuman-app/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (26)
  • crates/openhuman-core/src/channels/bus/thread_id.rs
  • crates/openhuman-core/src/channels/providers/dingtalk.rs
  • crates/openhuman-core/src/channels/providers/discord.rs
  • crates/openhuman-core/src/channels/providers/email_channel.rs
  • crates/openhuman-core/src/channels/providers/imessage.rs
  • crates/openhuman-core/src/channels/providers/irc.rs
  • crates/openhuman-core/src/channels/providers/lark.rs
  • crates/openhuman-core/src/channels/providers/linq.rs
  • crates/openhuman-core/src/channels/providers/mattermost.rs
  • crates/openhuman-core/src/channels/providers/mod.rs
  • crates/openhuman-core/src/channels/providers/qq.rs
  • crates/openhuman-core/src/channels/providers/signal.rs
  • crates/openhuman-core/src/channels/providers/slack.rs
  • crates/openhuman-core/src/channels/providers/telegram/approval_surface.rs
  • crates/openhuman-core/src/channels/providers/telegram/approval_surface_tests.rs
  • crates/openhuman-core/src/channels/providers/telegram/remote_control.rs
  • crates/openhuman-core/src/channels/providers/telegram/remote_control_tests.rs
  • crates/openhuman-core/src/channels/providers/whatsapp.rs
  • crates/openhuman-core/src/channels/providers/whatsapp_web.rs
  • crates/openhuman-core/src/channels/providers/yuanbao.rs
  • crates/openhuman-core/src/channels/routes.rs
  • crates/openhuman-core/src/channels/routes_tests.rs
  • crates/openhuman-core/src/channels/runtime/dispatch/helpers.rs
  • crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
  • crates/openhuman-core/src/channels/runtime/supervision.rs
  • vendor/tinychannels
 _____________________________________
< I don't chase bugs; they surrender. >
 -------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel marked this pull request as draft September 18, 2026 17:11
senamakel and others added 2 commits September 18, 2026 20:20
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel senamakel self-assigned this Sep 18, 2026
senamakel and others added 3 commits September 18, 2026 22:09
Update various Rust crate dependencies to their latest compatible versions, including bitflags, clap, syn, and others. Add the new tinychannels-runtime crate as a dependency for openhuman-core, and introduce the synstructure crate as a transitive dependency. These changes ensure the project uses up-to-date library versions and supports the new runtime module.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The lockfile was updated to match the current dependency tree after adding the `tinychannels-runtime` crate and adjusting several transitive dependency versions, including downgrades for `combine`, `hermit-abi`, `libredox`, `portable-atomic-util`, `proc-macro-crate`, `redox_users`, and `toml`-related crates to resolve version conflicts.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel marked this pull request as ready for review September 18, 2026 21:14
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@senamakel
senamakel merged commit ba0426e into tinyhumansai:main Sep 18, 2026
17 of 20 checks passed

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes: 1 lane(s) blocking, worst finding is critical.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

             $0.0277 · 534,314 in / 38,065 out · 14,796 cached (3%) · ladder/vectors, gpt-5.6-luna, deepseek-v4-flash · 1,279 embedded
critique:    $0.0130 · 225,047 in / 8,871 out  · 4,232 cached (2%)  · gpt-5.6-luna, deepseek-v4-flash
security:    $0.0121 · 212,455 in / 6,612 out  · 7,492 cached (4%)  · gpt-5.6-luna
tests:       $0.0008 · 28,508 in  / 9,449 out  · 1,024 cached (4%)  · deepseek-v4-flash
description: $0.0006 · 19,146 in  / 6,598 out  · 1,024 cached (5%)  · deepseek-v4-flash
e2e:         $0.0007 · 32,369 in  / 3,258 out  · 1,024 cached (3%)  · deepseek-v4-flash

}
_ => None,
}
parse_portable_runtime_command(channel_name, trimmed).map(ChannelRuntimeCommand::Portable)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

priority medium critique confident

Cover runtime command parsing changes with an end-to-end test

This now delegates runtime-command parsing unconditionally to the portable tinychannels parser. Previously, non-Telegram/non-Discord channels returned None before parsing, so channels such as Slack could silently ignore /models and /model; the response builders and provider descriptor path also changed. Add an end-to-end test that sends these commands through a real supported channel and verifies the replies, including the behavior for channels that do not support model switching.


Additional security observation

priority medium confident

Cover portable runtime command changes with an end-to-end test

[RULE] e2e-uncovered

This removes the previous channel allowlist and delegates runtime-command parsing unconditionally, so channels that previously ignored /models and /model can now respond. The response generation also moved to the shared portable route implementation. Add an end-to-end channel test that sends these commands through a real channel path and asserts the intended replies and channel behavior.

[RULE] e2e-uncovered ·

@tinysweeper tinysweeper Bot added the priority: p0 Drop what you are doing. Data loss, a live break, or an exploitable hole. label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p0 Drop what you are doing. Data loss, a live break, or an exploitable hole.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant