fix(provider-sync): fully isolate subagent history repair - #1869
Open
ViceEye wants to merge 5 commits into
Open
Conversation
Merge PR BigPizzaV3#1864 stale-lock and catalog cleanup hardening while preserving subagent rollout and provider-update exclusions.
sky110120
added a commit
to sky110120/CodexPlusPlus
that referenced
this pull request
Aug 17, 2026
Owner
|
这份改动当前不能直接合并:它与最新 其中“同时阻止 rollout、SQLite provider、has_user_event 和 cwd 被改写”的方向仍可能是有效增量。请基于最新 |
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
This PR prevents Codex internal subagent threads from appearing as normal
sidebar conversations after running provider history repair.
It:
model_providerrewriteshas_user_event, andcwdupdateslocal_thread_catalogRoot cause
Provider sync previously rewrote every rollout and SQLite thread to the selected
provider. Internal subagent tasks are stored in the same locations as user
threads, so changing their provider could make them eligible for normal sidebar
discovery.
has_user_eventcannot distinguish these tasks because subagent rollouts maylegitimately contain user-message events.
Detection and safety
Non-root tasks are detected through:
session_meta.sourcesourceandthread_sourcethread_spawn_edges.child_thread_idAn explicit
thread_source = usermarker takes precedence, so user-ownedderived threads are preserved. Ambiguous rows remain untouched.
Relationship to #1864
This PR incorporates and builds on #1864 by @Creator-hash, preserving its
original commits and authorship.
Compared with #1864, it additionally prevents internal tasks from being mutated
by provider repair in the first place. This covers rollout providers, SQLite
providers, visibility flags, working directories, and rollout-only subagent
records.
Validation
npm test: 56 passedgit diff --check: passedRust tests and TypeScript checks were not run locally because the required Rust
toolchain and
tscare unavailable. The PR CI should run the complete checks.