Skip to content

Merge upstream stable v0.1.10 - #140

Merged
chrisohearn merged 423 commits into
integration/mcp-events-20261109from
sync/upstream-20261117-1650
Nov 19, 2026
Merged

chrisohearn merged 423 commits into
integration/mcp-events-20261109from
sync/upstream-20261117-1650

Conversation

@chrisohearn

Copy link
Copy Markdown
Owner

Integrates upstream stable v0.1.10 (7d32075e3757ded707914e2450c3e392a9665765) and repairs the candidate's migration startup behavior and tests required by the merged upstream tree.

  • check:changed: format, lint, knip, GraphQL, 41-package typecheck, 156 test files (4,248 tests), and React Compiler.
  • Focused regressions: 6 passed (287 skipped); direct server typecheck passed.
  • Upstream migrations 94–96 remain in the upstream registry; fork-only migrations remain in t3_fork_migrations.

Model/harness: GPT-6.2 Codex via T3.

bentbrain and others added 30 commits November 15, 2026 05:17
Co-authored-by: bentbrain <28818884+bentbrain@users.noreply.github.com>
…tgg#30753)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
…gdotgg#29749)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
… reply (pingdotgg#30084)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…tgg#32376)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…on every host (pingdotgg#32774)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Shivam Sharma <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…failed when one did (pingdotgg#32407)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ted (pingdotgg#32413)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…pingdotgg#32323)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…s cancelled (pingdotgg#32414)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ngdotgg#33083)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ing node_modules (2,500 s → 5.0 s) (pingdotgg#32023)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…iew (pingdotgg#32324)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…y never show (pingdotgg#32351)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…dotgg#32364)

Co-authored-by: azhar <azhar.amir@amartha.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…33069)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ingdotgg#32598)

Co-authored-by: Zuri <zurih@rtx.internal>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…d player item (pingdotgg#32196)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…tgg#33078)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…pingdotgg#32619)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ad read instead of hiding its threads (pingdotgg#32620)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ngdotgg#32683)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
juliusmarminge and others added 10 commits November 16, 2026 10:43
…ead (pingdotgg#37735)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ingdotgg#37741)

Co-authored-by: Usama Khan <usama@Usamas-MacBook-Pro.local>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts:
#	apps/server/src/mcp/McpHttpServer.ts
#	apps/server/src/mcp/OrchestratorMcpService.test.ts
#	apps/server/src/mcp/OrchestratorMcpService.ts
#	apps/server/src/mcp/toolkits/project/handlers.test.ts
#	apps/server/src/mcp/toolkits/thread/handlers.ts
#	apps/server/src/mcp/toolkits/thread/tools.ts
#	apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
#	apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
#	apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
#	apps/server/src/orchestration-v2/Orchestrator.ts
#	apps/server/src/orchestration-v2/ProjectionStore.ts
#	apps/server/src/orchestration-v2/ProviderRuntimeRecoveryService.test.ts
#	apps/server/src/orchestration-v2/ProviderRuntimeRecoveryService.ts
#	apps/server/src/orchestration-v2/ProviderSessionManager.ts
#	apps/server/src/orchestration-v2/RunExecutionService.test.ts
#	apps/server/src/orchestration-v2/runtimeLayer.test.ts
#	apps/server/src/peer/PeerForwarding.test.ts
#	apps/server/src/peer/PeerForwarding.ts
#	apps/server/src/persistence/Migrations.ts
#	apps/server/src/provider/agentContextBudget.json
#	apps/server/src/scheduledTasks/ScheduledTaskService.test.ts
#	apps/server/src/scheduledTasks/ScheduledTaskService.ts
#	apps/server/src/workspace/WorkspaceSearchIndex.test.ts
#	apps/server/src/workspace/WorkspaceSearchIndex.ts
#	packages/provider-core/src/server/ProviderAdapter.ts
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-18T09:47:11.741232Z
We couldn’t complete this review. Comment @codex review to try again.
e557ab0 PR opened
🔒 Security Review ❌ Failed 2026-11-18T11:22:08.039989Z
We couldn’t complete this review. Comment @codex security review to try again.
93ba9bf Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chrisohearn

Copy link
Copy Markdown
Owner Author

Review of record: fallback source review (hosted review hit its usage limit)

Disposition: CHANGES REQUESTED. Not approved; actionable findings below.

  • Base: 78f183a40d8f9682ffb0bfbf05714aa4c11ac094
  • Head: e557ab0a6f92ca2163e577dbeab6b2c2c48e0ed1
  • Reviewer: independent read-only review (Claude Opus 5.5), fresh context. It did not author the change.

Scope checked. I line-reviewed the merge resolution of 173291fed8 (git show --remerge-diff, 42 files, including the non-conflicted fork edits), the whole repair commit e557ab0a6f (13 files), and the fork migration registry and startup path (Migrations.ts, ForkMigrations.ts, servicePreflight.ts). I also checked the CI workflows, agentContextBudget.json and the patch files against FORK.md. I treated the upstream-authored commits through v0.1.10 (7d32075e37) as upstream and did not line-review them; all hosted checks are green at this exact head. Verified: apps/server/src/persistence/Migrations/ is identical to upstream v0.1.10 (adds 094–096), nothing new was added to Migrations.ts by the fork, fork migrations stay at 1–17 in t3_fork_migrations, no fork migration name collides with an upstream name, and the MCP transport keeps layerMcpAuthMiddleware and allowSessionTermination. mcpToolListJsonBytes was re-measured to 61263, below the base's 61317. The two rewritten patch files match upstream exactly once context lines are normalized (same old and new sides).

Findings

1. P1: thread deletion removes an attachment file that a live fork still shows (data loss).

  • apps/server/src/orchestration-v2/ProjectionStore.ts:6592-6595, with :6548 and :6492
  • Test inverted at apps/server/src/orchestration-v2/runtimeLayer.test.ts:862-876 (case "a live fork" of it.effect.each at :700)
  • Scenario (upstream's own test): thread T has run 1 and run 3, both with attachment shared. Fork F is taken at run 1 and later fork L at run 3. Delete T, then delete L. F is still live and shows T's run 1 message with shared.
  • Failure mode: deleting L puts T in deletedSources and calls unshownRunAttachmentIds(T, -1, MAX, false, L). runAttachmentIds filters per row (NOT shownByLiveFork), so run 1's row is excluded but run 3's row with the same id is kept. With from = -1, line 6548 returns the candidates without subtracting ids that shown rows still hold. shared is released and its file is deleted while F still displays it.
  • Evidence: upstream v0.1.10 asserts the file is still "bytes" after deleting T and L, and gone only after F is deleted (7d32075e37:apps/server/src/orchestration-v2/runtimeLayer.test.ts:844-859). The merge resolution dropped upstream's lastRunsShownByLiveForks range-and-retain logic. The repair commit then changed the assertion to assert.isFalse(exists(shared)) right after L is deleted, with F still live, so CI now encodes the data loss.
  • Expected: release an id only when no row still shown by a live fork holds it. Restore upstream's assertion.

2. P2: startFromOrigin: true launches no longer refuse a base ref that exists nowhere.

  • apps/server/src/orchestration-v2/ThreadLaunchService.ts:420-422 (added in the repair)
  • Failure mode: checkWorktreeBase now returns baseResolves = true for any startFromOrigin strategy. The refusals at the entry points (apps/server/src/mcp/ThreadLaunchMcpService.ts:279-290, the "Reject unresolved base refs" path, and apps/server/src/ws.ts:2174) can no longer fire for such launches. A t3_thread_launch or composer launch with baseRef: "feature/typo" and startFromOrigin: true is accepted. Preparation then silently re-bases it on the remote default branch or HEAD (worktreeFallbackBase), so work starts on a base nobody asked for, instead of returning ThreadLaunchBaseRefError.
  • Evidence: base 78f183a40d and upstream 7d32075e37 both assert refusal for "has no origin to come from" and "was deleted on its remote". The repair removed those cases and added tests asserting acceptance (ThreadLaunchService.test.ts:3281-3305). The repair's apparent target was the fork's provisioning-time checkWorktreeBase call (ThreadLaunchService.ts:637-646), which blocks upstream's stored-base re-basing. Relaxing it only at that call site, for stored or scheduled launches, would keep the entry-point refusal that upstream has.

3. P3: fork-post-merge-ci.yml is stale against the merged ci.yml (FORK.md "Post-merge CI").

  • .github/workflows/fork-post-merge-ci.yml:346-347
  • Upstream changed ci.yml in this range: "Test release checks" now runs .github/scripts/mobile-ios-preview-record.test.cjs. scripts/fork/sync-integration-ci.sh --check on the head tree prints that diff and "out of date: run scripts/fork/sync-integration-ci.sh". As a result, post-merge CI on the integration branch skips that test. Fix: run the script and commit the result.

4. P3: the repair dropped fork-history validation from normal startup.

  • apps/server/src/persistence/Migrations.ts:304,345-346
  • runForkMigrations(), which starts with forkHistoryProblems (ForkMigrations.ts:188-193, BadState on a history that would skip a fork migration), now runs only when hasPendingForkMigrations is true, that is when the max recorded fork id is below head. A fork history with a hole below head (for example ids 1–15 and 17, the out-of-order case in FORK.md "Assigning fork migration ids") used to refuse startup. It now starts, and migration 16 never runs. The release preflight (apps/server/src/cloud/servicePreflight.ts:104) still reports it, so this is defense in depth, but no test at head covers the gap. Running the read-only forkHistoryProblems check unconditionally would keep the no-write-lock recheck.

5. P3: the merge commit carries undisclosed fork-only rewrites of upstream-owned paths (FORK.md: keep fork changes small, in fork-only files).

  • .claude/skills: both parents and the merge-base have a directory symlink to ../.agents/skills. The merge commit replaces it with seven per-file symlinks and adds scripts/agent-skill-tree-layout.test.ts, which hard-codes the seven files (:8-16) and requires exact equality of both trees. It also edits upstream's scripts/check-changed.ts:258-261,371-372. The next upstream release that adds a file under .agents/skills/ (upstream changes that tree often) will fail this test in the sync gate, and the new skill will not appear under .claude/skills until someone mirrors it by hand. The PR body does not mention this change.
  • patches/@cursor__sdk@1.3.1.patch and patches/@pierre__diffs@1.7.0-beta.4.patch, with their pnpm-lock.yaml patch hashes: context lines were rewritten as identical -/+ pairs. The content matches upstream, but every future upstream change to these patches will now conflict.

Per the engineering finding rules, P2 and P3 items can become linked issues. Finding 1 needs a fix and a re-review of the repaired head before this merges.

@chrisohearn

Copy link
Copy Markdown
Owner Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

@chrisohearn

chrisohearn commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner Author

Candidate repair update: 93ba9bf restores attachment retention while a surviving live fork still shows the attachment. The existing regression case now verifies the bytes remain until the last displaying fork is deleted. Local proof passed: focused attachment/fork tests, check:changed (41/41 tasks; 4,248 tests across 156 files), and commit hooks. A fresh exact-head source review is in progress; the P1 finding remains pending that review.

Follow-up issues for the other findings:

The hosted Security review has been requested for this head. The existing merge, publication, deployment, live reconciliation, installation, and adoption holds remain in force.

@chrisohearn

Copy link
Copy Markdown
Owner Author

Independent source review (review of record): PR #140

Bound to: base 78f183a40d8f9682ffb0bfbf05714aa4c11ac094 (integration/mcp-events-20261109) → head 93ba9bf83a7f1e4bd937642ba43b92738d000e68. Before posting I confirmed with gh pr view that the PR head is still 93ba9bf83a.
Reviewer: Claude Opus 5.5, fresh context, read-only. This comment is not an approval and not the hosted Security review. That review is being requested separately.

Scope

  • The full base→head range: upstream v0.1.10 (7d32075e37, the v0.1.10 tag commit and the newest non-prerelease vX.Y.Z tag on pingdotgg/t3code) merged as 173291fed8, then e557ab0a6f (candidate repairs) and 93ba9bf83a (the attachment fix). 980 files changed.
  • In depth: the attachment lifecycle in apps/server/src/orchestration-v2/ProjectionStore.ts (liveForkSources, shownByLiveFork, runAttachmentIds, unshownRunAttachmentIds, getThreadAttachmentIds) and its callers: Orchestrator.ts thread.delete planning, project/ProjectService.ts, and EffectWorker.ts attachment.cleanup.
  • All 13 files of e557ab0a6f.
  • Every non-test merge-resolved hunk of 173291fed8 (git show --cc): ProjectionStore, Orchestrator, OrchestratorMcpService, McpHttpServer, PeerForwarding, thread/project MCP handlers and tools, providerModels, ProviderSessionManager, RunExecutionService, ProviderRuntimeRecoveryService, CodexAdapterV2, ProviderAdapter, ProviderRegistry, ClaudeTextGeneration, ScheduledTaskService, WorkspaceFinderProcess, WorkspaceSearchIndex, Migrations, check-changed. Hunks that are only test edits were read only where e557ab0a6f changed them. Upstream-only hunks that merged cleanly were checked against the fork contracts, not line by line.
  • Run locally at this head:
    • vp test run src/orchestration-v2/runtimeLayer.test.ts src/orchestration-v2/ProjectionStore.test.ts src/persistence/Migrations.test.ts: 3 files, 297/297 passed, including both queued-edit cases (no fork, a live fork).
    • scripts/fork/sync-integration-ci.sh --check: check mode only, writes nothing. It failed; see the second finding.
  • The GitHub checks on the PR are all green, 19/19.

Attachment lifecycle fix (93ba9bf83a): correct

The bug before the fix: runAttachmentIds(..., includeShownByLiveFork=false) filtered row by row. A file was deleted if any row holding it was not shown by a live fork. In the test, source S holds shared in run 1, which an early fork F1 shows, and again in run 3, which a later fork F3 shows. S is deleted, then F3. The cleanup of S skips F3 because it is being deleted. That leaves the run-3 row unshown, so shared was deleted while F1 still shows run 1. The previous head's test asserted exactly that deletion (isFalse(exists)).

After the fix: the filter works by attachment id instead.

  • The candidates are every attachment in the thread ("all").
  • An id is kept if any row holding it, in any run from -1 to MAX_SAFE_INTEGER, is shown by a live fork other than the thread being deleted ("shown", through liveForkSources(threadId, excludedForkThreadId)).
  • Deleting S keeps shared, because F1 and F3 are both live. Deleting F3 keeps it, because F1 shows run 1. Deleting F1 then frees it.
  • The updated assertion at runtimeLayer.test.ts:876 reads the file content. By inspection it would fail on the previous head.

Edge cases checked:

  • Dropping the from - 1 earlier-history subtraction is safe. Every caller passes from = -1 (ProjectionStore.ts:6588, :6597), so that branch was already dead.
  • The includeShownByLiveFork: true reference check that attachment.cleanup uses still returns every attachment in the thread. A queued edit therefore keeps a file that earlier history still shows.
  • Chains of deleted intermediate forks are still covered. The recursive arm of live_sources walks through deleted forks, so a live grandchild keeps an ancestor's rows.
  • fork_run_exclusions snapshots still stop excluded runs from keeping files.
  • Forks read inherited rows from the source thread; they do not copy them (getTimelinePage uses sourceThreadId). So a fork's own rows cannot hold a live source's ids.
  • Cost is unchanged: about one recursive-CTE query set per source, as before. The CTE moved from the candidates query to the retained query.

Migration namespace and fork policy

Migrations comply with FORK.md. I read FORK.md from origin/integration/mcp-events-20261109 in the source mirror; it matches the supplied contract and adds detail.

  • 094_TurnItemMessageOrdinalIndex, 095_TurnItemInlineWorkOutput and 096_RepairStaleTitleRegeneration are byte-identical to upstream v0.1.10.
  • Migrations.ts adds no fork migration to the upstream manifest, and ForkMigrations/ is unchanged (001–017).
  • The upstream-owned inlineWorkOutput SQL predicate that the merge dropped is reproduced by upstream migration 095 and by isInlineWorkOutput (ProjectionStore.ts:2202-2215).
  • e557ab0a6f now runs fork migrations only when hasPendingForkMigrations is true. That check runs before the upstream migrations and is also part of hasPendingMigrations. On a fresh database it is true: readForkHistory returns [] when t3_fork_migrations is missing, so the highest recorded id is 0, below FORK_MIGRATION_HEAD.
  • One caveat: the gate compares only the highest recorded id. It relies on FORK.md's rule never to land a lower id after a higher one. It does not enforce that rule.

Post-merge CI does not comply with FORK.md. See the second finding below.

Findings

P2: a startFromOrigin launch no longer refuses a missing base ref. Up-front validation passes and provisioning quietly uses a different base.

  • Where: apps/server/src/orchestration-v2/ThreadLaunchService.ts:420-422, added in e557ab0a6f.
  • What changed: checkWorktreeBase now succeeds for any startFromOrigin: true base that resolves nowhere, locally or on the remote. Base 78f183a and upstream v0.1.10 both refuse it with ThreadLaunchBaseRefError.
  • Why it matters:
    • checkWorktreeBase is the up-front validation for the web launch (ws.ts:2174) and for MCP t3_thread_launch (mcp/ThreadLaunchMcpService.ts:283).
    • An omitted startFromOrigin takes the project's newWorktreesStartFromOrigin setting (ThreadLaunchMcpService.ts:268-277), so the gap applies even when the caller never sets the flag.
    • A mistyped or deleted base such as origin/release-1.2 is accepted, and the caller never gets "No thread was created".
    • Provisioning (ThreadLaunchService.ts:689-706) then uses worktreeFallbackBase in its place: the remote default branch or the checked-out commit. Work, including stacked work that needs a specific base, starts on the wrong base. The only trace is the setup tracker's baseRef.
    • This contradicts the tool contract "Honor a requested base". It also leaves the startFromOrigin === true branch of worktreeCheckHint (ThreadLaunchMcpService.ts:120-123) unreachable for missing refs.
  • Likely root cause: the provisioning-time checkWorktreeBase call (ThreadLaunchService.ts:637-646, "Scheduled tasks and retries skip the entry points' check") is fork-side; it is already in base 78f183a. Upstream v0.1.10 adds the test "skips a stale tracking ref when the remote reports the base branch is gone", which expects provisioning to fall back. The fork's provisioning check refuses first. Instead of narrowing that collision, e557ab0a6f relaxed the shared check and rewrote the affected tests in ThreadLaunchService.test.ts:
    • Upstream's cases "refuses a new worktree whose base ref has no origin to come from / was deleted on its remote" were removed and inverted into "allows a missing base ref … when HEAD can be used" (about lines 3237-3305).
    • The fork's "a launched worktree whose base is on no remote and not local fails with a clear message" was changed from startFromOrigin: true to false (about line 3197). Scheduled launches with startFromOrigin are no longer covered.
    • In upstream's "skips a stale tracking ref…" (about line 1489), the base changed from main to gone, origin/HEAD now points at a live ref, and the fetch-returns-null stub was removed. The stale default-branch tracking-ref path in worktreeFallbackBase is no longer exercised.
    • FORK.md requires pre-existing tests to pass, not to be rewritten.
  • Suggested direction:
    • Keep the entry-point refusal.
    • At the provisioning-time call only, tolerate a saved base that has since disappeared, for example by catching ThreadLaunchBaseRefError there when startFromOrigin is set, so upstream's fallback still works.
    • Then restore the upstream refusal cases, the fork's startFromOrigin: true clear-message case and upstream's stale-tracking-ref test inputs.

P2: fork-post-merge-ci.yml was not regenerated after ci.yml changed.

  • Where: .github/workflows/fork-post-merge-ci.yml, about line 347.
  • What: the merge changes .github/workflows/ci.yml:329 to add .github/scripts/mobile-ios-preview-record.test.cjs to "Test release checks". The generated workflow was not updated. scripts/fork/sync-integration-ci.sh --check exits 1 with exactly that one-line diff.
  • Impact: post-merge CI on the integration branch will skip that upstream test, and the workflow's first job will warn about drift. FORK.md requires running the generator and committing the result after an upstream merge changes ci.yml.
  • Fix: run scripts/fork/sync-integration-ci.sh and commit the result.

P3: an accepted scheduled run keeps the previous failed status but clears its error.

  • Where: apps/server/src/scheduledTasks/ScheduledTaskService.ts:1305-1306, a merge resolution in 173291fed8.
  • What: the merge combined two rules. The fork's rule keeps previousRun.status until the new run's outcome is known. Upstream's rule sets lastRunError = null on a successful dispatch. After a failed run, the next accepted dispatch therefore stores lastRunStatus: "failed" with lastRunError: null. The base kept previousRun.error alongside the previous status.
  • Impact: the stored record shows a failure with no reason until the new run settles. I did not trace how orchestratorMcpScheduledTaskRunStatus renders that pair, so the user-visible effect is unverified. Low severity.

No other correctness or security findings in the reviewed scope. The merge resolutions keep both sides' intent in these areas:

  • MCP auth and access.
  • PeerForwarding: assertWithinLinkAccess still runs after the coordinator-rollover rewrite.
  • The Orchestrator's fork and delete lock ordering: parent before side chat, with the deletion lock outermost.
  • The workspace finder child process: watchAsync runs inside the child.
  • providerModels: the fork's 12-model cap explains the rewritten expected message.
  • The context budget: mcpToolListJsonBytes 61263 is at or below base's 61317.

One upstream behaviour change is worth knowing about, though it is not a finding on this PR: CodexAdapterV2 now auto-accepts MCP server elicitations in full-access runtime mode, and other declined elicitations now return cancel instead of decline.

Verdict

The attachment lifecycle fix is correct and well tested: deleting the source and then a later fork no longer removes a file an earlier live fork still shows. The migration namespace follows FORK.md.

Two actionable P2 findings and one P3 remain:

  • the ThreadLaunchService base-ref relaxation and its test rewrites;
  • the stale generated post-merge CI workflow, which breaks an explicit FORK.md rule and is a one-command fix;
  • the scheduled-run status/error mismatch (P3).

There are no P0 or P1 findings. Under the loop's finding rules, P2/P3 findings become linked issues and do not hold the merge. The FORK.md CI-generator step is a publication checklist item the owner may prefer to fix in this PR.

@chrisohearn

Copy link
Copy Markdown
Owner Author

Review of record: fallback source review for base 78f183a40d8f9682ffb0bfbf05714aa4c11ac094 → head 416247bd303ff1ce29dc076a083622a1dd82aa1c

The hosted review bots failed on quota or allowance, so this is the required fallback: an independent, read-only review by Claude Opus. FORK.md was read from the base ref. Before posting I confirmed that the PR's head is exactly 416247bd30. All 19 hosted checks pass on that head.

Verdict: no blocking findings. The three earlier findings are fixed. One P3 test-coverage finding is listed below; it does not block the merge.

Earlier findings

  1. Missing startFromOrigin refs (fixed). In ThreadLaunchService.checkWorktreeBase (ThreadLaunchService.ts:408-424), a missing base is accepted only when the new allowMissingOriginBase is set and a remote resolved.
    • Only provisioning sets it (:640-647).
    • The user-facing entry points call the check without it: ws.ts:2174 and ThreadLaunchMcpService.ts:283. A missing origin ref is refused there, including one deleted on its remote. Test: "refuses a new worktree whose origin base…".
    • Without a remote, remote === null, so a missing ref still fails at provisioning before git worktree add. Test: "a launched worktree whose base is on no remote and not local fails…", which now uses startFromOrigin: true.
    • I checked the real GitVcsDriverCore.resolveWorktreeBaseRemote. It returns {origin, <branch>} for both a bare main and origin/development when an origin remote exists, so the provisioning fallback is reachable in production.
    • Coverage: "re-bases a stored base that no longer exists" runs against a real Git repo and remote. "skips a stale tracking ref when the remote reports the base branch is gone" is restored to upstream's case: main, a completed fetch that finds nothing, and origin/HEAD pointing at a stale ref.
  2. Generated CI workflow (fixed). scripts/fork/sync-integration-ci.sh --check passes on an export of the head tree. The only difference was the added mobile-ios-preview-record.test.cjs. ci.yml differs from upstream v0.1.10 only by the fork's existing runs-on overrides.
  3. Retained error (fixed). ScheduledTaskService.ts:1305-1306: an accepted dispatch keeps previousRun.status and previousRun.error, and the follower records the real outcome later. This puts back the base behaviour that the merge resolution had dropped. The test asserts that the second runNow reports failed / "The run failed." until the run settles as succeeded with a null error.

Other checks

  • Attachment retention is correct.
    • In 93ba9bf83a, the candidates are the thread's attachment ids, minus any id that a row shown by a live fork holds. That is stricter than the base, which removed rows rather than ids.
    • Every caller passes from = -1, so dropping the earlier-history subtraction changes nothing.
    • For deleted ancestors, excludedForkThreadId leaves out the fork being deleted.
    • In runtimeLayer.test.ts, the shared file survives the deletion of threadId and of laterForkId, and is removed once the last live fork is deleted. Both the retention side and the leak side are covered.
    • The attachment.cleanup reference check still uses includeShownByLiveFork: true.
  • Migration namespaces are unchanged.
    • apps/server/src/persistence/Migrations/ is byte-identical to upstream v0.1.10 (095 and 096 come from upstream).
    • ForkMigrations/ and ForkMigrations.ts are unchanged from base, so fork ids stay in t3_fork_migrations.
    • Migrations.ts differs from upstream only by the fork hooks. Fork repair and fork migrations now run only when hasPendingForkMigrations is true, which is equivalent because the runner applies only pending migrations.
  • Merge resolution of 173291fed8, checked with --remerge-diff. I read the conflict hunks in the following files. Each keeps both sides' intent, and no fork-only file under scripts/fork, .github, persistence, mcp or scheduledTasks is deleted.
    • McpHttpServer (layerMcpAuthMiddleware and the MCP events protocol are kept)
    • OrchestratorMcpService / providerModels
    • thread/handlers and thread/tools (lastRunError is added beside the fork's run status)
    • CodexAdapterV2 (adopts upstream's removal of the interrupted guard)
    • ProviderAdapter, ProviderSessionManager and ProviderRuntimeRecoveryService
    • PeerForwarding (keeps assertWithinLinkAccess)
    • Orchestrator (fork lock order: the parent's lock before the side chat's)
    • ProjectionStore (upstream's isInlineWorkOutput covers the fork's delegate_task / send_to_user patterns)
    • Migrations
  • The other e557ab0a6f test edits match the source.
    • Model hint cap: the fork lists 12, so the test now expects all 10 models.
    • Image search: an extension glob with pageSize set to limit + 1.
    • The in-process finder uses .call.
    • agentContextBudget.json was re-measured to 61263, below the base's 61317.
  • Recorded divergence, not a finding. Upstream fix(server): re-base worktree launches whose recorded base ref does not resolve pingdotgg/t3code#31747's base fallback is now unreachable for a saved strategy without startFromOrigin: true whose ref is missing while HEAD exists. Such a launch fails at provisioning. That matches the fork's rule that a missing ref with no origin still fails.

Findings

  • P3 · test-coverage: apps/server/src/scheduledTasks/ScheduledTaskService.test.ts:610 ("a run still going when the next one starts cannot overwrite the newer run").
    • What changed: 416247bd30 rewrote this test so the first run settles before the second runNow.
    • Impact: The overlap the test is named for no longer happens: an older run's follower ending while a newer run is pending. The pendingRuns/last_run_at guard in recordRunOutcome therefore has no regression test.
    • Evidence: At base, the test started both runs, ended the first, and asserted {status: "never", since: second.task.lastRunAt}. Reading the head code, that assertion should still hold. The first follower's write is skipped because the second run is the pending one, and the second run's acceptance records previousRun.status = never.
    • Fix: Restore the overlap case, and keep the new retained-error assertions as a separate test.
    • It does not block the merge; it will become a linked issue.

The fallback reviewer has no approval role here, so this review neither approves nor merges the PR.

@chrisohearn

Copy link
Copy Markdown
Owner Author

Review of record: fallback source re-review for base 78f183a40d8f9682ffb0bfbf05714aa4c11ac094 → head 396d5e1365e1813ec625dc2dd17c7589352e741f

The hosted review bots are quota-limited and were not re-requested, so this is the fallback review: a fresh, independent, read-only review by Claude Opus. I read FORK.md from the base ref. Before posting, I confirmed that the PR still targets integration/mcp-events-20261109 at 78f183a40d with head 396d5e1365. The previous review is here (head 416247bd30).

Verdict: no findings remain. The P3 coverage finding from the previous review is fixed, and the three earlier findings are still fixed. When I posted, 15 hosted checks on this head had passed, none had failed, and Test, Test Server 6, Test Web 2 were still running.

New delta (416247bd30..396d5e1365)

  • It changes only one file, apps/server/src/scheduledTasks/ScheduledTaskService.test.ts. git diff 416247bd30 396d5e1365 shows no source or other non-test changes.
  • The retained-error regression is renamed to "a prior run's error remains visible while the next run is pending" (:612). Its body is unchanged.
  • "a run still going when the next one starts cannot overwrite the newer run" (:712) is restored as its own test. Its body is byte-identical to the base version.

The restored overlap test exercises the overlap

  • Sequence. The first runNow is accepted, and its follower blocks in waitForThread(run:0) on endFirst. TestClock.adjust("1 minute") runs, then the second runNow makes t+1m the pending run. The test subscribes and takes the initial snapshot, and only then releases endFirst. So the older run settles as failed while the newer run is still pending.
  • Why the first notification is the one asserted. followRunOutcome notifies in its ensuring block even when recordRunOutcome skips the write (ScheduledTaskService.ts:1046). The first change after subscribing is therefore the older follower's end. The test asserts {status: "never", since: second.task.lastRunAt}, then releases endSecond and asserts succeeded, a null error and no runInProgressSince.
  • Mutation checks, run on a scratch export of the exact head:
    • With the pending-run guard (:966) and the last_run_at guard in recordRunOutcome both removed, the overlap test fails: it receives status: "failed" where it expects "never". So it catches an older run overwriting the newer pending status.
    • With clearPendingRun no longer checking which run is being cleared (:953), it fails: since is undefined where it expects t+1m. So it also guards the in-progress marker.
    • With an accepted dispatch no longer keeping the previous status and error (:1305-1306), the retained-error test fails: it receives never / null where it expects failed / "The run failed.".
    • Removing either guard alone leaves both tests passing (I ran both single-guard mutations), because the other guard still blocks the write. That is defence in depth, not a gap.
  • Unmodified head: ScheduledTaskService.test.ts passes 38/38 and ThreadLaunchService.test.ts passes 71/71.

Earlier findings (still fixed)

The source is identical to 416247bd30, and I re-checked each fix on this head:

  1. Strict missing-origin-base check. ThreadLaunchService.ts:423 accepts a missing base only when allowMissingOriginBase is set and a remote resolved. That case is a startFromOrigin base that the remote fetch and the local ref lookup both failed to find. Only the worktree provisioning path sets the flag (:640-643). The user-facing checks at ws.ts:2174 and ThreadLaunchMcpService.ts:283 don't pass it, so they stay strict.
  2. Current generated post-merge CI. scripts/fork/sync-integration-ci.sh --check exits 0 on an export of the head tree. It compares content: the script diffs its generated output against fork-post-merge-ci.yml. As a negative control, I changed one runs-on in ci.yml and the check exited 1.
  3. Previous error kept while the next run is pending. ScheduledTaskService.ts:1305-1306 keeps previousRun.status and previousRun.error for an accepted dispatch. The renamed test and mutation M3 above cover it.

Findings

None.

The fallback reviewer has no approval role, so this review neither approves nor merges the PR.

@chrisohearn

Copy link
Copy Markdown
Owner Author

Upstream sync: merges pingdotgg/t3code upstream v0.1.10 (7d32075) (7d32075, 418 commits) into integration/mcp-events-20261109.

Format, lint, typecheck, server tests, the container release build with its smoke test, and the service preflight against the live database passed. Prepared release candidate v0.1.10-preview.20261119.1; publication follows a successful merge.

🤖 Generated with Claude Code

@chrisohearn
chrisohearn merged commit 7ab0382 into integration/mcp-events-20261109 Nov 19, 2026
19 checks passed
@chrisohearn
chrisohearn deleted the sync/upstream-20261117-1650 branch November 19, 2026 01:42
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.