Skip to content

feat: epic 7964 — TinyChannels v2 host integration - #8397

Merged
senamakel merged 1945 commits into
tinyhumansai:mainfrom
senamakel:epic/7964-channel-v2
Oct 26, 2026
Merged

senamakel merged 1945 commits into
tinyhumansai:mainfrom
senamakel:epic/7964-channel-v2

Conversation

@senamakel

Copy link
Copy Markdown
Member

Closes #7964
Closes #7970

What this delivers

TinyChannels v2 on the OpenHuman host:

  • web_chat is a thin host module (OpenHuman policy and port implementations) over the TinyAgents turn runner and the TinyChannels web adapter; a file-by-file ownership audit is in docs/handoffs/7964/final-acceptance-web-chat-audit.md.
  • One inbound path: native channel listeners run on the shared runner with durable sessions; module-backed typing, typed media and voice notes (inbound STT, outbound mirrored voice replies).
  • channels/ cleanup: bus-owned controller contracts, no vendor implementation imports in core, turn-state routing through the configured module object.
  • Frontend and TUI on the generated chat wire types, typed attachments, in-app voice notes.
  • Docs (en + zh) and about_app capabilities updated.

Must land first (draft until then)

The gitlinks point at fork commits. Mark ready once these merge and the gitlinks are re-pointed to the merged upstream commits:

Also after those: cut a TinyChannels release and re-pin the module registry (modules::registry::tests::release_manifest_tests::tinychannels_registry_matches_scoped_runtime_release fails until then: registry pins contract 23, the module is contract 33); replace the git-rev tinyvoice-bus dependency in tinychannels with a released version; publish the deferred wiki patch (docs/handoffs/7964-wiki-handoff.patch).

Rolled-up work

Fork sub-issues (all closed on senamakel/*): openhuman #133-#139, tinychannels #10-#23, tinyagents #30. Rolled-up fork PRs: https://github.com/senamakel/openhuman/pulls?q=is%3Apr+is%3Amerged+base%3Aepic%2F7964-channel-v2 (integration: #662, #665, #678). Tracking PR: senamakel#120.

Gates (details in docs/handoffs/7964/upstream-merge-receipts.md)

fmt, clippy -D warnings, pnpm rust:layout, pnpm docs:generate/check/test all exit 0; channels:: 338, web_chat:: 310, cron:: 330 passed; JSON-RPC and staged-module e2e green except items proven failing identically on upstream/main (one flows:: test, telegram auth e2e, a Node 22 gzip vitest) and the registry test above; changed-line coverage 86% (gate 80%).

senamakel and others added 30 commits October 21, 2026 15:34
The test case for native staged lease cleanup is updated to only break if the claim is canceled and the associated file no longer exists. This ensures the test accurately reflects the intended cleanup logic.

Auto-committed-on: dragonfly
Updated several documentation files to reflect recent changes in the agent harness, channel structure, and frontend architecture. This includes refining descriptions of agent archetypes, clarifying the agent engine's internal components, and updating the frontend provider chain reference.

Auto-committed-on: dragonfly
This update refines the quick reference tables and directory layout descriptions in the frontend architecture documentation. Minor formatting adjustments were made to improve readability across the various sections.

Auto-committed-on: dragonfly
…tone

Adds a new test case to verify that the staged lease correctly retries cleanup when the associated tombstone is canceled. This ensures resource cleanup happens even when the initial cancellation state is present.

Auto-committed-on: dragonfly
This refactors the staged attachment reading logic by introducing `read_staged_entries_for_cleanup` and a helper function. This allows the system to differentiate between standard reads and reads intended for cleanup operations, improving control over how canceled attachments are handled.

Auto-committed-on: dragonfly
This adds an assertion to ensure that when a staged lease is canceled, the corresponding record remains unavailable to ordinary reads. This verifies the intended behavior of the cancellation mechanism.

Auto-committed-on: dragonfly
…odule

Move the enriched_typed_user_input helper and its tests out of
runtime_session.rs into a dedicated runtime_session_enrichment module so the
session host file stays focused on orchestration. The behaviour is unchanged;
the helper is now referenced through the new module.

Auto-committed-on: dragonfly
…dule

Moved the tiered system prompt construction out of runtime_session.rs into a
new runtime_session_prompt.rs module so the session host file stays focused on
turn orchestration. The synthesized_tool_names_for_test helper is now
unconditionally compiled since the prompt module depends on it.

Auto-committed-on: dragonfly
Move the synthesized_tool_names_for_test helper under a cfg(test)
attribute and drop the now-redundant cfg(test) marker from the prompt
module, so the test-only helper is not compiled into release builds.
Module declarations were reordered alphabetically.

Auto-committed-on: dragonfly
The session host file shrank after recent refactoring, so its exemption in the Rust layout check is reduced from 1021 to 965 lines to keep the allowance exact.

Auto-committed-on: dragonfly
The enrichment tests now import the session host module and call the
enriched_typed_user_input helper through its enrichment path, and the runtime
session prompt module imports anyhow::Result explicitly so the tiered prompt
builder resolves Result without relying on a transitive import.

Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
Update the vendored tinychannels submodule to commit 7dd5b29743c2.

Auto-committed-on: dragonfly
Document that threads, reactions, typing indicators, media, and voice
depend on each configured provider's declared capabilities, and note that
web chat attachments travel as typed content parts.

Auto-committed-on: dragonfly
Rewrapped several long prose lines in the channels and chat feature docs and
the channels capability description so they fit within the line-length limit.
No wording or behaviour changed.

Auto-committed-on: dragonfly
The agent harness page now describes how OpenHuman supplies persistence ports while TinyAgents owns turn execution, session identity, and transcript replay, replacing the earlier split that placed those responsibilities in the host. The channels table also corrects the Mattermost transport from WebSocket to REST API polling.

Auto-committed-on: dragonfly
fix(channels): preserve native typed media through admission
Reword the Telegram paragraph so approval interactions are described as
depending on the provider's declared capabilities and configured channel
surface, rather than claiming Telegram is the only channel with its own
approval surface.

Auto-committed-on: dragonfly
…4-137-host-handles

# Conflicts:
#	crates/openhuman-core/src/channels/runtime/dispatch/native_runner.rs
#	crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
#	crates/openhuman-core/src/channels/runtime/startup/module_providers_tests.rs
#	tests/raw_coverage/channels_round26_raw_coverage_e2e.rs
Update the vendored tinychannels submodule to a newer commit.

Auto-committed-on: dragonfly
The Telegram runtime command tests were extracted from routes_tests.rs into a
new routes_tests_telegram.rs file, included via a path attribute, so the
growing Telegram-specific coverage no longer bloats the shared test module.
No test behaviour changed.

Auto-committed-on: dragonfly
Reply authority now comes from the prepared envelope's reply_to_id, falling back to the legacy thread_ts field, so Telegram replies target the correct message instead of reusing the forum topic reference. The history reset warning now logs the underlying error, and test support exposes module objects for linked runtime tests.

Auto-committed-on: dragonfly
The routes test now builds a `ChannelInboundSource::Legacy` value carrying the
message and an optional envelope, matching the updated `prepare_inbound` input
shape.

Auto-committed-on: dragonfly
Corrected the indentation and brace placement of the legacy inbound source construction in the channel routes tests so the nested envelope and source blocks line up properly.

Auto-committed-on: dragonfly
Telegram reply targeting now reads the inbound provider message id from
thread_ts instead of reply_to_id, since forum topic routing is already
carried in reply_target and must not be reused as a reply-to id. Tests
were updated to supply the topic through topic_id and the canonical chat
through reply_target.

Auto-committed-on: dragonfly
Outbound replies now carry the inbound message's reply_to_id so threaded
replies stay linked to the message they answer. Channel tests were updated
to use the envelope-based inbound source and to wire module objects from the
linked runtime instead of an empty map.

Auto-committed-on: dragonfly
Updated the channel route tests so thread-aware history keys are asserted
against topic_id rather than thread_ts, and adjusted the fixtures to set
topic_id where a thread is expected. This keeps the tests consistent with
the current message model.

Auto-committed-on: dragonfly
Adjust the Telegram and model command test fixtures so each case sets the
thread and topic identifiers it actually exercises, and drop a duplicate
reply_to_id field that shadowed the intended value.

Auto-committed-on: dragonfly
Restructured the clear_history branch so the reset failure path is nested
inside the outer condition instead of using a let-chain. Behaviour is
unchanged; the flatter form keeps the early return and failure reply
grouped with the reset call they belong to.

Auto-committed-on: dragonfly
senamakel and others added 24 commits October 25, 2026 10:46
Updated the Chinese feature docs so cross-references point to the
correct English pages via relative paths, since the previous links
resolved to non-existent local files.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…apter

The web-chat caller link in the TinyMemes audit record now points at the
pinned commit that still contains the removed host adapter, matching the
other links in the superseded section.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Test modules and fixtures that rely on the channels and modules features are now
compiled only when those features are enabled, so the crate builds and tests
cleanly without them. The web chat surface picks the module fixture only under
the same feature combination instead of any test build.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The queued turn test fixture now only sets the legacy history and native
target fields when the channels feature is enabled, and the unavailable
local provider test is compiled only with the flows feature. This keeps
the test suite building when those optional features are off.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Two cron tests assumed features that may not be enabled, so they now carry cfg gates matching the code they exercise. The delivery-failure test requires channels and the legacy import test requires legacy-import alongside storage-sqlite, which keeps the suite compiling under narrower feature sets.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test module for the storage layout plan was only gated on the
storage-sqlite feature, so it failed to compile when legacy-import was
disabled. Adding the feature to the cfg keeps the tests aligned with the
code they exercise.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The gate-contract-tests and module test lanes ran cargo test with
--no-default-features but did not re-enable storage-sqlite, so tests
depending on that feature failed to compile or were skipped. Both lanes
now include storage-sqlite in their feature set.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The specialist routing test now treats skill_setup as intentionally absent when the skills feature is disabled, asserting it is not registered instead of requiring it. This keeps the test passing in builds that exclude the skills feature.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The proactive message scoping test depends on the modules feature, so it is now
conditionally compiled to avoid failures when that feature is disabled.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extend the gated test allowlist with four additional test files so the
check script no longer flags them.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The orchestrator routing test only skipped skill_setup when its feature was
disabled, so workflow_builder and flow_discovery were asserted to be present
even when the flows feature was off. The gate check now covers both cases and
reports the offending agent id in the failure message.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The debug tracing subscriber that logged every domain event is no longer registered during infrastructure setup, leaving only the health subscriber and scheduler gate initialisation in place.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The infra subscriber registration previously left a placeholder comment
where the tracing subscriber should have been wired up, so domain events
were never debug-logged. The bus subscription is now created and its
handle intentionally leaked to keep it alive for the process lifetime.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reworded two bullets in the multi-agent orchestration section to name the
delegation graph and agent-teams runtime graph directly instead of linking to
their source files, keeping the prose readable without the inline references.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The agent-teams member runtime bullet no longer repeats the parenthetical
"the agent-teams runtime graph" label, since the surrounding text already
identifies the graph.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The writability checks now assert that a passing probe reports no config
path, since root can write past the mode bits and the finding is no longer
tied to a specific key.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the TinyFlows module record to version 0.9.2, refreshing the release URL, archive names, and per-platform SHA-256 checksums, and advance the vendored submodule to the matching commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…tion fix

Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the lockfile to move several transitive dependencies onto newer windows-sys releases and bumped tinyflows to 0.9.2.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…nge since)

Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the tinychannels module record to version 0.1.43, refreshing the
release URL, per-platform archive names, and SHA-256 checksums, and advance
the vendored submodule to the matching revision.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the lockfile for the 0.1.43 release of the tinychannels crates and
consolidate the transitive windows-sys dependency on 0.60.2, replacing the
mixed 0.48.0, 0.59.0 and 0.61.2 versions. Also bumps windows-core and
getrandom to their newer compatible releases.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the compiled module records and their contract tests to the newly published tinyflows v0.9.2 and tinychannels v0.1.43 releases, refreshing asset checksums and the tinychannels contract and relay operation versions to match.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel marked this pull request as ready for review October 26, 2026 04:56
@tinysweeper

tinysweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

⚠️ Review of 878553364d3d could not complete.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-26T04:59:32.906090Z
We couldn’t complete this review. Comment @codex review to try again.
8785533 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@senamakel
senamakel merged commit dda3fb9 into tinyhumansai:main Oct 26, 2026
17 of 20 checks passed
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.

ProactiveMessageSubscriber is not registered on a web-only core Epic: TinyChannels v2: one channel API for every surface, adapters for every provider

1 participant