Skip to content

feat(infinity-agent-core)!: allow spawning subagents with a fresh (no prefix) context - #114

Draft
akainth015 wants to merge 1 commit into
mainfrom
feat/fresh-subagents
Draft

feat(infinity-agent-core)!: allow spawning subagents with a fresh (no prefix) context#114
akainth015 wants to merge 1 commit into
mainfrom
feat/fresh-subagents

Conversation

@akainth015

Copy link
Copy Markdown
Member
  • 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.

… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant