Skip to content

fix(selfhost): reconcile MCP runtime and AI Search - #73

Merged
aryasaatvik merged 4 commits into
devfrom
fix/reconcile-selfhost-runtime-search
Aug 10, 2026
Merged

fix(selfhost): reconcile MCP runtime and AI Search#73
aryasaatvik merged 4 commits into
devfrom
fix/reconcile-selfhost-runtime-search

Conversation

@aryasaatvik

Copy link
Copy Markdown
Owner

Summary

Reconcile the selfhost package runtime with the validated Cloudflare MCP owner-check and AI Search lifecycle/query behavior.

Before / after

Surface Before After
MCP owner validation Cold validation could restore the runtime outside the PartyServer startup lock Validation stays storage-only; fetch owns runtime initialization
AI Search item state Unexpected provider statuses were treated as reusable Only undefined, queued, running, and completed items are reused; unexpected states are reuploaded
Scoped tool search A page-sized global chunk set was filtered and deduplicated locally Queries retrieve 50 candidates and apply the integration filter before deduplication and paging

Validation

  • Cloudflare agent-session Durable Object tests: 9/9 passed
  • Cloudflare host package typecheck passed
  • Semantic-search AI Search tests: 15/15 passed
  • Semantic-search package typecheck passed
  • Changed-file oxlint and oxfmt checks passed
  • Live deployment verified scoped PostHog search returns 10 results and organizations.list succeeds with HTTP 200

Known baseline failures

  • Root format and lint include existing .scratchpad findings
  • Root typecheck includes existing toolkit SVG declaration failures
  • Root test reaches 19/20 packages; @executor-js/host-mcp fails its stdio bridge with Unauthorized / Connection closed

Keep Durable Object owner checks storage-only so PartyServer remains the sole runtime initialization path and concurrent fetches cannot deadlock startup.
Re-upload unexpected remote item states, preserve queued/running/completed items, and filter scoped searches inside AI Search before tool-level deduplication and paging.
@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown

Greptile Summary

The PR keeps MCP owner validation storage-only so PartyServer remains responsible for runtime initialization, and reconciles AI Search indexing and scoped retrieval behavior.

  • Cold and concurrent owner validation no longer starts the Durable Object runtime outside the startup lock.
  • Unexpected remote item statuses are treated as non-reusable and reuploaded.
  • AI Search retrieves a larger candidate set, filters by the namespace’s integration segment, validates canonical paths against the current catalog, and then deduplicates and paginates results.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/hosts/cloudflare/src/mcp/agent-session-durable-object.ts Makes owner validation storage-only while retaining activity updates for initialized sessions.
packages/hosts/cloudflare/src/mcp/agent-session-durable-object.test.ts Updates lifecycle tests to verify owner validation does not initialize or race the MCP runtime.
packages/plugins/semantic-search/src/sdk/ai-search.ts Tightens remote-item reuse and revises scoped search retrieval and canonical-path reconciliation; the prior namespace issue is fixed.
packages/plugins/semantic-search/src/sdk/ai-search.test.ts Adds coverage for integration-filtered retrieval, provider-rewritten item keys, and current-catalog path validation.

Reviews (2): Last reviewed commit: "fix(semantic-search): scope provider fil..." | Re-trigger Greptile

Comment thread packages/plugins/semantic-search/src/sdk/ai-search.ts Outdated
@aryasaatvik
aryasaatvik merged commit 2f9c55b into dev Aug 10, 2026
4 of 14 checks passed
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