feat: implement fork agent with parent context inheritance - #1471
Draft
zhanba wants to merge 1 commit into
Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1471 +/- ##
==========================================
+ Coverage 19.41% 19.45% +0.04%
==========================================
Files 703 705 +2
Lines 66504 66565 +61
Branches 1632 1588 -44
==========================================
+ Hits 12909 12950 +41
- Misses 53316 53336 +20
Partials 279 279 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
forkagent type that inherits the parent conversation's full message history, enabling context-aware parallel sub-tasksbuildForkMessages/buildForkDirectiveutilities that clone the parent messages (with fresh IDs) and append a structured fork directive as a final user turngetBuiltinSubAgentInfointo a shared helper in@getpochi/common, removing duplicated agent-type switch logic fromuse-live-sub-taskandtool-call-approval-button<fork-directive>messages out of the UI formatter (same as<system-reminder>) so they are never rendered to the userFlexibleChatTransport→createNewTaskMiddlewareso fork tasks are seeded with full context at creation timeTest plan
bun run testinpackages/commonbuildForkDirectivewraps directive text correctlybuildForkMessagesclones parent history and appends directive as new user message with fresh IDsformatters.uistrips fork-directive messages from rendered outputforkagent from the UI and confirm it receives the parent conversation context🤖 Generated with Pochi | Task