Repository navigation
Conversation
DeJeune
added this pull request to stack #21919
October 20, 2026 13:35
5 of 7 tasks
MyPrototypeWhat
force-pushed
the
feature/agent-runtime-message-tree
branch
from
October 20, 2026 15:53
ce01f36 to
8d54f94
Compare
MyPrototypeWhat
removed this pull request from stack #21919
October 20, 2026 15:56
MyPrototypeWhat
added this pull request to stack #22087
October 20, 2026 15:58
6 of 7 tasks
Signed-off-by: suyao <sy20010504@gmail.com>
DeJeune
force-pushed
the
feature/agent-runtime-message-tree
branch
from
October 21, 2026 08:12
8d54f94 to
489aea1
Compare
This branch has not been deployed
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.
What this PR does
Before this PR: editing an Agent input deleted its original tail. History was flat, and session-wide resume selection could not safely distinguish retained branches.
After this PR: Agent archives have a hidden root, parent links and a selected path. Edit/resend preserves the original tail, creates a sibling input with an independent Pi context, and exposes the existing sibling navigator. Late output and cross-session replies stay on their originating branch.
Fixes: None
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered: immediately merging Agent archives into
topic/message, representing branches as context trees, and rebuilding native history from displayed messages. None is required to retain branches safely.Links to places where the discussion took place: #22071, #22010, #20635.
Agent Note / Spec
Agent Note: .agents/notes/proposed/architecture/2026-10-17-agent-runtime-contract.md, with its Chinese counterpart and pairing record.
Spec PR: #22071 / #22010 for the storage and tree plan; #21910 for the common runtime contract. Workspace discussion explicitly authorized implementation. Exact-head Spec review approval is pending, so this PR stays draft and the note remains proposed.
Acceptance criteria: tree-layer portions of AC8 (populated migration), AC9 (branch projection) and AC12 (native edit/fork behavior), plus target-isolation evidence relevant to AC6. This intermediate layer does not complete the full common Runtime desktop or crash-recovery criteria.
Verification
Stack refresh: rebased onto the native-gateway layers without changing this PR's implementation scope.
pnpm change:scope --base feature/agent-runtime-native-contexts --head feature/agent-runtime-message-treeandpnpm docs:affected --base feature/agent-runtime-native-contexts --head feature/agent-runtime-message-tree --jsonwere inspected. The cumulative gateway checks are recorded in #22107; prior package/storage verification below is retained as historical evidence and was not rerun solely for this rebase.pnpm typecheck:nodeandpnpm typecheck:webpassed. Changed-file Oxlint (--deny-warnings), ESLint, Oxfmt andgit diff --checkpassed; ESLint reports one existing non-blocking dynamic-i18n warning on an unchanged line.pnpm db:migrations:checkpassed andpnpm db:migrations:generatereported no schema changes.pnpm docs:check, bilingual pairing,pnpm i18n:syncandpnpm i18n:checkpassed; all 14 renderer locales have the revised warning.pnpm change:scope --base 34f0655860cbf4519a89df47a67381fc84befaa4,pnpm docs:affected --base 34f0655860cbf4519a89df47a67381fc84befaa4, andpnpm check --plan --base 34f0655860cbf4519a89df47a67381fc84befaa4were inspected. Affected reference documents were reviewed; the fork/runtime references and owning bilingual note were updated. The planner's broad test-project selection was not run locally.Exact scoped test commands
Breaking changes
New forward migration and Seeder for existing v2 databases. Edit/resend now retains earlier branches; it still does not undo filesystem changes. Existing IDs and physical archive tables remain. No mandatory common Runtime interface change.
Special notes for your reviewer
Eleventh stack layer, based on #22071. Most added lines are the generated Drizzle snapshot. This layer adapts the existing desktop driver path; the common Runtime root owner/projection cutover remains next. Native backup/deletion integration, Durable application scheduling, packaged builds, external-provider acceptance and forced-process recovery remain separate gates. Previously deleted message tails cannot be recovered.
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
main/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note