Skip to content

fix(server): preserve V2 project lifecycle across transports - #9920

Open
saphid wants to merge 388 commits into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:fix/v2-project-lifecycle-20260905
Open

fix(server): preserve V2 project lifecycle across transports#9920
saphid wants to merge 388 commits into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:fix/v2-project-lifecycle-20260905

Conversation

@saphid

@saphid saphid commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Project mutations could lose supported fields over HTTP and offline CLI, while V2 deletion could replay the wrong receipt, fail permanently after a rejected child command, or race a new thread commit. Share field mapping across transports, validate parent receipt type/aggregate, use fresh child command IDs on retry, and guard project/thread commit ordering in SQLite. Recover legacy accepted project receipt types only from the matching durable result event.

Rebuilt head 9bc3afa86 on V2 3aa47e294, including the test-only prerequisite #10865 (merge first). Keep Julius’s shared deletion planner and cleanup. Topic spans 13 files.

Validation: 32 focused project mutation/deletion, HTTP, CLI, receipt and thread-deletion tests pass. Server typecheck and formatting pass; targeted lint exits 0 with an existing unused threadBackgroundLiveness advisory. New CI pending. Direct Claude Opus 5 high review remains unavailable: latest launch exited 1 due to expired OAuth before inference.

Targets V2 #2829. Updated with GPT-6 in Codex/T3.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Sep 5, 2026
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from 877b9de to b82facd Compare September 5, 2026 04:52
Comment thread apps/server/src/project/ProjectMutationThreads.ts Outdated
Comment thread apps/server/src/project/ProjectService.ts
@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This PR is too large for Bugbot to review. It changes 99,214 lines and 4,021,163 characters. Split the change into smaller pull requests to get a review.

@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies.

@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Sep 5, 2026
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from b82facd to 2ac9bfe Compare September 5, 2026 04:56
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes production lifecycle, deletion-cascade, receipt-replay, and transport behavior across several server subsystems, including gates around project deletion and thread creation. An unresolved high-severity concurrency concern remains around stale project projections allowing threads to attach to deleted projects.

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@saphid
saphid force-pushed the fix/v2-project-lifecycle-20260905 branch from 568ca7c to 8cc6348 Compare September 5, 2026 05:11
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Sep 5, 2026
Comment thread apps/server/src/project/ProjectMutation.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8cc63487e475b89e6416f622f0efac36c9206226. Configure here.

Comment thread apps/server/src/project/ProjectMutation.ts Outdated
Comment thread apps/server/src/project/ProjectMutation.ts Outdated
Comment thread apps/server/src/project/ProjectMutationThreads.ts Outdated
Comment thread apps/server/src/project/ProjectService.ts Outdated
@saphid
saphid force-pushed the fix/v2-project-lifecycle-20260905 branch from 1bd11aa to 72f1ed4 Compare September 5, 2026 05:54
@saphid

saphid commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Rebased and reduced this PR onto Julius’s b9fa1399c project-deletion implementation. New head: 72f1ed4ac. The duplicate deletion planner/facade is removed; the remaining delta preserves transport fields, validates parent receipts, retries rejected children with fresh IDs, and guards both project/thread commit orders. The earlier race/retry fixes remain covered on this new implementation. All 16 focused tests, prepared server typecheck, and targeted lint pass.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Sep 5, 2026
Comment thread apps/server/src/orchestration-v2/EventSink.ts Outdated
Comment thread apps/server/src/orchestration/Layers/OrchestrationEngine.ts Outdated
Comment thread apps/server/src/orchestration/Layers/OrchestrationEngine.ts
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch 2 times, most recently from 9242b91 to 3d81172 Compare September 8, 2026 03:31
juliusmarminge and others added 5 commits September 7, 2026 23:12
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
- Re-route steering that races completion into idempotent follow-up dispatches
- Preserve scheduled-task attribution and provider ownership history across clients
Port main's pull-request discovery, active thread ordering, async question dismissal, settlement fixes, provider-session import, attachment context, and provider correctness changes into orchestration v2.

Keep the branch's intentional composer and subagent behavior while adopting main's web and mobile fixes. Prevent headless setup terminals from hanging on the color probe, and move the v2 migration block to 050-061 after main claimed 048-049.
Restore the failed-before-start timer guard, align two server fixtures with the reconciled behavior, and remove dead files, exports, and dependencies surfaced by Knip.

Drop the temporary branch push trigger now that the PR is mergeable, so each update runs the pull-request workflow once.
Keep main's batch machine-update banner and update action while preserving the v2 runtime-based environment lock used by draft load balancing.
Adopt TypeScript 7 and Effect rc.112 across orchestration v2, including the TaggedError API migration and updated Effect-aware tests. Restore main's composer-aware scroll-to-end clearance while retaining selected-model settings sync, preview recording transfer, image galleries, desktop context menus, and layout hit targets. Regenerate the lockfile on the upgraded dependency baseline.
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from efd9994 to 6102d00 Compare September 8, 2026 06:23
juliusmarminge and others added 9 commits September 8, 2026 14:26
Advertise bounded socket snapshots and authoritative dispatch validation, omit raw command output and inline file bodies at the wire boundary, and preserve compact status metadata across web and mobile. Add transport-budget coverage for snapshots, resume, commands, legacy import, and projection maintenance.
Restore pinned-thread shelf classification, server-owned unread state, hidden-subagent-safe project ordering, guarded jump hints, draft upload cleanup, and active-provider archive guards across the current and legacy sidebars.

Bring the surrounding current-main sidebar work forward as well: canonical project favicons, stable row layout, thread file drops, account-aware mobile provider badges, and deferred desktop keyring loading.
@saphid
saphid force-pushed the fix/v2-project-lifecycle-20260905 branch from 8cf9f83 to 9bc3afa Compare September 9, 2026 00:59
Comment thread apps/server/src/orchestration-v2/EventSink.ts
@juliusmarminge
juliusmarminge force-pushed the t3code/codex-turn-mapping branch from 8187b17 to ada72ce Compare September 9, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants