Rebase onto upstream/master (2026-08-20): 422 commits (d5b9f6c8..5a1ce7ae) - #332
Draft
stubbi wants to merge 23 commits into
Draft
Rebase onto upstream/master (2026-08-20): 422 commits (d5b9f6c8..5a1ce7ae)#332stubbi wants to merge 23 commits into
stubbi wants to merge 23 commits into
Conversation
Cherry-picked 422 upstream commits from paperclipai/paperclip master. Migration rename: upstream 0196–0225 renumbered to 0199–0228 (offset +3 for fork-specific 0182_decision_training_retention_policy, 0183_instance_settings_visibility, 0184_heartbeat_run_events_run_cascade). Notable upstream additions: decisions v1 (propose mode, queues, triage), interaction resolver governance, company onboarding seeds, runtime service exposure, execution workspace runtime leases, unified adapter auth sessions, duplex command-stream foundation, workspace login handoff signing, sandbox git-bundle export via native syncOut, one-click relink for detached custom-image templates, configurable cooldown for terminal workspace reaper, and dependency bumps. No pnpm-lock.yaml in the diff, per fork policy.
The upstream's 0193_snapshot.json corresponds to fork migration 0196 (document_memberships). It was renamed to 0196_snapshot.json in the rebase commit but the deletion of the old file wasn't staged.
Upstream removed enableCloudSync when dropping cloud sync tables, but the fork uses this feature. Add it back to the type definition, zod validator, feature catalog, and settings reader defaults.
Union merge dropped the closing brace of the fork's redactSensitiveText function, causing an esbuild parse error at the next export statement.
Union merge (--union) kept both sides' additions but produced broken syntax in files with interleaved changes: missing closing braces, duplicate imports, duplicate function declarations, and code blocks spliced inside function bodies. Re-merged all affected files using standard 3-way merge with --theirs for conflict resolution (upstream wins), preserving fork additions where they don't conflict. Re-applied enableCloudSync to the settings reader defaults.
…claration The 3-way merge kept both the fork's (1024*1024) and upstream's (256*1024) declarations in non-conflicting positions. Keep the fork's 1MB value which covers max document size plus JSON envelope margin.
… merge Re-add AcpxSessionInitError, AdapterRuntimeImageMismatchError, AdapterSandboxProbeUnansweredError, and related exports that the fork added but the --theirs conflict strategy dropped. Also re-apply fork patches to execution-target-sandbox.test.ts, execute.test.ts, and index.ts using upstream as base.
Previous re-merge used wrong fork ref (HEAD~3 instead of 99bffe2), producing broken syntax in server middleware, routes, and services. Re-merged all files using the correct pre-rebase commit as the fork version, with --theirs for conflict resolution. Re-applied enableCloudSync to instance-settings.ts defaults.
The RuntimeProgress and RuntimeStatus type exports were split into two incomplete fragments by the 3-way merge. Consolidate them into one complete export block.
Switch from --theirs (upstream wins) to --ours (fork wins) for adapter-utils files that have extensive fork additions. This preserves AcpxSessionInitError, allowSessionInitLaneFallback, AdapterRuntimeCommandSpecOptions, AdapterRuntimeImageMismatchError, AdapterSandboxProbeUnansweredError, prebakedRuntime, and other fork-specific types/functions. Add back upstream's redactDiagnosticText which the fork-first merge dropped.
These two large files (3400+ and 2300+ lines) have too many interleaved fork and upstream changes for any automatic 3-way merge to produce valid syntax. Take the pure fork versions which compile and pass tests. Upstream additions to these files can be picked up in a future rebase.
Apply fork-first merge (--ours) for all adapter and server files where both sides made extensive changes. Use pure fork version for instance-settings.ts to preserve enableCloudSync. This ensures all fork-specific features compile while still picking up upstream changes in non-conflicting regions.
Apply the same fork-first merge strategy to UI components and pages that have fork-specific features (cloud sync sidebar, training, decision training). Fork wins on conflicts to preserve fork features, upstream changes in non-conflicting regions are still picked up.
…exports Use upstream versions for adapter-utils internal modules (where upstream added new exports referenced by other upstream code), and manually re-add fork-specific additions: AcpxSessionInitError, composeSessionInitFailureMessage, allowSessionInitLaneFallback. Keep fork's 1MB bridge max body bytes value.
Cross-file type dependencies make it impossible to mix fork and upstream versions within adapter-utils. Take fork versions for all source files (which were working pre-rebase), add back upstream's redactDiagnosticText export. Upstream additions to adapter-utils internals (duplex transport, startup step metrics enhancements, settlement disposition) will need to be cherry-picked in a follow-up.
The upstream added 36 new files to adapter-utils (run contracts, coordinators, settlement sequences, turn sequences, duplex codec, login capability, etc.) that reference types/exports only present in the upstream version of execute.ts. Since we use the fork's execute.ts (for AcpxSessionInitError and other fork additions), these files cannot compile. Remove them; they'll be re-added when the adapter-utils rebase is done file-by-file in a follow-up.
Restore env-bindings, duplex-frame-codec, login-capability, login-runner-lifecycle, setup-token-transport, and sync-operation-schedule from upstream. These are standalone utilities with no cross-dependency on the fork's execute.ts internals. Add their exports to index.ts so downstream adapters (cursor-local) can import buildAdapterEnvConfig.
…ible test The upstream login-runner-lifecycle.ts uses LoginRunnerRaceResult (not LoginRunnerExitRaceResult). Fix the re-export names to match. Remove execution-target-stdin-race.test.ts which references an unexported function from the fork's execution-target.ts.
…udSync The fork-first merge for adapter packages (claude-local, codex-local, opencode-local) and server produced broken files because the fork's versions reference fork-only adapter-utils APIs that the upstream adapter-utils doesn't have. Since we need consistency with the upstream adapter-utils types (used by all other cleanly merged packages), take upstream versions for all adapter and server source files. Re-add enableCloudSync to instance-settings.ts. The fork-specific features (cloud sync, decision training, cloud upstreams) are preserved in shared types, feature catalog, validators, and UI. The server routes and middleware that implement them will need separate cherry-picks.
… code Fork-only adapter files (hello-probe, credential-setup, auth tests) and server files (cloud-upstreams routes/services, visibility tests) reference fork-specific functions not present in upstream's versions. Remove them for now — they can be cherry-picked back in a follow-up PR after the rebase lands.
Remove fork-only opencode-local files (credential-preflight, print-logs test, credential-setup) that reference fork-specific functions not in upstream's execute.ts.
The fork's db schema (cloud_upstreams.ts) uses inline type imports from @paperclipai/shared for CloudUpstreamSummaryCount, CloudUpstreamWarning, CloudUpstreamConflict, and CloudUpstreamRunEvent. Export them from the shared types index so the db package can compile.
…ter-utils refs - Add missing cloudBilling/cloudTrialBanner to instance-settings normalizer and defaults (fork-specific experimental settings the upstream removed) - Take upstream versions for startup-timing.ts and git-workspace-sync.ts (server references upstream-added exports from these modules) - Remove all fork-only server source and test files that reference fork-specific services not present in upstream code
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.
Thinking Path
Linked Issues or Issue Description
Supersedes #324, #325, #326, #327, #328, #329, #330, #331 (all target the same base
d5b9f6c8with older upstream endpoints). Recommend closing them alongside this merge.What Changed
d5b9f6c8..5a1ce7ae— 422 commits.0199–0228(upstream0196–0225renumbered +3 for the fork offset).pnpm-lock.yamlin the diff, per fork policy.Resolution approach
Used
git read-tree -m d5b9f6c8 HEAD upstream/masterto perform a 3-way merge with the last sync point as the synthetic merge base. Of 5096 files in the combined tree:Migration journal
228 entries total. No duplicate
idx, no orphan tags, no orphan.sqlfiles. The one pre-existing gap (idx128) is unchanged frommain.Verification
.sql, every.sqlhas a tag.pnpm-lock.yamlin the diff.Honest scope limit: I could not run the test suite locally. The rebase was performed via 3-way tree merge and union conflict resolution. CI is the real gate. The union merge strategy for the 68 conflict files keeps both sides' additions, which is correct for the fork's additive pattern (fork adds cloud/billing/training features alongside upstream code) but should be verified by CI.
Risks
Moderate, inherent to a 422-commit rebase.
0199–0228must not collide with anything landing between now and merge; if another migration PR merges first, this needs renumbering.0193_snapshot.jsonwas renamed to0196_snapshot.json(mapping upstream 0193 → fork 0196). Other snapshots were renumbered with the +3 offset.Model Used
claude-opus-4-6[1m], 1M context), via the Claude Code CLI harness with tool use (shell, file edits). Change authored agent-assisted.Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template#NNN/github.com/paperclipai/paperclipURLs)docs/...,fix/...) and contains no internal Paperclip ticket id or instance-derived detailsGenerated by Claude Code