Skip to content

storage(#7640): re-pin tinychannels v0.1.30, drop persistence callbacks, grant + import legacy state - #7698

Merged
senamakel merged 16 commits into
tinyhumansai:mainfrom
senamakel:storage-7640-host-1
Oct 13, 2026
Merged

senamakel merged 16 commits into
tinyhumansai:mainfrom
senamakel:storage-7640-host-1

Conversation

@senamakel

@senamakel senamakel commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Re-pins tinychannels to v0.1.30 (storage contract v21, tinychannels#87 plus release): vendor/tinychannels gitlink, registry version and the 11 per-platform SHA-256 digests (taken from the published release assets), and the registry test.
  • Removes the eight persistence host callbacks (Save/LoadPendingDelivery and friends) from the host and deletes the file-backed ChannelDeliveryStore.
  • Declares the module's storage grant (storage_grant_tinychannels.rs): delivery, remote-session and WhatsApp session collections, no streams, blobs or secrets.
  • Adds a one-time, read-only import of the legacy channels/channel-delivery.json queue into the module's storage scope. The module already imports the legacy remote-session JSON itself (RemoteSessionStore::adopt_legacy), now under the granted collections.

Problem

Part of the storage epic: tinystoragedrivers is the only storage owner. TinyChannels kept its delivery queue behind host callbacks served from a JSON file, its remote-session map in JSON, and WhatsApp pairing in memory only.

Solution

  • Storage goes over ai.tinyhumans.tinystorage.Storage under a per-module grant; the host enforces it per call.
  • delivery_import.rs writes with Precondition::Absent, skips expired results and records whose key does not match their id, never touches the legacy file, and records a marker in a host-only collection (channels_host_import, outside the grant) so a delivery finished afterwards is not resurrected. A corrupt file writes no marker and is retried on the next start.
  • modules::storage_host::current_module_scope exposes the existing scope rule so the importer writes where the module will read.
  • The iMessage chat.db reader is unchanged (read-only exception).

Submission Checklist

  • Tests added or updated: grant shape and refusals (storage_grant_tinychannels_tests.rs), importer happy path, once-only marker, no overwrite, missing file, corrupt-then-repaired file, key mismatch (delivery_import_tests.rs), registry pin test, declared-grant test.
  • Diff coverage: N/A until CI reports; new modules are fully exercised by the tests above.
  • Coverage matrix: N/A, behaviour-only change.
  • No new external network dependencies.
  • Manual smoke checklist: N/A, no release-cut surface changed.
  • Linked issue closed via Closes #7640.

Impact

  • Desktop upgrade: queued required deliveries from the old JSON file carry over once; legacy files stay untouched.
  • Channels that load an older module release no longer get the removed callbacks, so the registry and gitlink move together here.
  • Test notes: turn_state_marks_busy_for_every_remote_control_channel is now #[ignore]d with a reason. It read the removed in-process store API, and before this change it already panicked on the unavailable linked-module fixture (module_fixture_tests.rs, tinybus epic). The sibling guard test no longer reads busy state. approval_prompts_reach_every_chat_channel and runtime_limits_come_from_the_linked_channel_module fail on the same fixture panic on main too.

Related

Summary by CodeRabbit

  • New Features
    • Existing pending and failed channel deliveries, along with unexpired results, are imported into the updated channel module’s storage. The original delivery file remains unchanged, and startup retries the import after a failed attempt.
    • The updated channel module supports scoped storage for delivery data and WhatsApp Web sessions.
  • Improvements
    • Updated the channel module to version 0.1.30, including refreshed platform releases.

senamakel and others added 16 commits October 13, 2026 13:58
Update the vendored tinychannels submodule to a newer commit.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a callback hook invoked during channel runtime startup so callers can
observe or react to initialization. This gives the runtime a place to
signal readiness without coupling startup logic to specific channels.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The startup delivery store now writes channel delivery state to disk and reloads it on boot, so pending deliveries survive a restart instead of being dropped. Storage host access was extended to support the new persistence path.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a storage host module and a delivery import step in channel
runtime startup so persisted deliveries can be loaded when a channel
starts.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a storage grants module that tracks per-channel storage
permissions, with a tinychannels-backed implementation registered
alongside the existing modules.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add tests covering storage grant behaviour for tiny channels and
delivery imports, and wire the new test modules into the startup
provider setup so the grants are exercised during runtime startup.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The legacy state fixture no longer spreads a deserialized JSON value into the terminal result, since the explicit fields already cover what the test needs.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ds_extra.rs

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the tinychannels crates to 0.1.30, which pulls in the bytes and
tinystoragedrivers-core dependencies, and refresh the lockfile's windows-sys
entries to 0.61.2. The remaining edits are rustfmt reflows with no behaviour
change.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The storage_host module was only reachable from within the modules tree, so it is now exposed at the crate level to let other parts of the crate use it.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The busy flag now lives in the module's own storage scope, so the tests can no
longer read it through the session store. The affected test is marked ignored
until the linked-module fixture lands, and the remaining assertions were
replaced with the corresponding processed events.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the locked tinychannels-bus dependency from 0.1.29 to 0.1.30.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Pinned tinychannels-bus back to 0.1.29 and bumped tinyflows to 0.8.15 in the app lockfile to match the versions resolved by the workspace.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the locked tinychannels-runtime version to 0.1.30 to pick up the
latest published release.

Auto-committed-on: dragonfly
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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 ✅ Completed 2026-10-13T11:38:42.409620Z 682a4e5 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Review in 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: e0083651-4bea-4008-b4b5-3ba431c2b5a1
📥 Commits

Reviewing files that changed from the base of the PR and between 3742750 and 682a4e5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • crates/openhuman-core/src/channels/host/channel_events_tests.rs
  • crates/openhuman-core/src/channels/runtime/startup.rs
  • crates/openhuman-core/src/channels/runtime/startup/callback.rs
  • crates/openhuman-core/src/channels/runtime/startup/delivery_import.rs
  • crates/openhuman-core/src/channels/runtime/startup/delivery_import_tests.rs
  • crates/openhuman-core/src/channels/runtime/startup/delivery_store.rs
  • crates/openhuman-core/src/channels/runtime/startup/delivery_store_tests.rs
  • crates/openhuman-core/src/channels/runtime/startup/module_providers.rs
  • crates/openhuman-core/src/modules/mod.rs
  • crates/openhuman-core/src/modules/registry/records_extra.rs
  • crates/openhuman-core/src/modules/registry_tests.rs
  • crates/openhuman-core/src/modules/storage_grant_tinychannels.rs
  • crates/openhuman-core/src/modules/storage_grant_tinychannels_tests.rs
  • crates/openhuman-core/src/modules/storage_grants.rs
  • crates/openhuman-core/src/modules/storage_grants_tests.rs
  • crates/openhuman-core/src/modules/storage_host.rs
  • vendor/tinychannels
 ____________________________
< Try...catch me if you can. >
 ----------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@senamakel
senamakel merged commit 7ebbd24 into tinyhumansai:main Oct 13, 2026
19 of 24 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 682a4e54fb

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Cargo.lock
[[package]]
name = "tinychannels-bus"
version = "0.1.29"
version = "0.1.30"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Refresh the desktop lockfile for the bus bump

The root lock now resolves tinychannels-bus 0.1.30, but crates/openhuman-app/Cargo.lock:6774-6775 still records this path package as 0.1.29. I checked scripts/check-linux-tls-dependencies.sh, which runs cargo tree --locked --manifest-path crates/openhuman-app/Cargo.toml; cargo tree --help defines --locked as “Assert that Cargo.lock will remain unchanged”, so the separate desktop manifest now fails that locked dependency gate before compilation until its lockfile is regenerated.

AGENTS.md reference: AGENTS.md:L16-L16

Useful? React with 👍 / 👎.

let found = records.len();
let mut written = 0usize;
for (collection, id, doc) in records {
match docs.put(collection, &id, doc, Precondition::Absent).await {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prevent the module from consuming a partial import

If a later record or the marker write fails after one of these puts succeeds, import_into returns without a marker but ModuleChannelRuntime::prepare logs the error and still opens TinyChannels. The module can finish and remove the successfully imported pending item; a later startup still sees no marker and reinserts it under Precondition::Absent, resurrecting the required outbound delivery (and, after its finite terminal-result TTL, allowing it to be sent again). Commit the records and marker atomically, or do not start the module after a partial import.

Useful? React with 👍 / 👎.

@tinysweeper

tinysweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

⚠️ Review failed for 682a4e54fbf5. the review of #7698 did not finish within 900s

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.

Storage 6/8: tinychannels — storage contract replaces host persistence callbacks; durable WhatsApp sessions

1 participant