feat(infinity-agent-core)!: allow spawning subagents with a fresh (no prefix) context - #114
Draft
akainth015 wants to merge 1 commit into
Draft
feat(infinity-agent-core)!: allow spawning subagents with a fresh (no prefix) context#114akainth015 wants to merge 1 commit into
akainth015 wants to merge 1 commit into
Conversation
… prefix) context * Add a `fresh_context` boolean to the `spawn_thread` tool: when true, the child thread starts with an **empty** history and sees only the provided instructions, instead of inheriting the parent conversation prefix * Introduce `SpawnContext` (`Inherit` / `InheritUpTo(n)` / `Fresh`) replacing the `spawn_order_override: Option<usize>` parameter of `ConversationStore::spawn_thread` * Persist freshness as a thread attribute (`ThreadInfo::fresh_context`, new `fresh_context` column in the DSQL `thread_hierarchy` table) and add `ConversationStore::is_fresh_context_thread` * `load_history_with_ancestors` now truncates the ancestor chain at the deepest fresh boundary, so neither a fresh thread nor its descendants can see context from before the fresh spawn (including grandparents) * Seed fresh children with a synthetic `spawn_thread` tool call in their own store so the instruction tool-result pairs with a matching call * Document fresh-context subagents in the default prompt BREAKING CHANGE: `ConversationStore::spawn_thread` takes `SpawnContext` instead of `Option<usize>`, and implementations must provide `is_fresh_context_thread`. Co-authored-by: Infinity 🤖 <infinity@hydro.run>
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.
fresh_contextboolean to thespawn_threadtool: when true, the child thread starts with an empty history and sees only the provided instructions, instead of inheriting the parent conversation prefixSpawnContext(Inherit/InheritUpTo(n)/Fresh) replacing thespawn_order_override: Option<usize>parameter ofConversationStore::spawn_threadThreadInfo::fresh_context, newfresh_contextcolumn in the DSQLthread_hierarchytable) and addConversationStore::is_fresh_context_threadload_history_with_ancestorsnow truncates the ancestor chain at the deepest fresh boundary, so neither a fresh thread nor its descendants can see context from before the fresh spawn (including grandparents)spawn_threadtool call in their own store so the instruction tool-result pairs with a matching callBREAKING CHANGE:
ConversationStore::spawn_threadtakesSpawnContextinstead ofOption<usize>, and implementations must provideis_fresh_context_thread.