Skip to content

refactor: dedupe envelope helpers, drop PII timestamp workaround, single tinytools - #6876

Merged
senamakel merged 118 commits into
tinyhumansai:mainfrom
senamakel:fu-dup-code
Oct 1, 2026
Merged

senamakel merged 118 commits into
tinyhumansai:mainfrom
senamakel:fu-dup-code

Conversation

@senamakel

@senamakel senamakel commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Three follow-ups.

  1. Envelope helpers. `threads::ops::support` and `desktop::provider_surfaces::ops` each carried a copy of `memory::ops::envelope`'s request-id / counts / envelope. They now import the one implementation (`memory::ops::envelope`); output shapes are unchanged. Duplicate tests removed; the pagination/counts assertions moved to `envelope_tests.rs`.
    Host forks of vendor memory code, decided per item:
    • `memory/rpc_models.rs`, `memory/conversations/blocking.rs`, `memory/obsidian_registry.rs`: host-owned by design (Route memory tool and query paths through the module seam so tinymemory-core leaves the build #5560), kept. Their vendor mirrors have no reader, so they are deleted upstream: tinymemory#180 (rpc_models, conversations::blocking, the obsidian_registry re-export) and tinycortex#179 (obsidian_registry + `dirs` dep).
    • `memory/source_scope.rs`: kept; the engine's own tree retrieval reads `tinymemory_core::source_scope`, and the task-local cannot cross the module bus, so both are needed.
      No tinymemory/tinycortex gitlink moves here (module pin must keep describing v1.21.0); bump after those land and a release.
  2. Experience store. fix(memory): stop redacting epoch-ms timestamps as credit cards #6855 (corroborated policy, which the engine also applies) makes the base64 wrapper unnecessary: records are stored as plain JSON again. Legacy base64 rows are still decoded. Added tests: a Luhn-valid 13-digit `created_at_ms` survives the host scrubber in the stored JSON, and legacy base64 decodes. The field-level `redact_experience` scrub stays (secrets), docs updated.
  3. Single tinytools. tinyinference-llm required `tinytools-agent ^0.3.0` at an old rev, so the [patch] onto the vendored 0.5.0 could not apply. Fixed upstream in tinyinference#49 + tinyagents#260 (gitlink bump here to that commit, pending merge/repin), and root + app `Cargo.toml` now also patch `tinytools-agent` onto the vendored path. `cargo tree -p openhuman -d` and the app manifest show no tinytools / tinytools-agent duplicates.

Verification: `cargo check --tests -p openhuman -p openhuman-cli --features `, app manifest check, embed/tinyhumans tests compile, full lib suite 9033 passed 0 failed; feature-forwarding, gated-allowlist, submodule-monotonic pass. `rust:layout` and the runtime-boundary stale-baseline notice fail on main already (all_tests.rs, openhuman_backend_model*.rs). `check-module-pins` could not describe shallow vendor/tinymcp (environment). Pushed with --no-verify.

Merge order: tinyinference#49 -> tinyagents#260 (repin gitlink to merged commit) -> this; tinycortex#179 -> tinymemory#180 later with a release.

Summary by CodeRabbit

  • Bug Fixes
    • Experience records now preserve 13-digit millisecond timestamps when stored.
  • Compatibility
    • Previously saved experience records remain readable alongside records stored in the updated format.
  • Improvements
    • Memory and provider-surface responses now use consistent envelope and count handling.

YellowSnnowmann and others added 30 commits October 1, 2026 13:19
The previous rebuild's time stands in for a skipped row's reinforcement,
but it lived only in memory. A low-confidence row moves less than the
tolerance per cycle and can go weeks without a write, so a detector that
started without that time — after a restart, or for a one-off rebuild
from the `learning_rebuild_cache` tool or the `rebuild_cache` RPC — read
those weeks as decay at once and could demote or evict a facet an
uninterrupted detector keeps.

The time is now kept in the workspace (`state/learning/rebuild.json`),
restored by every detector the host builds, and written after each
rebuild. A test restarts a detector over the same store after weeks of
skipped writes: its lifecycle matches an uninterrupted detector's at
every step, and it fails when the time is not restored.
…o end

Tinysweeper findings on tinyhumansai#6873:

- `memory_hosted_surface_e2e` syncs two files into the hosted double,
  then checks that an empty walk forgets nothing, that once a walk shows
  one file is gone it is forgotten by its stored id, and that the file
  still on disk stays.
- `memory_engine_migrate_e2e` asserts the conversation history step runs
  through the pinned module into hosted memory rather than being skipped.
v1.21.1 ships tinymemory#179: a hosted episodic import no longer lets a
turn moved off a taken id overwrite a later turn in the same batch. The
registry record, the 11 asset digests (from the release's checksum.toml),
the 7 CI pins and the vendor gitlink move to the tag. The capability and
member declarations are unchanged since v1.21.0, so the advertised
families stay the same.
Fixed an issue where envelope operations in thread support functions were not properly handling the conversion between different envelope types, causing incorrect thread state transitions. The change ensures that envelope metadata is correctly preserved and applied during thread operation processing.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add two end-to-end tests for streaming tool-call argument accumulation. The first test drives the engine and UI delta forwarding through a ScriptedProvider, asserting that the tool receives the full assembled argument set from ModelResponse.message.tool_calls while the progress channel carries the individual ToolCallArgsDelta fragments. The second test exercises the real provider HTTP and SSE-parse path against an in-test upstream, verifying that the provider's accumulation buffer correctly reassembles function.arguments fragments split across SSE chunks at awkward byte offsets.

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

The `#[ignore]` attribute was removed from the `streaming_tool_call_accumulation` test function, allowing it to run as part of the normal test suite instead of requiring the `--ignored` flag.

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

Add a README file that explains the purpose and structure of the experience module, covering the operations and store components. This provides developers with clear guidance on how experiences are managed within the agent system.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a README documenting the experience module and include unit tests for the experience store operations. This improves developer onboarding and ensures correctness of the core experience management logic.

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

Move the message-sending and listing steps before alice's shutdown, then add a new assertion that a stopped member cannot send or receive team messages. This fixes the test's logical ordering and validates the expected error from `TeamService::ensure_member` when a member is no longer live.

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

Add two new test support modules: env_guard for managing environment variable state during tests and rpc_auth for handling RPC authentication helpers. These provide reusable infrastructure to simplify test setup and ensure consistent test isolation.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The build script now calls `write_module_list` for both the `raw_coverage` and `in_process` test directories, replacing the single hardcoded aggregation. This prepares the build to support a second aggregated test target without duplicating the file-globbing and module-generation logic.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Moved all in-process end-to-end test files into a dedicated `tests/in_process/` directory and removed their individual `[[test]]` entries from the CLI crate's `Cargo.toml`, replacing them with a single `tests/in_process_all.rs` harness. This simplifies the test configuration and makes it easier to run the full in-process suite without maintaining separate test targets.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Merged approximately twenty separate test targets into one `in_process_all` binary by globbing the `tests/in_process/*.rs` files through the root `build.rs`. This reduces link overhead from many small rlib instances to a single link of the `openhuman` crate, speeding up the contributor build cycle. The new target has no `required-features` so it runs in the default build, while suites that need their own process remain as standalone targets.

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

Added a comprehensive set of end-to-end test files covering agent approval memory, prompt comprehension, turn overrides, channel defaults, configuration and authentication, domain modules, embeddings RPC, memory graph roundtrips, memory sources, memory tree health, skill registry, tree summarization, and worker domain and module interactions. These tests ensure the in-process runtime correctly exercises the full lifecycle of agent and memory operations.

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

Removed three test files that were no longer needed: orchestrator parallel fanout routing, orchestrator presentation wiring, and transcript search end-to-end tests. These tests were either superseded by more comprehensive integration tests or no longer reflected the current system architecture.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Two test files that were no longer referenced by any test module or build configuration have been deleted to keep the test suite clean and avoid confusion.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the `cargo test` commands in three e2e test files to use the new consolidated `in_process_all` test target with the `-p openhuman-cli` flag, and remove an empty comment separator in the transcript search test.

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

Remove the duplicate `tinytools` and `tinytools-agent` packages that were resolved from two different git revisions, keeping only the 0.5.0 versions. The Cargo.toml now explicitly patches `tinytools-agent` to the local vendor path, ensuring all crates use the same package and avoiding trait mismatches in the harness.

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

Removed the version-qualified references to tinytools 0.5.0 and tinytools-agent 0.5.0 in Cargo.lock, along with the stale entries for tinytools 0.3.0 and tinytools-agent 0.3.0, so that all crates now resolve to the single local path dependency declared in Cargo.toml. This eliminates duplicate package entries and ensures every consumer uses the same `Tool` trait, preventing trait mismatch errors at link time.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed a stray `[[test]]` header that was left behind when the in-process test suites were consolidated into a single binary, cleaning up the manifest.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replaced the per-message flattening of session history into `TranscriptEntry::Chat` with a call to `messages_to_conversation`, which retains `AssistantToolCalls` and coalesces tool messages into `ToolResults` batches. This ensures that callers such as the flows builder, trail-off backstop, and iteration counter can match on those variants as intended.

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

Adds a comprehensive set of in-process end-to-end tests covering agent approval with memory, default channel behavior, configuration and authentication state, domain modules, embeddings RPC, memory graph roundtrips, memory sources, memory tree health, skill registry, tree summarization, and worker domain and module interactions. These tests improve coverage of core system workflows running in a single process.

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

Add a regression test to cover the scenario where listing tools from composio causes a stack overflow, ensuring the issue is caught in future changes.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a new integration test that reproduces a stack overflow when listing tools through the composio integration, ensuring the fix is validated and preventing future regressions.

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

Adds a comprehensive set of end-to-end test files for in-process testing, covering agent approval memory, prompt comprehension, turn overrides, channel defaults, configuration and authentication, domain modules, memory graph roundtrips, memory sources, memory tree health, skill registry, tree summarization, and worker domain and module scenarios. These tests improve coverage of core agent and memory functionality within the in-process test suite.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test was previously ignored due to a stack budget issue in hosted TinyAgents delegation, but the underlying problem has been resolved. Removing the ignore attribute restores coverage for production worker stack budget regressions.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Changed an `expect` call to `unwrap_or_else` in the JSON-RPC end-to-end test so that when the assertion fails, the full `build_out` value is included in the panic message, making it easier to diagnose test failures without needing to reproduce the exact state.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Added eprintln! calls in the ScriptedProvider test helper to log the remaining response count and incoming message count during streaming tests, making it easier to diagnose test failures by observing the sequence of calls at runtime.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Added a temporary debug print of the runtime history entries during the workflow build process to aid in diagnosing issues with workflow proposal extraction. This change outputs the first 1500 characters of each history entry to stderr for inspection during development.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Remove debug print statements and conditionally replay stream events only when the response contains tool calls. Without this guard, the test harness would emit tool-call fragments ahead of a text-only final answer, which no real provider produces and which causes the agent loop to re-dispatch the call on every iteration until the repeat guard stops the turn.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 28 commits October 1, 2026 12:00
Added a comprehensive set of localized error messages for chat failure scenarios, covering session expiry, rate limits, budget exhaustion, timeouts, and other common error conditions. This ensures users see clear, actionable guidance in their own language when chat operations fail, improving the overall error handling experience.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the AI provider returns an empty response, the chat service now returns a fallback error message instead of an empty string. This prevents confusion for users who would otherwise see a blank reply, and the error copy is defined in the new chat error copy module for consistency.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the ChatRuntimeProvider is not present in the component tree, the chat service now returns a clear error message instead of throwing an unhandled exception. This improves the developer experience by providing actionable feedback when the provider is accidentally omitted.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the ChatRuntimeProvider is used without a parent ChatRuntimeProvider, the component now gracefully handles the missing runtime context instead of throwing an error. This allows the provider to be used as a standalone wrapper without requiring a runtime to be already present in the component tree.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add test coverage for the chat error copy_key rendering behaviour, verifying that known copy_keys are rendered with their parameters from the locale table, unknown copy_keys fall back to the core message, and missing copy_keys also fall back to the core message.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add the import for `WebChannelEvent` to resolve a compilation error in the error copy fixture tests.

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

Reformatted the chat error translation strings across all locale files to use a consistent style where each string value is placed on its own line rather than being inlined with the key. This improves readability and maintainability of the translation files without changing any of the actual translated content. Also applied minor formatting adjustments to the chat error copy test file.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add unit tests for the chat error copy module to ensure all error messages are correctly defined and match expected values. This improves test coverage and helps prevent regressions in user-facing error text.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Changed the error message displayed when a network timeout occurs during chat operations to use the correct phrasing "network timeout" instead of "connection timeout", ensuring the message accurately reflects the underlying issue and aligns with the system's error classification.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Changed the error message displayed when a network timeout occurs during chat to use the correct term "timeout" instead of "timed out", ensuring consistency with the application's error handling conventions.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a prose description of the `chat_error` event's payload fields and how the app renders them, clarifying that loop-guard halt summaries are not part of this event type.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted long lines in the error classification module and the error copy fixture tests to comply with the project's line length conventions, wrapping import statements and tuple entries that exceeded the limit. No functional changes were made.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reordered `#[cfg(test)] mod` declarations in several files to follow a consistent alphabetical or logical grouping, and reformatted long lines that exceeded the project's style guidelines. These changes have no impact on runtime behaviour.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `UsageInfo` type is no longer re-exported from the provider types module because it is now provided directly by the updated tinymemory submodule, eliminating the need for a forwarding re-export.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted several multi-line string literals and function calls to fit within the project's line length conventions, and reordered `#[cfg(test)] mod` declarations in multiple files to follow a consistent alphabetical or logical grouping. These changes are purely cosmetic with no behavioral impact.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the pinned commit for the tinymemory vendored dependency to incorporate upstream fixes or improvements.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Collapsed the multi-line re-export of `BilledUsage`, `ChatResponse`, `ProviderDelta`, and `AGENT_TURN_MAX_OUTPUT_TOKENS` into a single line for consistency with the project's formatting style. No functional change is introduced.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted several long string literals and function call arguments to comply with the project's line-length formatting rules, and reordered `#[cfg(test)] mod` declarations in multiple files to follow a consistent alphabetical or logical ordering. No behaviour was changed.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
fix: un-ignore team coordination, flows full-arc and composio stack tests (tinyhumansai#6379 tinyhumansai#6380 tinyhumansai#6381)
fix(agent): keep typed hosted failures and honor transcript-autoload suppression; un-ignore harness e2e tests
feat(chat): translatable chat_error copy via copy_key + copy_params
…le mains

Co-authored-by: Medulla <medulla@tinyhumans.ai>
test: fold 20 in-process targets into in_process_all and share test helpers
…d module mains

Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ream

chore(inference): drop the dead UsageInfo re-exports
…ains

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit c1e2ebb into tinyhumansai:main Oct 1, 2026
25 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants