Skip to content

perf(gateway): skip clean transcript reconcile workers - #117342

Merged
steipete merged 1 commit into
mainfrom
codex/perf-skip-clean-transcript-worker
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf-skip-clean-transcript-worker

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Gateway startup scaling poorly with configured agent count even when every agent transcript projection is already clean. On the benchmark fixture, 12 agents took 6.101 seconds to reach readiness and spent 3.513 seconds in the startup phase labeled plugins.bootstrap.

Why This Change Was Made

Transcript reconciliation previously spawned one Node Worker per configured agent, then each Worker opened SQLite and discovered there was no projection work. The SQLite owner now runs one short preflight transaction that sweeps orphaned index rows and uses the existing indexed query to decide whether repair is needed. Clean projections return immediately; dirty projections keep the existing Worker, bounded chunk commits, ownership claims, and post-worker orphan sweep.

The transaction re-reads authoritative SQLite state immediately before the decision. The injectable Worker factory exists only to prove a clean projection cannot spawn a Worker.

User Impact

Gateways with several configured agents start and restart materially faster when their transcript indexes are current. Repair behavior for dirty or imported transcripts is unchanged.

Evidence

Blacksmith Testbox before/after, identical 3-run cases with one warmup:

  • 12-agent /readyz p50: 6.101s → 2.772s (54.6% faster).
  • 12-agent plugins.bootstrap p50: 3.513s → 306ms (91.3% faster).
  • 12-agent completion p50: 4.534s → 1.302s (71.3% faster).
  • 1-agent /readyz p50: 2.951s → 2.566s (13.1% faster).

Runs:

Provenance: PR #108851 introduced blocking startup transcript reconciliation. This repair keeps that correctness gate and removes only zero-work Worker creation.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 1, 2026
@steipete
steipete merged commit b6b440d into main Aug 1, 2026
123 of 125 checks passed
@steipete
steipete deleted the codex/perf-skip-clean-transcript-worker branch August 1, 2026 10:22
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 1, 2026
* origin/main:
  perf(gateway): skip clean transcript workers (#117342)
vincentkoc added a commit to Alix-007/openclaw that referenced this pull request Aug 1, 2026
* origin/main:
  fix(test/ui): prevent shared history pollution (openclaw#117348)
  fix(openrouter): apply image request transport policy (openclaw#117336)
  perf(gateway): skip clean transcript workers (openclaw#117342)
  test(testing): assert relay smoke readiness
  fix(testing): activate relay live smoke transport
  feat(channels): record account lifecycle facts and retire inferred health vocabularies (openclaw#117300)
  fix(canvas): remove unsupported snapshot delay hint (openclaw#117326)
  refactor(agents): fold cache TTL pruning into prompt projection (openclaw#117313)
  fix(canvas): honor paired-node invocation deadlines (openclaw#117316)
  fix(system-agent): make exit-and-run-a-terminal guidance surface-correct (openclaw#114633)
  fix(ai): assistant text blocks are run together on replay (openclaw#115743)
  refactor(agents): canonicalize subagent execution state (openclaw#117267)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main:
  perf(gateway): skip clean transcript workers (openclaw#117342)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main:
  fix(test/ui): prevent shared history pollution (openclaw#117348)
  fix(openrouter): apply image request transport policy (openclaw#117336)
  perf(gateway): skip clean transcript workers (openclaw#117342)
  test(testing): assert relay smoke readiness
  fix(testing): activate relay live smoke transport
  feat(channels): record account lifecycle facts and retire inferred health vocabularies (openclaw#117300)
  fix(canvas): remove unsupported snapshot delay hint (openclaw#117326)
  refactor(agents): fold cache TTL pruning into prompt projection (openclaw#117313)
  fix(canvas): honor paired-node invocation deadlines (openclaw#117316)
  fix(system-agent): make exit-and-run-a-terminal guidance surface-correct (openclaw#114633)
  fix(ai): assistant text blocks are run together on replay (openclaw#115743)
  refactor(agents): canonicalize subagent execution state (openclaw#117267)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant