Repository navigation
refactor(threads): move transcript view, session import and turn-state store into tinyagents-session - #6793
Merged
senamakel merged 20 commits intoSep 30, 2026
Conversation
Adds the tinyagents library as a vendored dependency to support agent-based workflows in the project. This change introduces the external package directly into the repository to ensure consistent builds and avoid runtime resolution issues. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extracted the transcript view subsystem from the threads module into its own submodule, moving related types, caching, resolution, and subagent logic into a focused directory. This improves code organization and makes the boundaries of the transcript view clearer for future development. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The live dual-write function `write_live_turn` and the shadow-read comparison logic have been removed as they are no longer needed. The TinyAgents submodule is updated to reflect the corresponding dependency changes. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the session import file does not exist, the agent now returns an appropriate error instead of panicking. This ensures that missing or incomplete session data is handled without crashing the runtime. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…rojection support Introduce a new session import subsystem that provides scanning, conversion, and projection capabilities for importing external session data into the OpenHuman core. The module includes type definitions, schema handling, and operations to transform raw session data into the internal representation, enabling flexible ingestion from various external sources. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The session import live tests now properly handle the store initialization by awaiting the store creation before proceeding with test assertions. The replay operations have been updated to correctly process agent journal entries, ensuring that replayed sessions maintain proper state transitions. The reaper and todos modules now use consistent error handling patterns when interacting with the goal store, preventing potential panics during session cleanup and task management workflows. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Return an error instead of panicking when the runtime session is not found during agent execution, ensuring the system remains stable and provides a clear diagnostic message to the caller. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the vendored tinyagents submodule to a newer commit, incorporating upstream changes. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed the filesystem-backed `TurnStateStore` and its associated types, replacing them with a new `rpc_types` module that exposes only the request and response types needed for RPC communication. The store implementation, tests, and internal types were deleted because the turn state persistence is now handled externally, leaving the crate with just the public API types for serialization. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
… paths Update the turn state mirror module to import types and store from the tinyagents_session crate instead of using relative super paths, aligning with the ongoing extraction of session logic into a shared library. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…on crate Migrate all usages of the local `crate::threads::turn_state` module to the extracted `tinyagents_session` crate, covering turn state store operations, lifecycle types, and test imports. This change consolidates the turn state management into a shared library for reuse across projects. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The purge operation now returns an error when attempting to purge a thread that does not exist, rather than silently succeeding. This makes the behaviour consistent with other thread operations and prevents accidental data loss from misdirected purge calls. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Added the `turn_state` module from `tinyagents_session` to the turn state operations, enabling proper handling of persisted in-flight turn snapshots for threads. Also introduced several new dependencies including `glob`, `hex`, `parking_lot`, `sha2`, `tempfile`, and `tinytools-agent` to support the underlying storage and hashing infrastructure required for this feature. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The session_import module now only hosts the OpenHuman-specific controller, config flags, and projector, while the core scan, convert, and ops logic has been moved to tinyagents_session::transcript::import. The README and module docs are updated to reflect this split, and the live module is made private. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed an extra backtick in the doc comment for `AgentConfig` that was causing the inline code formatting for the `tinyagents_session::transcript::import::convert` path to render incorrectly. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test file imported `turn_state` from `tinyagents_session` but only used `TurnState`, so the module-level import was unnecessary. This change removes the unused import to keep the code clean and avoid compiler warnings. The vendor submodule is also updated to its latest commit. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `live` submodule in `session_import` is now public, allowing external consumers to access its functionality. New dependencies for glob, hex, parking_lot, sha2, tempfile, and tinytools-agent were added to support the module's expanded capabilities. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the pinned commit for the tinyagents vendored dependency to incorporate upstream changes. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (60)
Comment |
Tiny Sweeper review
|
Pin tinyagents at the session tip merged with main (oh-stack-6793). Co-authored-by: Medulla <medulla@tinyhumans.ai>
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 2: move three pieces of session code that aren't product-specific into
tinyagents-session: the transcript view, the legacy session importer, and the turn-state store.Upstream: tinyagents#233, stacked on #230. On-disk and wire formats are unchanged. New literal-JSON fixtures pin
TurnState,JournalMessage,ItemLedgerRecordand the sha256 ledger key.Transcript view →
tinyagents_session::transcript::viewthreads/transcript_view/is deleted (4,040 lines).TOOL_RESULT_FAILURES_METADATA_KEYis now upstream, with its value"openhuman_tool_failures"unchanged. The writer (session_host/codec.rs) imports it from there.project_threadandproject_recordsare now public.threads/transcript_host_tests.rs: the codec-driven tool rounds and the round trip.Legacy session importer →
tinyagents_session::transcript::importJournalProjector = fn(TranscriptMessage) -> JournalMessage. The OpenHuman projector (session_import/projector.rs) still goes throughchat_message_from_transcript, so journal contents are byte-identical.schemas.rs),live.rs, andlive_tests.rs. The upstreamlivemodule only does the work.open_session_storesis now a public upstream constructor.journal,todos,reaper,replay/opsandgoals/storeimport it from there.session_importshrinks from 2,712 to 905 lines.Turn state →
tinyagents_session::turn_state::{store, types}memory/conversations/turn_states/...and the[threads:turn_state]log prefix are unchanged.mirror/*, theAgentProgressprojection adapter;rpc_types.rs, which includesFrom<&ClassifiedFailure> for PersistedToolFailure;ClassifiedFailure.tinyagents_session::turn_statedirectly. The boundary check forbids re-exports.turn_stateshrinks from 3,966 to 2,337 lines.Verification
Compile:
cargo check --tests -p openhuman -p openhuman-cli --features "$(bash scripts/ci/product-features.sh)"passes. The app manifest andopenhuman-embed/openhuman-tinyhumans --testsalso compile.Lib suite: the full suite with the product features gives 10311 passed and 1 failed. The failure is the known
connected_integrations_cache_is_keyed_per_credential, which fails the same way on the base (see refactor(core): move time/goals tools, conversation store and composio execute into vendor crates #6785).JSON-RPC e2e:
scripts/test-rust-with-mock.sh --test json_rpc_e2e json_rpc_threadgives 11/11. It covers transcript get/paginate, turn-state lifecycle, edit/regenerate truncation, goals/todos, labels and titles.Transcript search:
transcript_search_e2egives 3/3.Vendor:
tinyagents-sessionpasses 228 unit and 2 integration tests, with fmt andclippy -D warningsclean.CI scripts: these pass:
rust:layoutcheck-agent-runtime-boundarycheck-feature-forwardingcheck-gated-test-allowlistcheck-submodule-monotonic upstream/main HEAD(9 pins forward)check-module-pinsfails on tinywallet and tinychannels, both from test: drop 45 quarantined raw-coverage files, dedupe vendor-covered tests, repoint vendor pins #6781.Merge order
tinyagents #228 → #229 → #230 → #233, then this PR after #6789.