Repository navigation
fix: integrate upstream checkpoint 120fab18d84f - #100
Merged
Merged
Conversation
) Append terminal history incrementally and materialize text for snapshots and coalesced disk writes. Clear evicted line references without changing retained output. Continues [pingdotgg#9357](pingdotgg#9357). The original contribution and author credit are preserved. The current line limit and wire format stay unchanged. A strict byte limit remains separate work. Created with GPT-6 Astra (preview) in Codex. Co-authored-by: will <will@moondiner.com>
Keep bounded, byte-counted terminal chunks and append only unread output. Use UTF-16 cursors so compaction preserves live terminal replies. Reset on lifecycle changes or a real retained-data gap. Keep the existing wire protocol, native buffer interface, and client retention limit. Native streaming and strict server replay byte bounds remain separate. Continue the client helpers from pingdotgg#9027 at source head 9391da2b48439d1d7a2b01d169e785682bf8abb8. Created with GPT-6 Astra (preview) in Codex. Co-Authored-By: Wout Stiens <71498452+StiensWout@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
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.
Integrate upstream checkpoint 120fab1 (18 commits, pingdotgg#9132 through pingdotgg#9625) into Lecturn, merged with current main (v0.0.50: Copilot provider, session import, notes, Contextual, multi-account Connect, Stave archive/restore).
Upstream adds provider turn token-usage measurement (ProviderService, Claude/Codex/OpenCode adapters, providerRuntime contracts, AnalyticsService turn events, telemetry docs) and the September 4 performance sweep: checkpoint summaries via numstat without full patches (drops @pierre/diffs from apps/server), diff workers deferred until a code view opens, self-hosted marketing fonts, incremental terminal history (BoundedTerminalHistory), one query for buffered provider events, relay activity-row decoding, removal of the continuous chat status shimmer/spinner/ultrathink animations, terminal buffer rollover without replay, cheaper threadShell updates, and LiveStreamBudget bounding slow-client event buffers in ws.ts. Fixes: mobile outbox/draft recovery after storage read failures, pull request link preview cards in chat markdown, open PRs no longer block inactivity settlement, provider settings placeholder layout for disconnected devices, and the slash menu shrinking when vertical space is short.
Fork behavior deliberately kept where upstream would change it:
Upstream-merge conflicts (16 files) were resolved keeping fork behavior: runtimeFence.withStart and forked-child cursor suppression in ProviderService, the Stave memory MCP block in CodexAdapter, the fork-indented terminal Manager with BoundedTerminalHistory applied by hand, and the fork's findChangeRequestTarget for PR targets (ChatMarkdown's PR preview resolves through it). Upstream identity strings on added lines were translated to Lecturn.
Merging current main produced three conflicts:
data-slot="settings-section-card". The new disconnected-device placeholder card also gets that slot so it matches main's glass section cards.Also: a duplicate
Deferredimport in OpenCodeAdapter.test.ts (added by both sides) is removed, and docs/internals/product-analytics.md lists GitHub Copilot among providers whose token usage staysunavailable. The batch adds no migration. The other 39 files changed on both sides merged with both deltas intact (two-direction diff comparison), and main adds no diff render site outside a DiffWorkerPoolProvider and no consumer of the removed animations.Verification on this tree: typechecks pass for server, web, client-runtime, contracts, shared, relay, desktop, scripts and mobile. Tests pass: server focused set 939, plus the whole provider/orchestration/checkpointing/vcs/terminal/telemetry directories (2,203 passed, 8 skipped); web 200; client-runtime 31; contracts 11; mobile 102; relay agentActivity 170. vp fmt --check, targeted vp lint (warnings only, existing react rules) and the unscoped whitespace check pass. The lockfile installs with --frozen-lockfile.
UI evidence (before = current main, after = this merge; isolated seeded homes):
The connected Providers page was also compared: its section cards have the same size and glass style on both sides. The slash-menu screenshots list Codex skills discovered on the capture machine.
Not exercised: live provider turns (token usage and its composition with work admission are covered by unit tests only), terminal rollover and diff-worker first paint (no stable visual), mobile outbox recovery (state-only), desktop and mobile native builds. Known later upstream follow-ups pingdotgg#9777/pingdotgg#9799 (LiveStreamBudget accounting, outbox partial-read recovery, restored spinners) are outside this window and not hand-ported; a single oversized event (such as a large fork or import history) can fail a live subscription once before the client resumes through replay.
🤖 Generated with Claude Code
Integrates 18 upstream commits through
120fab18d84f1eb993ecc7fa858a8dd212747079. 18 newly reachable first-parent commits (accepted dab5f6e..120fab1, upstream pingdotgg#9132 through pingdotgg#9625), 9,910 changed source lines excluding .repos (pnpm-lock adds 3), under the 50-commit / 15,000-line limits with headroom; all 30 candidates are one linear chain and the accepted checkpoint is an ancestor of fork HEAD. Scope: the token-usage feature pingdotgg#9132 (ProviderService +485, Claude/Codex/OpenCode adapters, contracts providerRuntime, AnalyticsService, telemetry docs) plus the Sep 4 perf sweep (pingdotgg#9694 checkpoint summaries without full patches and @pierre/diffs removal from apps/server, pingdotgg#9692 deferred diff workers, pingdotgg#9701 local marketing fonts, pingdotgg#9703 incremental terminal history, pingdotgg#9706 single buffered-provider-event query, pingdotgg#9708 relay activity rows, pingdotgg#9709 chat status animations, pingdotgg#9707 terminal buffer rollover, pingdotgg#9716 threadShell, pingdotgg#9715 slow-client LiveStreamBudget/ws.ts) and small fixes (pingdotgg#9710 mobile outbox recovery, pingdotgg#9631 PR link preview, pingdotgg#9610 settlement of PR threads, pingdotgg#9720 test, pingdotgg#9619 provider settings layout, pingdotgg#9625 slash menu). Why stop at 18: the next four are the heaviest fork collisions in the window and form their own natural chunk (19-30, ~5k lines): pingdotgg#9721 deletes mobile provider setup (delete-vs-modify on ~10 fork-edited files incl. the fork's usesCustomAntigravityBinary helper and its tests, plus fork-edited remote-access/antigravity docs), pingdotgg#9713 builds on pingdotgg#9710's composer-draft changes, pingdotgg#9726 is a second ws.ts/OrchestrationEngine/EventStore rewrite on top of pingdotgg#9715 where the fork's OrchestrationEngine.ts diverges by 223 lines, pingdotgg#9725 rewrites session-logic/MessagesTimeline. Taking all 30 would land at 14,882 lines, within 118 of the limit. Follow-ups verified: no commit in 19-30 fixes anything in 1-18 (pingdotgg#9739 fold tweak, pingdotgg#9743 header menu, pingdotgg#9738 OpenCode cache are independent). Known upstream follow-ups that cannot travel with any selection from this window: pingdotgg#9777 (position 67) and pingdotgg#9799 'restore UX after performance improvements' (position 101) later patch pingdotgg#9697/pingdotgg#9692/pingdotgg#9709/pingdotgg#9710/pingdotgg#9715 (LiveStreamBudget should charge projected payloads not raw tool output; outbox partial-read recovery; spinners/shimmer restored; DiffWorkerPool reuse); the fork already carries pingdotgg#9669's stale-HTML caching state from the last batch that pingdotgg#9799 also fixes, so this is a continuation of accepted intermediate state; reviewers should flag, not hand-port. Expected conflicts (hunk-range intersection against fork divergence; merge-tree unavailable, sandbox blocks temp files): ProviderService.ts (imports line 33; upstream one-line insert ~792 inside the fork's rewritten 773-844 region; upstream adds ~350 lines of usage measurement next to the fork's session plumbing), CodexAdapter.ts (same-anchor inserts at ~104 and ~2065), terminal Manager.ts (upstream one-line hunks at 2163/2224/2233 and 2538-2611 inside fork-rewritten 2146-2265 and 2555-2663; fork diverges 447 lines), ThreadLiveEventCoalescer.ts and ThreadTerminalDrawer.tsx (identity import line), ChatView.tsx (~182 adjacent to fork edit), openPullRequestLink.ts (upstream 288-294 adjoins fork 295-296), marketing index.astro (fork-owned, keep ours; pingdotgg#9697 moot) and Layout.astro (take upstream local-font links), pnpm-lock.yaml (regenerate; Diffs.ts is the only remaining @pierre/diffs import and upstream rewrites it), identity: 9 added lines carry upstream product strings (4 'T3 Code' in the new docs/user/telemetry.md and product-analytics.md) to translate to Lecturn. Likely auto-merged but needing semantic review: ws.ts (upstream 930, 1411-1490, 1554-1656 vs fork's +334 block at 1184 and 2399-2417), ProjectionSnapshotQuery.ts (upstream +34 at 1040 vs fork Stave lifecycle/thread-fork queries), GitVcsDriver.ts (upstream summary flags vs fork worktree ref-counting), CheckpointReactor.ts, MessagesTimeline.tsx, index.css, DiagnosticsSettings.tsx, DiffPanel.tsx, ThreadSettlementReactor.test.ts. Review plan by subsystem: (1) server provider usage measurement with fork thread-fork session set/resume plumbing and contracts; (2) server checkpoint summaries/VcsDriver with fork worktree ref-counting; (3) server terminal history vs fork Manager changes; (4) server projection/ingestion single query vs fork lifecycle projector; (5) server live-stream budget and ws.ts with server.test.ts, noting pingdotgg#9799's projected-payload accounting; (6) settlement policy change; (7) web: diff worker deferral, status animation removal, terminal rollover, PR link preview, provider settings layout, slash menu (UI before/after evidence for diff/PR code tab, composer status, PR preview card, disconnected provider card, slash menu); (8) client-runtime threadShell/terminalSession with mobile use-terminal-session; (9) mobile outbox recovery; (10) relay AgentActivity; (11) marketing fonts with fork-owned pages.Fresh independent review approved tree
d580a576fa00ef55207bf1ee392026b2ffb7c970after controller-rerun focused checks. Merge commit required; no squash/rebase.Before:

After:

live-activity-before-3036cbe2r4-1791180770-1.mp4
live-activity-after-3036cbe2r4-1791180773-1.mp4
Implemented and independently reviewed by fresh Claude Code agents (claude-fable-5-1 top-level, claude-opus-5 subagents).