Skip to content

Sync fork onto upstream's released orchestrator v2 #5

Closed

Description

@tannerpolley

Goal

Rebase this fork onto upstream T3 Code's released orchestrator v2 (squash de34391427, PR pingdotgg#2829, 2026-10-02) and the commits after it. Re-apply the fork's own work on top.

  • Fork base: an early snapshot of that PR (2341c5a680, ~2026-09-21) plus 163 fork commits (355 files, +40k/-3k).
  • Upstream reference: upstream/main at the time of planning was 51f7f77f87.

Decisions (2026-10-05)

  • Rebuild on upstream. Create the new branch sync/upstream-v2 from upstream/main. Port the fork's features back in priority batches and test each batch. The current fork build (v2.8.34.17) keeps running until the new build passes on a copy of the real database.
  • Upstream's version wins:
    • the shell code-block run button;
    • the "Working" sidebar section, which replaces the fork's needs-you-first switch.
  • The fork's version wins:
    • subagent and background rows stay in the sidebar;
    • the waiting spinner stays amber.
  • Pi is paused. Don't port the fork's Pi adapter work (per-turn usage, shared instructions, tool deferral, background jobs). Keep upstream's Pi as-is.
  • Turn off upstream update offers in fork builds.
  • Drop fork changes that upstream now covers:
    • servers kept out of the waiting state (upstream's backgroundWorkHoldsCompletion);
    • the restart/resume fixes;
    • failing a run when the provider never starts;
    • cross-project thread read and prompt;
    • the client half of background-work waiting.

Batches

0. Foundation (must land before any build touches real data)

  • Migration ledger. Rename the fork's 056_ProjectionMessagesLatestAssistant to 057. Extend the preview reconciler for the fork's exact ledger, in one transaction: move 56→57, 55→56 and 54→55, then apply upstream 054 AutoSettle. Reject unknown collisions. Add focused tests.
  • Keep fork-persisted fields that upstream's schemas would strip.
    • Thread fields: titleSource, titleEvaluation.
    • settledDeliveryCount.
    • Turn-item phase.
    • Project folder icon flag.
    • responseCapability: app_owned.
    • Notification source.nativeRef.
    • Background-task details (taskType, startedAt, commandKind), mapped onto upstream's kind union.
    • Server settings: modelRoles, idleAgentSessionMinutes.
    • Client settings: chatMath, projectsView, codexStyleSidebar, issuesPage, pluginSkills, lineageAutoClearMinutes.
  • Event-store growth.
    • Schedule compactEventStore hourly.
    • Keep only the first and newest turn-item.updated.
    • Prune superseded streaming snapshots.
    • Set a 1 s shell coalescing window.
  • Build. Disable the upstream auto-update feed. Make the Linux build produce an AppImage only (no .deb/fpm).
  • Rehearsal. Run migrations, a full event decode and a projection rebuild on a VACUUM INTO copy of the live statev2.sqlite.

1. Sidebar Projects view

Fork's version of each:

  • Sections and subsections, folder colours and icons, organize by folder, drag-to-chat, add/remove/new project, reveal the open thread, Back button.
  • Subagent and background rows, status marks, columns and times. These stay in the sidebar.
  • Top-level thread rows in the Projects view use the same tighter spacing as subagent rows.
  • Amber waiting spinner. Fix the failed turn that shows as "idle".
  • Lineage panel: model and effort, expandable rows, clear finished, shells, fork/parent rows. Reconcile with upstream's subagentDisplay.ts.

2. Chat and pages

  • LaTeX/KaTeX; fenced code blocks in the composer; host media display and limits; the "Worked for" fold keeping substantial messages (needs the phase field).
  • Usage: model share across limit windows, Limits page layout, sidebar daily meter. Adapt to upstream's UsagePage rewrite.
  • Issues browser ([Feature] GitHub Issues panel with milestone grouping #4). Add RPC scope entries.
  • Customizations page and plugins list.
  • Codex settings import in the welcome wizard.
  • Branch picker groups.
  • Plugin skills in the $ menu.
  • Answer questions from any thread, plus notification fixes.
  • Agent browser in the side panel.
  • Preview fixes: reload, 3-tab cap, preview_open by path, port scanner.
  • Short model names.
  • Title regeneration feedback.

3. Delegation and fixes

  • Model roles: settings, MCP and UI.
  • delegate_task worktree option. Adapt to the reshaped ThreadLaunchService.
  • Shared user-question tool (t3_request_user_input).
  • Child-question wake; waits return when a child asks a question.
  • A resumed delegated child reports back.
  • Held early steer.
  • Codex subagent wake, rebuilt on upstream's backgroundWorkNotification.
  • Shutdown signal (SIGTERM) handling.
  • Claude: context window from the fetched catalog; wake-turn leftovers. Port the tests first and keep only the code whose tests fail.
  • Delegated results after background wake turns (9f855bbbba), only if its tests fail on upstream.
  • Native-subagent child status, only if its tests fail on upstream.
  • Subagent effort label.
  • Auto-retitle.
  • Idle-session timeout setting; unload finished native Codex subagents.
  • Agent instruction text: images, document links, math.
  • Claude plugin skills and the health-check probe fix.

4. Background-work panel (later)

5. Cutover

  • Fresh rollback snapshot: database, settings, secrets, provider credentials, attachments and desktop profile (~/.t3/backups/pre-v2.9.0-20261005-154746, 9.1 GB).
  • Build v2.9.0, swap it in, verify (cutover.sh, 2026-10-05).

Notes

  • Hot files rewritten upstream: Orchestrator.ts, ProjectionStore.ts, ws.ts, OrchestratorMcpService.ts, Sidebar.tsx, UsagePage.tsx. Port these by re-implementing the features, not by resolving conflict hunks.
  • Removed upstream:
    • v1 apps/server/src/orchestration/ and contracts/orchestration.ts.
    • About a dozen web helpers.
  • New upstream requirements:
    • Every RPC now needs a scope entry.
    • New shadcn lint rules restrict restyling components/ui.

Activity

  1. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Follow-up features to start once this sync lands: #6 (Issues list in the side panel) and #7 (worktree icon on child threads).

  2. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Batch 1 addition (user request, 2026-10-05): in the Projects view, give top-level thread rows the same tighter spacing as subagent rows.

  3. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Batch 0 merged into sync/upstream-v2 (076a041..62bb276). Rehearsal on a copy of the live database:

    • Ledger reconciled 54–57; second run was a no-op.
    • 709,831 events decoded with 0 failures.
    • Projection rebuild valid; counts unchanged (1,306 threads, 21,503 messages, 200,212 turn items).

    Running now:

    • Batch 1: sidebar.
    • 2a: chat rendering.
    • 2b: Usage, Issues, Customizations.
    • 2c: smaller UI and preview.
    • 3a: orchestrator and adapter fixes.
    • 3b: model roles, worktree option, question tool, auto-retitle.
  4. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Batch 1 merged into sync/upstream-v2 (5c1023a, plus cleanup 07d7ab2).

    • Projects rows at both levels are 24 px.
    • Amber waiting spinner restored; a failed latest run now takes precedence over idle.
    • The lineage panel is ported.
    • activityNeedsYouFirst dropped.
    • Background output, Stop and terminal follow are deferred to Batch 4.
    • Checks: 513 focused tests, the web typecheck and targeted lint all passed.
    • Needs a UI pass at integration.
  5. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Batch 2a merged (cc4d80f): LaTeX, composer code blocks, host media, the Worked-for fold with Codex phase, and agent instruction text. The shell run button was dropped (upstream's kept). The merged web typecheck after Batches 1 and 2a is clean. The chatMath and composerCodeFormatting toggles come with 2b's Customizations page.

  6. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Merged into sync/upstream-v2:

    • Batch 3b (13a307a): model roles, the delegate_task worktree option, t3_request_user_input and auto-retitle.
    • Batch 2b (Usage model share and meter, Issues browser, Customizations page) and Batch 2c (Codex settings import, branch groups, plugin skills, questions from any thread, agent browser in the panel, preview fixes, short model names and durations), merged as e148816.

    At integration I resolved 7 additive conflicts and made the task result's branch/worktreePath default to null for older results (36f436e).

    Running now:

    • Batch 3a (orchestrator and adapter fixes).
    • A small integration pass: Customizations rows for the 2c/3b switches, mounting the Model roles section, the sidebar time column and short names in Lineage.
  7. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Merged Batch 3a (5fb8115, 14 commits) and the integration pass (62fb222). The fully merged branch typechecks with 0 errors in contracts, server and web; the conflict-area tests pass (83). SIGTERM was dropped as already covered upstream (its regression test is kept). The idle agent timeout is back as a setting, default off.

    Next:

    • A read-only GPT-6.1 Sol review of the Opus-built batches.
    • Batch 4 (background-work panel).
    • UI pass and cutover.
  8. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Added to the sync (user request, 2026-10-05): a delegated child can no longer t3_thread_send to its parent or ancestors mid-task, because each send wakes the orchestrator. Children report in their final message; decisions go through the question tool. The global rule is reworded to match.

  9. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    Added (user, 2026-10-05): the daily usage meter becomes a compact readout in the sidebar Usage button, like the weekly 7d 75% one. A new optional 5h readout covers Claude's 5-hour window. The format is 5h / 1d / 7d with the percent left. Hovering shows the details and reset times.

  10. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    UI pass and second Sol review (2026-10-05). Fixes are in progress.

    Found in the hands-on pass (dev server on a seeded copy, default 256 px sidebar):

    • The Projects view rows give the title 0 px: a fixed 127 px trailing column plus the model label.
    • Project names truncate to about 3 characters.
    • Short model names are not applied in Projects rows.
    • Claude mattpocock-skills shows 0 skills in the Plugins list.
    • Model roles say providers aren't enabled.
    • The browser panel went blank and stopped responding after opening /settings/providers. The cause isn't determined yet; it needs a recheck.

    Found by the Sol review:

    • The queue edit and promote tools bypass the child-to-parent guard.
    • Pooled daily usage mixes budgets across accounts.
    • The usage button overflows the footer.
    • The daily tooltip shows a wrong reset time.
    • A broker regression test was dropped.

    Deferred (needs a provider-boundary design): native Codex/Claude subagents inherit the parent's MCP identity, so the ancestor guard can't see them.

  11. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    v2.9.0 built from sync/upstream-v2 @ a327793 (0.0.45-v2.9.0, AppImage). Full typecheck is clean. Cutover approved by the user (2026-10-05): ~/.local/opt/t3-code/server/cutover.sh.

    • Stops t3code-fork.service and backs up the database, settings, secrets and desktop profile to ~/.t3/backups/pre-v2.9.0-*.
    • Switches to v2.9.0 and starts it. The migration ledger is reconciled on first start.
    • If v2.9.0 fails to start, it restores v2.8.34.17 and the backed-up database.

    The v2.8.34.18 hotfix was cancelled (its fix is in v2.9.0). Follow-up in progress: server CPU and hot SQL under about 10 agents.

  12. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    The cutover finished at 15:48: v2.9.0 is live. The backup is ~/.t3/backups/pre-v2.9.0-20261005-154746 (9.1 GB).

    Follow-ups:

    • Issues list opens in the side panel #6 (issues list in the side panel) is now in progress.
    • Bug from the user's recording: the thread details card overlaps the chat when the right panel is open. A fix is in progress.
    • The server CPU and hot-SQL work resumed after the restart.
  13. tannerpolley commented on Oct 5, 2026

    @tannerpolley
    OwnerAuthor

    v2.9.1 is built from sync/upstream-v2 @ b6ae77a and installs automatically when agents are idle (via cutover.sh, with backup and rollback). It contains:

    • The bounded-SQL performance fix: -32% main-thread CPU in a replay of 10 agents, plus migration 058 ProjectionTurnItemCounts.
    • SQLite synchronous=NORMAL (approved by the user).
    • Issues list opens in the side panel #6: the issues list in the right panel (key I, command palette "Show issues beside thread").
    • Fix: the thread details card no longer covers the chat when the right panel is open (docks while a 400 px chat lane fits).
    • Fix: "Show more" in Issues no longer collapses the card to a stub.

    Server, web and contracts typecheck clean; the persistence tests pass (62).

  14. tannerpolley commented on Oct 6, 2026

    @tannerpolley
    OwnerAuthor

    Done. The fork's main is now the upstream-based sync/upstream-v2 (466acd8, force-updated 2026-10-06 with the user's approval). The old main is kept as archive/main-pre-upstream-v2 (31a0fb3). The background-work panel moved to #10. The live server runs v2.9.0; v2.9.3 installs when agents are idle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions