Repository navigation
feat: memory block off the critical path, and per-thread tool_search and context options #8599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
a7e7487
feat(memory): take the memory block render off the turn's critical path
senamakel 17f2af8
Merge pull request #708 from senamakel/epic-712-oh707-memory-block
senamakel 0b19ca5
chore(deps): bump tinyagents to the epic-712 tool-tokens tip
senamakel 75270be
feat(tool-search): per-session discovery options, pinned on the thread
senamakel d616379
Merge pull request #710 from senamakel/epic-712-oh705-bump-tinyagents
senamakel f76b2a9
chore(deps): bump tinyagents and tinysearch to the epic-712 tool-toke…
senamakel fa2febb
fix(memory): apply the turn's route and model overrides when prewarmi…
senamakel 13069ac
Merge pull request #712 from senamakel/epic-712-oh709-prewarm-overrides
senamakel 4772736
feat(context): per-session keep_recent_tokens, result expiry, reasoni…
senamakel 714a3bf
feat(search): compact result rendering and a page-contents cap
senamakel aa067f4
docs(embed): regenerate the embed API docs and describe the search re…
senamakel 44dbae5
test(session): the codec records replay options on the first new row …
senamakel b2fec98
Merge the epic-712 tool-tokens tip into the 706 bump branch
senamakel 17ecf3b
Merge pull request #714 from senamakel/epic-712-oh706-bump-options
senamakel ba2a32a
chore(deps): bump vendor/tinyagents to the epic-712 tip with TurnObse…
senamakel 22df2f6
fix(tool-output): exempt tool_search results from TinyJuice reshaping
senamakel abc2c67
fix(session): carry the tool_discovery pin into a compacted generation
senamakel 231fcaa
feat(embed): force tool_search options onto an existing thread
senamakel 16d28f1
Merge pull request #715 from senamakel/tool-search-followups
senamakel fae7aaa
feat(observe): report turn-setup phases through TurnObservation::Setup
senamakel 9f6fee3
Merge the epic-712 tool-tokens tip into the 713 setup-phases branch
senamakel d1bec9e
docs(embed): describe the setup observations in OBSERVERS.md
senamakel c1e9994
fix(session): carry the context replay pin into a compacted generation
senamakel 36665cf
Merge pull request #717 from senamakel/replay-pin-compaction
senamakel f089bcf
Merge the epic-712 tool-tokens tip into the 713 setup-phases branch
senamakel d4108d0
Merge pull request #718 from senamakel/epic-712-713-setup-phases
senamakel d1877f9
fix(session): keep a recorded replay pin on a generation-start turn
senamakel 31abfcf
Merge fork/epic/712-tool-tokens into replay-pin-resolve-guard
senamakel 4c41207
Merge pull request #719 from senamakel/replay-pin-resolve-guard
senamakel 227862e
fix(session): hand the session's expiry, reasoning-replay and discove…
senamakel 345c639
Merge pull request #721 from senamakel/epic-712-720-expiry-run-loop
senamakel cc851ea
Merge remote-tracking branch 'origin/main' into epic-712-upstream-merge
senamakel 7b39bef
fix(ci): satisfy rust-layout, process-statics and runtime-boundary gu…
senamakel 58aea38
Merge pull request #722 from senamakel/epic-712-ci-guards
senamakel b3a6f13
docs(embed): link memory_block_deadline to Agent::prewarm_memory_bloc…
senamakel 4389c0b
chore(deps): bump vendor/tinysearch to 111a9526
senamakel caa32b6
chore(deps): point vendor/tinyagents and vendor/tinysearch at their u…
senamakel 33cea3a
chore(modules): re-pin tinysearch to 0.5.7
senamakel 7932f10
chore(deps): refresh Cargo.lock for tinysearch 0.5.7
senamakel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
78 changes: 78 additions & 0 deletions
78
crates/openhuman-core/src/agent/session_host/discovery_pin_tests.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| //! A thread's `tool_search` options are chosen when it is created, recorded on | ||
| //! its first transcript row, and read back on resume: a config that changes | ||
| //! later reaches new threads only. | ||
|
|
||
| use std::path::Path; | ||
|
|
||
| use tinyinference_llm::model::ModelResponse; | ||
|
|
||
| use super::transcript_compat_tests::{ | ||
| build_host_with_config, model, run_async, store_tree, thread_id, | ||
| }; | ||
| use crate::agent::tinyagents::discovery::DISCOVERY_METADATA_KEY; | ||
| use crate::config::schema::ToolSearchConfig; | ||
| use crate::config::AgentConfig; | ||
|
|
||
| fn agent_config(tool_search: ToolSearchConfig) -> AgentConfig { | ||
| AgentConfig { | ||
| tool_search, | ||
| ..AgentConfig::default() | ||
| } | ||
| } | ||
|
|
||
| fn no_promotion() -> ToolSearchConfig { | ||
| ToolSearchConfig { | ||
| promote_found_tools: false, | ||
| collapse_search_results: true, | ||
| ..ToolSearchConfig::default() | ||
| } | ||
| } | ||
|
|
||
| /// Runs one turn of `thread` on a fresh host over `root`, as a new process | ||
| /// would, and returns how many stored rows carry the recorded options. | ||
| async fn turn_and_count_records(root: &Path, thread: &str, tool_search: ToolSearchConfig) -> usize { | ||
| let next = model(vec![ModelResponse::assistant("ok")], true); | ||
| let mut host = build_host_with_config(root, next, true, thread, agent_config(tool_search)); | ||
| host.turn("hello").await.expect("turn"); | ||
| let session = host.session.clone().expect("bound session"); | ||
| store_tree(root, thread, &session) | ||
| .values() | ||
| .map(|stored| stored.to_string().matches(DISCOVERY_METADATA_KEY).count()) | ||
| .sum() | ||
| } | ||
|
|
||
| #[test] | ||
| fn a_new_thread_records_options_that_differ_from_today_once() { | ||
| run_async(async { | ||
| let root = tempfile::tempdir().expect("tempdir"); | ||
| let thread = thread_id("pinned-new"); | ||
| assert_eq!( | ||
| turn_and_count_records(root.path(), &thread, no_promotion()).await, | ||
| 1, | ||
| "the turn that creates the thread records its options" | ||
| ); | ||
| // A later process with a different config neither adds nor changes it. | ||
| assert_eq!( | ||
| turn_and_count_records(root.path(), &thread, ToolSearchConfig::default()).await, | ||
| 1, | ||
| "a resumed thread keeps the record it started with" | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| #[test] | ||
| fn a_thread_created_with_todays_behaviour_records_nothing_and_stays_that_way() { | ||
| run_async(async { | ||
| let root = tempfile::tempdir().expect("tempdir"); | ||
| let thread = thread_id("legacy-new"); | ||
| assert_eq!( | ||
| turn_and_count_records(root.path(), &thread, ToolSearchConfig::default()).await, | ||
| 0 | ||
| ); | ||
| // The config changes afterwards; the thread is not pinned to it. | ||
| assert_eq!( | ||
| turn_and_count_records(root.path(), &thread, no_promotion()).await, | ||
| 0 | ||
| ); | ||
| }); | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.