Skip to content

fix: remove agent discovery for agui agents - #2062

Merged
ranst91 merged 2 commits into
mainfrom
fix/agui-agent-discovery
Jul 1, 2025
Merged

ranst91 merged 2 commits into
mainfrom
fix/agui-agent-discovery

Conversation

@ranst91

@ranst91 ranst91 commented Jun 27, 2025 •

Copy link
Copy Markdown
Contributor

Agent discovery (prematurely contacting agents to make sure they exist) is a "remote endpoints" concept.
For AGUI agents, which should just allow through without it

Summary by CodeRabbit

  • Refactor
    • Improved agent discovery performance by simplifying how agents are retrieved and combined.
    • Reduced unnecessary network calls and error handling during agent discovery, resulting in a faster and more streamlined experience.

@vercel

vercel Bot commented Jun 27, 2025 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
copilotkit-feature-viewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2025 0:14am
demo-viewer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2025 0:14am
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2025 0:14am
examples-coagents-ai-travel-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2025 0:14am
examples-coagents-research-canvas-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2025 0:14am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
examples-coagents-ai-researcher-ui ⬜️ Ignored (Inspect) Visit Preview Jul 1, 2025 0:14am

@coderabbitai

coderabbitai Bot commented Jun 27, 2025 •

Copy link
Copy Markdown
Contributor

"""

Walkthrough

The changes refactor agent discovery in the runtime by making discoverAgentsFromAgui synchronous, removing asynchronous network calls and error handling. The getAllAgents method is updated to accommodate this change, now sequentially aggregating agents from endpoints and AGUI without using Promise.all.

Changes

File(s) Change Summary
CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts Refactored discoverAgentsFromAgui to be synchronous and simplified; updated getAllAgents to match changes
docs/content/docs/reference/classes/CopilotRuntime.mdx Removed empty and incomplete <PropertyReference> block for discoverAgentsFromAgui

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant CopilotRuntime
    participant Endpoints
    participant AGUI

    Client->>CopilotRuntime: getAllAgents(graphqlContext)
    CopilotRuntime->>Endpoints: discoverAgentsFromEndpoints(graphqlContext) (async)
    CopilotRuntime->>AGUI: discoverAgentsFromAgui() (sync)
    CopilotRuntime-->>Client: return combined agent list
Loading

Possibly related PRs

Suggested reviewers

  • mme
  • suhasdeshpande
  • ataibarkai
    """

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 425a376 and 59edfa2.

📒 Files selected for processing (3)
  • CopilotKit/.changeset/hungry-carrots-count.md (1 hunks)
  • CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts (2 hunks)
  • docs/content/docs/reference/classes/CopilotRuntime.mdx (0 hunks)
💤 Files with no reviewable changes (1)
  • docs/content/docs/reference/classes/CopilotRuntime.mdx
✅ Files skipped from review due to trivial changes (1)
  • CopilotKit/.changeset/hungry-carrots-count.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build Images (coagents-research-canvas, ui)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3d73e1 and 842334d.

📒 Files selected for processing (1)
  • CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts (2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts

[error] 890-890: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: Build Images (coagents-qa-native, agent, python, local-deps)
  • GitHub Check: Build Images (next-openai, next-openai)
  • GitHub Check: Build Images (coagents-qa-text, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-routing, ui)
  • GitHub Check: Build Images (coagents-qa-native, ui)
  • GitHub Check: Build Images (coagents-qa-text, ui)
  • GitHub Check: Build Images (coagents-research-canvas, ui)
  • GitHub Check: Build Images (coagents-research-canvas, agent, python, local-deps)
  • GitHub Check: Build Images (coagents-routing, agent, python, local-deps)
  • GitHub Check: Test (18.x)
  • GitHub Check: Test (20.x)
🔇 Additional comments (1)
CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts (1)

789-792: LGTM! Correctly adapted to synchronous agent discovery.

The refactoring properly handles the synchronous nature of discoverAgentsFromAgui() while maintaining the asynchronous call to discoverAgentsFromEndpoints().

@ranst91
ranst91 force-pushed the fix/agui-agent-discovery branch from 7286704 to 425a376 Compare June 27, 2025 09:56
@ranst91
ranst91 force-pushed the fix/agui-agent-discovery branch from 425a376 to 8471d50 Compare July 1, 2025 08:34
@ranst91
ranst91 force-pushed the fix/agui-agent-discovery branch from aa9b2da to 59edfa2 Compare July 1, 2025 12:09
@changesets-bot-copilotkit

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 59edfa2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@copilotkit/runtime Patch
@copilotkit/runtime-client-gql Patch
@copilotkit/react-core Patch
@copilotkit/react-textarea Patch
@copilotkit/react-ui Patch
@copilotkit/sdk-js Patch
@copilotkit/shared Patch

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jul 1, 2025 •

Copy link
Copy Markdown
Contributor

Preview environments destroyed for this pull request.

@github-actions

github-actions Bot commented Jul 1, 2025 •

Copy link
Copy Markdown
Contributor

Test Results

Status: ✅ Passed (View Run)

Commit: 1afbd11

Duration: 214.5s

Total Tests: 20

Pass Rate: 100.0%

Failed Tests: 0

🔍 Detailed Results

coagents-research-canvas

CoAgents Research Canvas (UI) - Local Depenencies

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
CrewAI chromium ✅ PASSED -

coagents-qa-native

CoAgents QA Native (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -

coagents-qa-text

CoAgents QA Text (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
OpenAI (LGC Python) chromium ✅ PASSED -
Anthropic (LGC Python) chromium ✅ PASSED -
OpenAI (LGC JS) chromium ✅ PASSED -
Anthropic (LGC JS) chromium ✅ PASSED -

coagents-routing

CoAgents Routing (UI) - Local

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -

next-openai

Next OpenAI - Self Hosted

Model Browser Status Video
OpenAI chromium ✅ PASSED -
Anthropic chromium ✅ PASSED -
Google Generative AI chromium ✅ PASSED -
LangChain (OpenAI) chromium ✅ PASSED -
LangChain (Anthropic) chromium ✅ PASSED -
LangChain (Gemini) chromium ✅ PASSED -
Groq chromium ✅ PASSED -

This branch was successfully deployed

5 active deployments
Preview – examples-coagents-research-canvas-ui — 59edfa29 Deployed Jul 1, 2025 by vercel[bot]
Preview – examples-coagents-ai-travel-app — 59edfa29 Deployed Jul 1, 2025 by vercel[bot]
Preview – docs — 59edfa29 Deployed Jul 1, 2025 by vercel[bot]
Preview – demo-viewer — 59edfa29 Deployed Jul 1, 2025 by vercel[bot]
Preview – copilotkit-feature-viewer — 59edfa29 Deployed Jul 1, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant