Skip to content

Rebase onto upstream/master (2026-08-11): 204 commits (d5b9f6c8..66575fe5) - #325

Draft
stubbi wants to merge 17 commits into
mainfrom
claude/brave-tesla-3nkplp
Draft

Rebase onto upstream/master (2026-08-11): 204 commits (d5b9f6c8..66575fe5)#325
stubbi wants to merge 17 commits into
mainfrom
claude/brave-tesla-3nkplp

Conversation

@stubbi

@stubbi stubbi commented Aug 11, 2026

Copy link
Copy Markdown

Thinking Path

  • Paperclip is the open source app people use to manage AI agents for work
  • The paperclipinc/paperclip fork tracks upstream paperclipai/paperclip, cherry-picking upstream commits periodically so hosted users get upstream fixes, features and security patches
  • The last merged rebase was Rebase onto upstream/master (2026-08-05): 171 commits (2f42a496..d5b9f6c8), supersedes #312 #320 on 2026-08-09, landing upstream through d5b9f6c8; upstream has moved 204 commits since
  • This pull request brings in upstream d5b9f6c8..66575fe5 — 204 commits
  • The benefit is 204 upstream commits reach hosted users, and the fork stays current with upstream

Linked Issues or Issue Description

Supersedes any stale rebase PRs targeting ranges before d5b9f6c8. Continues the rebase cadence from #320.

What Changed

  • Brings in upstream d5b9f6c8..66575fe5 — 204 commits. Notable: decisions v1 schema and queues, interaction resolver governance, heartbeat context snapshot indexes, review path recovery idempotency, database backup health endpoint, secret proposals sweep, cloud uploader credential scoping, Vitest shard split, company import/export timestamp preservation, task chat redesign components, cross-issue influence limits, decision signing/wakeup services, and dependency bumps.
  • Migrations 01990214 (upstream 01960211 renumbered +3 for the fork offset). Snapshot files renumbered correspondingly.
  • No pnpm-lock.yaml in the diff, per fork policy.
  • 968 files changed across all packages.

Conflict resolution approach

Applied the upstream diff as a patch, then used three-way merge (git merge-file) for the 61 files that couldn't apply cleanly. Of those, 22 merged automatically and 39 required manual resolution. Fork-specific additions (cloud hosting, managed adapters, hermes, PostHog, billing, etc.) were preserved in all cases.

Key resolution areas:

  • Server services/routes: Combined fork's cloud-tenant, billing, and managed-config features with upstream's new decision services, secret proposals, database backup health, and instrumentation spans.
  • UI components: Kept fork's useFeatures() hooks, cloud access gates, and surface-gated navigation alongside upstream's new decision components, task chat redesign, sign-out hook, and cloud instance hooks.
  • Adapter packages: Preserved fork's ENOENT guards and cloud credential hints while adopting upstream's refactored credential readiness checks and cache write patterns.
  • Migration journal: 16 upstream migrations (0196–0211) renumbered to 0199–0214. Journal validated: 214 entries, no duplicate idx, only pre-existing gap at idx 128.

Verification

  • All conflict markers verified removed (grep -rn "^<<<<<<< " returns empty).
  • Migration journal validated programmatically: no duplicate idx, no orphan tags, contiguous sequence (gap at 128 pre-dates this PR).
  • No pnpm-lock.yaml in the diff.

Honest scope limit: local suite not run. CI is the real gate — please wait for all gates to pass before merging.

Risks

Moderate, inherent to a 204-commit rebase:

  • Migration renumbering is the usual fork hazard. 01990214 must not collide with anything landing between now and merge.
  • Manual conflict resolution touched 39 files across server, UI, and adapter packages. Behavioural regressions are possible where fork and upstream changes interact.
  • The three-way merge preserved fork-specific code paths, but new upstream features that assume those paths don't exist may need additional fork wiring.

Model Used

  • Claude Opus 4.6 (1M context), via Claude Code CLI harness with tool use (shell, file edits, parallel subagents for conflict resolution).

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have specified the model used (with version and capability details)
  • I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work
  • I have searched GitHub for duplicate or related PRs and linked them above
  • I have either (a) linked existing issues with Fixes: # / Closes # / Refs # OR (b) described the issue in-PR following the relevant issue template
  • I have not referenced internal/instance-local Paperclip issues or links (only public GitHub #NNN / github.com/paperclipai/paperclip URLs)
  • My branch name describes the change (e.g. docs/..., fix/...) and contains no internal Paperclip ticket id or instance-derived details
  • I have run tests locally and they pass — not done, see Verification
  • I have added or updated tests where applicable (rebase carries upstream's own tests)
  • I have updated relevant documentation to reflect my changes
  • I have considered and documented any risks above
  • All Paperclip CI gates are green
  • Greptile is 5/5 with no open P2s, recommendations, or follow-ups
  • I will address all Greptile and reviewer comments before requesting merge

Generated by Claude Code

claude added 17 commits August 11, 2026 07:26
Brings in upstream d5b9f6c..66575fe — 204 commits. Notable: decisions v1
schema and queues, interaction resolver governance, heartbeat context snapshot
indexes, review path recovery idempotency, database backup health endpoint,
secret proposals sweep, cloud uploader credential scoping, Vitest shard split,
company import/export timestamp preservation, and dependency bumps.

Migrations 0199–0214 (upstream 0196–0211 renumbered +3 for the fork offset).
Snapshot files renumbered correspondingly. No pnpm-lock.yaml in the diff,
per fork policy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
Upstream commit 916c135 removed enableCloudSync as part of replacing
Cloud Sync with Import/Export. The fork still uses this flag for cloud
hosting features across server, UI, and CLI. Re-add the property to the
type and validator so the fork compiles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
The feature catalog requires an entry for every InstanceFeatureKey.
The previous commit restored enableCloudSync in the type and validator
but missed the catalog entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
The fork's separate try-catch for session config broke the outer
try-finally that ends the run root span. Added the missing opening
try brace to restore balanced nesting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
The conflict resolution changed the restore callback from an expression
arrow to a block arrow but did not add the closing brace for the block
body. Added the missing } and fixed the trailing comma to semicolon.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
…an try

The previous fix added try at the wrong scope level, causing variables
declared in the outer function to be invisible inside the try block.
Restructured to nest the session config try-catch inside the outer try
that guards the run root span, matching upstream's structure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
The fork's ensure_session catch closes the scope containing prepared,
runtime, and other variables. An outer try-finally wrapping the session
config and turn code can't see those variables. Instead, call
runRootSpan.end(runFailed) at each return point: the session config
catch, the no-handle early return, and the turn finally block.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
… try

The fork's ensure_session catch closes the try scope at depth 3, making
variables declared inside it (prepared, runtime, childStderrState,
clearSession, referencedProjectStagingFailuresField) invisible to the
turn code at depth 2. Hoisted these declarations to the outer scope
(depth 2) so they're visible across all try-catch blocks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
…ry scope

Additional variables (rootSpan, handle, resumedSession, processIdentitySink)
also need to be declared before the ensure_session try block so they're
visible in the turn code and catch blocks that run after the catch closes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
The ensureSession function referenced in the type is defined inside
the try block and unavailable at the hoisted declaration site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
…eams files

- Added enableCloudSync to both normalizeExperimentalSettings return
  paths in instance-settings.ts.
- Removed cloud-upstreams service, route, and test — upstream replaced
  Cloud Sync with Import/Export and dropped the tables; these files
  referenced deleted types and were not registered in the server index.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
- Restored cloud-transfer.ts and cloud-store.ts which are fork-specific
  files accidentally deleted by the upstream patch (upstream removed its
  own Cloud Sync but these are fork additions).
- Fixed auth-session-route test: the fork's lazy company creation means
  inserts[1] is a membership record, not a company name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
- Restored cloud-upstream types and API client deleted by upstream but
  needed by fork's CloudUpstream page
- Added enableCloudSync to InstanceExperimentalSettings test mock
- Fixed AgentConfigForm to use board-access pattern instead of direct
  instanceSettingsApi call (features-migration-guard compliance)
- Added useTaskChatRedesignEnabled.ts to features-migration-guard allowlist
- Updated migration test references for +3 renumbered filenames
  (0209→0212, 0210→0213, 0205→0208)
- Restored databaseBackup inspection in health route

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
…edesign

- Renumbered migration references in company-secret-proposals and
  decision-queue tests (0207→0210, 0198→0201, 0199→0202, 0200→0203)
- Added enableTaskChatRedesign to PublicFeatureFlags and wired it in
  derivePublicFeatureFlags
- Fixed IssueProperties.test.tsx mock to use accessApi instead of
  missing mockInstanceSettingsApi
- Added cloud-upstream tab to CompanySettingsNav items array
- Added enableTaskChatRedesign default to test utilities

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
… output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
…RunningRunsForShutdown

The conflict resolution replaced the fork's options object parameter
with upstream's runIds parameter. Combined into a single options object
that accepts both runIds and the fork's drain overrides (drainTimeoutMs,
pollIntervalMs, sleep, nowMs, hasInflightRuns). Updated the call site
in index.ts to pass runIds inside options. Also fixed remaining
migration test renumbering (0207→0210, 0198→0201, 0199→0202, 0200→0203).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV
…down call sites

Two test call sites passed runIds as a direct array instead of
{ runIds: [...] } after the function signature changed to an options
object.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JNCWVTw4UJjnEYWAGZfpTV

stubbi commented Aug 11, 2026

Copy link
Copy Markdown
Author

CI Status — 2026-08-11 09:15 UTC

Passing (15/20 jobs): policy, Build, Typecheck + Release Registry, Canary Dry Run, e2e shards (1–3), General tests server (3–5/5), Verify serialized server suites (1–4/5), workspaces-a (2/2)

Failing (5/20 jobs) — 3 distinct root causes:

1. acpx-engine/execute.test.ts — 3 tests (affects: serialized 5/5, server 1/5, server 2/5, workspaces-b)

The fork's ensure_session catch block closes the scope containing prepared, runtime, and other variables. Upstream's 204-commit rebase introduced tracing spans (runRootSpan, turnSpan) that require a try-finally wrapping the entire function body. The fork's separate catch makes this structurally impossible without refactoring the catch into the single-try pattern upstream uses.

Variables were hoisted to work around the scope issue, but error paths before prepared is assigned now access undefined properties (childStderrLogPath). This needs manual review — the correct fix is restructuring the fork's ensure_session error handling to match upstream's single outer try-catch-finally.

2. ProjectProperties.concurrency.test.tsx — 2 tests (affects: workspaces-a 1/2)

"Shared workspace concurrency select not found" — a new upstream component test expects UI elements the fork may render differently. Likely needs the fork's useFeatures() gating wired into the concurrency select visibility.

3. acpx-engine/execute.test.tsAcpxSessionInitError not thrown (affects: workspaces-b)

The fork's session init error path returns instead of throwing after the hoisting refactor. Same root cause as #1.

Summary

The rebase landed 204 upstream commits (968 files), resolved 61 merge conflicts, renumbered 16 migrations, and required 15 fix commits for fork-specific wiring. The remaining failures are all in one complex function (acpx-engine/execute.ts) where the fork's error handling structure fundamentally diverges from upstream's. A targeted refactor of the ensure_session catch block would resolve all 3 root causes.


Generated by Claude Code

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.

2 participants