feat(infinity-agent-core)!: allow spawning subagents with a fresh (no prefix) context - #114
Merged
Merged
Conversation
akainth015
force-pushed
the
feat/fresh-subagents
branch
from
September 15, 2026 17:19
4041396 to
d48eaa4
Compare
Deploying infinity with
|
| Latest commit: |
a74c4e7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f743c100.infinity-dc7.pages.dev |
| Branch Preview URL: | https://feat-fresh-subagents.infinity-dc7.pages.dev |
akainth015
force-pushed
the
feat/fresh-subagents
branch
from
September 15, 2026 17:32
d48eaa4 to
dc2f9ff
Compare
akainth015
marked this pull request as ready for review
September 15, 2026 21:10
akainth015
force-pushed
the
feat/fresh-subagents
branch
from
September 16, 2026 18:53
dc2f9ff to
1e88ebc
Compare
shadaj
reviewed
Sep 16, 2026
| #[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
| pub enum SpawnContext { | ||
| /// Inherit the parent's full history up to the moment of the spawn. | ||
| Inherit, |
Member
There was a problem hiding this comment.
Does anyone use this other than tests?
akainth015
force-pushed
the
feat/fresh-subagents
branch
from
September 17, 2026 18:28
086cb09 to
9354cc2
Compare
… 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>
…guard to appease clippy 1.95 `clippy::collapsible_match` (denied via `-D warnings`) now fires on the text-delta branch in `stream.rs`; fold the `tool_call.is_none()` check into a match guard. Co-authored-by: Infinity 🤖 <infinity@hydro.run>
akainth015
force-pushed
the
feat/fresh-subagents
branch
from
September 17, 2026 20:26
9354cc2 to
a74c4e7
Compare
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.