Skip to content

Fix Omnicorp concurrency#96

Merged
maximusunc merged 3 commits into
mainfrom
claude/lucid-ptolemy-x5i7m
Jun 6, 2026
Merged

Fix Omnicorp concurrency#96
maximusunc merged 3 commits into
mainfrom
claude/lucid-ptolemy-x5i7m

Conversation

@maximusunc
Copy link
Copy Markdown
Collaborator

No description provided.

claude added 2 commits June 6, 2026 11:59
The omnicorp overlay was CPU-bound work disguised as async: omnicorp_overlay
and its helpers were declared async but contained no real await points, so a
single large task monopolized the event loop and starved the poll loop,
heartbeat, and other in-flight tasks until it finished.

Mirror the aragorn_score worker: make the overlay synchronous and dispatch it
to a ProcessPoolExecutor via run_in_executor, keeping DB load/save on the loop.
This gives true multi-core parallelism and keeps the loop responsive while a
long overlay runs. Cap the in-flight task limit since each message can be large.

Tests updated to call the now-synchronous helpers directly.
Large queries (>=100k curie pairs) degrade into disk-bound random LMDB
reads, pushing the shared-count overlay from seconds to 45 minutes-3
hours. Short-circuit those queries: once the pair count meets the
OMNICORP_MAX_CURIE_PAIRS threshold (default 100000, env-overridable),
return the message without the literature co-occurrence overlay.

https://claude.ai/code/session_01DH9CbmVwia8eW6qkxz5MVP
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 57.14286% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.40%. Comparing base (46d68af) to head (83dc88e).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
workers/aragorn_omnicorp/worker.py 57.14% 15 Missing ⚠️
Files with missing lines Coverage Δ
workers/aragorn_omnicorp/worker.py 69.11% <57.14%> (-1.64%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8984325...83dc88e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maximusunc maximusunc merged commit aba8633 into main Jun 6, 2026
2 checks passed
@maximusunc maximusunc deleted the claude/lucid-ptolemy-x5i7m branch June 6, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants