Skip to content

perf(search): fetch Lucid page regions concurrently on a live read - #8890

Merged
waleedlatif1 merged 6 commits into
stagingfrom
perf/lucid-parallel-read
Oct 10, 2026
Merged

waleedlatif1 merged 6 commits into
stagingfrom
perf/lucid-parallel-read

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • A Lucid live read made about 11 MCP calls one after another: metadata, a metadata-only manifest, one fetch per page region (up to 8), then metadata again. At 1–2 s per call, reads ran past the 15 s live read deadline and failed with MCP error -32001: TimeoutError.
  • The first metadata call and the manifest now run together, and region fetches run four at a time. That's three rounds of latency instead of up to 11.
  • Validation still walks the responses in page and region order, and the before/after document-change checks and the content size cap are unchanged.

Test plan

  • New lucid-mcp.test.ts: region fetches overlap and are assembled in page and region order even when they finish in reverse. It fails on the old code (max in-flight = 1).
  • CI

🤖 Generated with Claude Code

A Lucid read made about 11 MCP calls in sequence: metadata, a metadata-only
manifest, one fetch per page region (up to 8), then metadata again. At 1-2 s
per call that ran past the 15 s live read deadline. The first metadata and
manifest now run together, and region fetches run four at a time. Their
validation still walks them in page and region order, and the before/after
change checks are unchanged.
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 10, 2026 9:03pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/lucid-mcp.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was found.

Summary

Lucid live reads fetch metadata and the manifest together, then fetch regions through a four-call window.

  • Lucid reads fetch page regions four at a time.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read metadata and manifest together] --> B[Check identity and coverage]
  B --> C[Start up to four region reads]
  C --> D[Await next region in document order]
  D --> E{Response valid and content within limit?}
  E -->|No| F[Reject without scheduling more]
  E -->|Yes| G[Start next queued region]
  G --> H{More regions?}
  H -->|Yes| D
  H -->|No| I[Read metadata again]
  I --> J{Document unchanged?}
  J -->|Yes| K[Return complete content]
  J -->|No| F
Loading

Reviews (2) · Last reviewed commit: "fix(search): stop scheduling Lucid regio..." · Reviewed by Greptile

Comment thread apps/sim/lib/sim-search/live/lucid-mcp.ts Outdated
Comment thread apps/sim/lib/sim-search/live/lucid-mcp.test.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit c1c5ae0 into staging Oct 10, 2026
46 checks passed
@waleedlatif1
waleedlatif1 deleted the perf/lucid-parallel-read branch October 10, 2026 22:04

This branch was previously deployed

1 inactive deployment
Preview — 427ba1ae Deployed Oct 10, 2026 by vercel[bot]
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.

1 participant