anomalyco / anomalyco/opencode
Perf: cut worker-thread saturation/CPU from session diffs, snapshots, SQLite contention, and event fanout (PR #48638 series)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Context
Part of the fork hardening/perf series proposed in #48638 (integration branch session-diff-events, fork AceRothstein71/opencode). Original tracker: #49565.
PR #48638 is intended to close this issue.
Problem
Under concurrent sessions / parallel agents: worker-thread saturation from permission matching, turn-diff recomputation, event fanout to TUI/server clients, snapshot churn and snapshot-index recovery, and SQLite contention across sessions. Symptoms: stalled turns, high CPU, delayed diffs.
Change set (commit list, session-diff-events)
- 41b33fee30 processor coalesce
- 562dccf3c0 processor coalesce cleanup
- fdb3778f95 audit findings: diff/events/sqlite
- 857ce25bb8 doom-loop reload
- c1fa9435ec wave 1-5 reliability
- 15315be778 wave 6 residual
- 56feb5c84e wave 7-11 hardening
- 59c3e3280f sqlite lanes
- 3d64416ba6 tui bridge sync
- d84bbc617b session event-loop load
- 6c1ddb3e4a snapshot heal
- d27f83c334 snapshot index recovery
- a38c279be3 vcs diff context
- 2d1e6da481 core directory index
- dc7e2ad448 wave G
Validation
- Owner-observed: CPU usage is definitely lower under identical parallel-agent workloads.
- Worker-thread stalls sharply reduced; turn-diff path bounded; mock-verified tool schema (206 tools, zero invalid
required, zero empty combinators).
Linked: PR #48638 · tracker #49565 · sibling tracking issues listed in a follow-up comment.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with PR #48638 and the session-diff-events integration branch, then review the listed commits covering worker processing, event fanout, snapshots, VCS diffs, and SQLite lanes. Done means reproducing the parallel-agent workload and confirming lower CPU, fewer worker stalls, bounded turn-diff work, and the stated schema validation results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite, typescript
- Domain
- backend, databases, performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100