Skip to content

perf(server): adopt the upstream server performance pass - #252

Merged
rynfar merged 6 commits into
pylonfrom
upstream/2026-09-02-server-perf
Sep 2, 2026
Merged

perf(server): adopt the upstream server performance pass#252
rynfar merged 6 commits into
pylonfrom
upstream/2026-09-02-server-perf

Conversation

@rynfar

@rynfar rynfar commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Five upstream perf commits, in order:

  • #8988 stop loading full tool-call output from the DB on every refresh
  • #9000 bound snapshot activity payload memory
  • #9032 skip full-message reads while streaming
  • #8187 cut idle CPU use and stop provider event leaks
  • #8368 cut chatty tool-update frames by 90%

#9024 was already on pylon, so its cherry-pick was correctly a no-op.

Carve-outs

ProjectionSnapshotQuery. #9000 extracts the pinned-activity CTE into
pinnedThreadActivityIdsCte. Pylon pins one more thing than upstream — the latest
turn's authoritative plan, via latest_plan_activity — and its tests assert 504
activities where upstream asserts 503. Both are preserved. Upstream also
reintroduced a plainer ProjectionThreadSessionDbRowSchema alongside Pylon's,
which carries restored and pendingTurnRequestAmbiguous; the duplicate is
dropped and Pylon's kept.

ProviderRuntimeIngestion. #8187 adds an early return for non-assistant
content deltas and drops the unconditional getPendingTurnStartByThreadId read in
favour of an event-gated one. Both are taken. Pylon's rate-limit handling and its
turn.completed capacity refresh — the composer capacity gauge — sit in the same
hunk and are kept, as does let thread, which Pylon reassigns further down.

Two regressions this surfaced, both fixed in the last commit

Pylon's pending-input count silently went to zero. #8988 narrows the
thread-shell summary read to a query whose SQL filters to the three user-input.*
kinds. Pylon's Prime adapter emits generic interaction.* activities for the same
count, and shouldRefreshThreadShellSummary already wakes on them — with a
comment saying so. So the refresh fired, read no rows, and wrote zero. Nothing
typechecked wrong; ProjectionPipeline.test.ts caught it.

Prime protocol logging. #8187 puts raw ACP protocol logging behind a new
verboseProtocolLogging flag that no production adapter sets — upstream's own
Grok and Cursor adapters included, and the flag appears set only in upstream's
unit test. Pylon's Prime thought-chunk test asserted an outgoing protocol frame
reached the native log. That frame no longer exists for any ACP provider, so the
test now asserts the stronger property instead: no protocol frames at all, which
means a thought chunk has no path to disk.

Verification

t3 typecheck clean, lint clean, 3890 server tests passing (2 were failing
before the fixes above; both bisected to the commit that caused them).

Model: Claude Opus 5 in Claude Code.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

t3dotgg and others added 6 commits September 2, 2026 14:00
…he perf pass

Two regressions the perf chain introduced.

#8988 narrows the thread-shell summary read to listUserInputLifecycleByThreadId,
whose SQL filters to the three user-input.* kinds. Pylon's Prime adapter emits
generic interaction.* activities for the same pending-input count, and
shouldRefreshThreadShellSummary already wakes on them — so the refresh fired and
read nothing, driving pending_user_input_count to zero and blanking the sidebar
indicator. The filter now covers both families.

#8187 makes raw ACP protocol logging opt-in behind verboseProtocolLogging, which
no production adapter sets. Pylon's Prime thought-chunk test asserted an outgoing
protocol frame reached the native log; that frame no longer exists for any ACP
provider. The test now asserts the stronger property: no protocol frames at all,
so a thought chunk has no path to disk.
@github-actions github-actions Bot added size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.7 KiB 13.5 KiB −210 B (−1.5%) 15.1 KiB
Codex Thread snapshot wire 6.9 KiB 6.9 KiB −7 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.8 KiB 6.6 KiB −203 B (−2.9%) 7.8 KiB
Codex Live turn WebSocket decoded 58.7 KiB 57.1 KiB −1.5 KiB (−2.6%) 66.4 KiB
Codex Live turn messages 11 9 −2 (−18.2%) 21
Claude Total thread wire 13.7 KiB 13.4 KiB −361 B (−2.6%) 15.1 KiB
Claude Thread snapshot wire 6.9 KiB 6.9 KiB 0 B (0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.8 KiB 6.5 KiB −361 B (−5.2%) 7.8 KiB
Claude Live turn WebSocket decoded 59.5 KiB 57.2 KiB −2.4 KiB (−4.0%) 66.4 KiB
Claude Live turn messages 11 8 −3 (−27.3%) 21

Baseline: 4564313 · PR result: 02b9a45 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 109.5 KiB
  • Claude decoded thread snapshot: 110.2 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar
rynfar merged commit 9aeaba9 into pylon Sep 2, 2026
17 checks passed
@rynfar
rynfar deleted the upstream/2026-09-02-server-perf branch September 2, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 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.

3 participants