Skip to content

Hydrate cloud integrations before local mounts - #93

Merged
kjgbot merged 1 commit into
mainfrom
fix/local-mount-cloud-hydration
Jun 5, 2026
Merged

kjgbot merged 1 commit into
mainfrom
fix/local-mount-cloud-hydration

Conversation

@kjgbot

@kjgbot kjgbot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Hydrate account-level Cloud integrations into local projects before reconciling local Relayfile mounts
  • Keep the startup hydration single-flight and throttled so settings/local-path calls do not repeatedly fetch Cloud
  • Preserve existing local-path enrichment behavior without an extra Cloud lookup

Tests

  • npm test
  • npm run build

@codeant-ai

codeant-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kjgbot, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: fe6a180e-007b-4ae7-97a1-35da177c9274

📥 Commits

Reviewing files that changed from the base of the PR and between 4591f55 and 4e99f62.

📒 Files selected for processing (1)
  • src/main/integrations.ts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@agent-relay-code

Copy link
Copy Markdown
Contributor

pr-reviewer could not complete review for #93 in AgentWorkforce/pear.
The review harness exited with code 1.
No review was posted; this needs operator attention.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

pr-reviewer could not complete review for #93 in AgentWorkforce/pear.
The review harness exited with code 1.
No review was posted; this needs operator attention.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a throttled cloud integration hydration mechanism for local mounts in src/main/integrations.ts. It adds the hydrateCloudIntegrationsForLocalMounts method to fetch and merge cloud integrations into local projects with a 30-second throttle and a promise-based lock to prevent redundant operations. Additionally, syncLocalMounts is updated to conditionally trigger this hydration. The review feedback suggests wrapping the project merging loop in a try/catch block to ensure that a failure in one project does not block the hydration of others.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/main/integrations.ts
Comment on lines +1682 to +1684
for (const project of projects) {
await this.mergeCloudIntegrationsIntoProject(project.id, cloud)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If mergeCloudIntegrationsIntoProject throws an error for one project (for example, due to a corrupted store entry or a transient issue during listCatalog), the loop will terminate early. This prevents subsequent projects from being hydrated. Wrapping the call in a try/catch block ensures that a failure in one project does not block the hydration of others.

      for (const project of projects) {
        try {
          await this.mergeCloudIntegrationsIntoProject(project.id, cloud)
        } catch (error) {
          console.warn('[integrations] Failed to merge cloud integrations for project ' + project.id + ':', toErrorMessage(error))
        }
      }

@agent-relay-code

Copy link
Copy Markdown
Contributor

pr-reviewer could not complete review for #93 in AgentWorkforce/pear.
The review harness exited with code 1.
No review was posted; this needs operator attention.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

pr-reviewer could not complete review for #93 in AgentWorkforce/pear.
The review harness exited with code 1.
No review was posted; this needs operator attention.

@kjgbot
kjgbot merged commit a1f1f44 into main Jun 5, 2026
3 checks passed
@kjgbot
kjgbot deleted the fix/local-mount-cloud-hydration branch June 5, 2026 12:37
@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #93 and made two scoped fixes:

  • Preserved updateScope()’s non-blocking behavior by making fire-and-forget agent state sync skip cloud hydration.
  • Added a regression test proving concurrent local mount daemon starts coalesce into one cloud hydration request and still persist hydrated cloud integrations.

Local verification passed:

  • npx vitest run src/main/integrations.test.ts
  • npm test
  • npm run build

No extra .workforce bot review metadata was present in this checkout.

@agent-relay-code

Copy link
Copy Markdown
Contributor

✅ pr-reviewer applied fixes — committed and pushed 91f71b3 to this PR. The notes below describe what changed.

Reviewed PR #93 and made two scoped fixes:

  • Preserved updateScope()’s non-blocking behavior by making fire-and-forget agent state sync skip cloud hydration.
  • Added a regression test proving concurrent local mount daemon starts coalesce into one cloud hydration request and still persist hydrated cloud integrations.

Local verification passed:

  • npx vitest run src/main/integrations.test.ts
  • npm test
  • npm run build

No extra .workforce bot review metadata was present in this checkout.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #93 and fixed one validated issue: syncAgentState was building the agent notification from the pre-hydration integration list, so cloud-only integrations merged during syncLocalMounts() could be mounted and subscribed but omitted from the system message. The fix refreshes visible integrations after hydration in src/main/integrations.ts.

Added a regression in src/main/integrations.test.ts and adjusted the existing async assertion to account for hydration before mount reconciliation.

Local validation run:
npx vitest run src/main/integrations.test.ts
npx vitest run src/main/*.test.ts src/main/__tests__/*.test.ts
npm test

@agent-relay-code

Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer push failed (exit 128) — fixes were not applied to the PR. The notes below are advisory and were not pushed.

Reviewed PR #93 and fixed one validated issue: syncAgentState was building the agent notification from the pre-hydration integration list, so cloud-only integrations merged during syncLocalMounts() could be mounted and subscribed but omitted from the system message. The fix refreshes visible integrations after hydration in src/main/integrations.ts.

Added a regression in src/main/integrations.test.ts and adjusted the existing async assertion to account for hydration before mount reconciliation.

Local validation run:
npx vitest run src/main/integrations.test.ts
npx vitest run src/main/*.test.ts src/main/__tests__/*.test.ts
npm test

@agent-relay-code

Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer push failed (exit 1) — fixes were not applied to the PR. The notes below are advisory and were not pushed.

Fixed the PR regression in src/main/integrations.ts: local integration mutations now reconcile mounts from local state without waiting on cloud hydration, while startup/hydrate paths still hydrate from cloud. I also moved the integration snapshot after hydration so hydrate-triggered agent state uses freshly merged cloud integrations.

Added coverage in src/main/integrations.test.ts for concurrent local mount daemon starts coalescing cloud hydration.

Local checks run:
npx vitest run src/main/integrations.test.ts
npm test
npx vitest run src/main/broker.test.ts
npm run verify:mcp-resources-drift
npm run build

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