Conversation
Add structured test layout for example-01 (unit, API, e2e), a cross-example test runner script, pre-commit test gate using language:python to avoid broken system Python, CI workflow updates, and supporting tooling.
Introduce a new MCP server configuration file and a script to manage environment variables. Updated the example environment file with new tokens for GitHub and Supabase. Enhanced .gitignore to exclude memory files.
Removed the previous multi-agent single system example and replaced it with a new orchestrator pipeline example. Updated the curriculum documentation to reflect the new structure and added a changelog. Adjusted pre-commit hooks and Makefile for the new example format. Enhanced README and documentation to clarify the progression of design patterns in the context of a crypto intelligence platform.
Modified the Makefile to include the --ignore-missing-imports option for mypy checks. Updated testing-gate documentation to remove redundant instructions and added safety rules for test implementation in the SKILL.md file, ensuring tests remain deterministic and CI-safe.
Replaced direct return values in AsyncMock instances with aninvoke methods for better compatibility with async testing patterns. This change enhances the clarity and maintainability of the test cases for project_profiler and community_analyst, ensuring they properly simulate asynchronous behavior.
Added explicit configuration instructions for mocking LangChain/MCP tool objects in tests. Emphasized the importance of using `mock_tool.ainvoke` to avoid issues with unconfigured child mocks, enhancing clarity for test implementations.
Updated the README to clarify team roles and responsibilities within the crypto intelligence platform. Added a new project vision document outlining the architectural philosophy and use case narrative. Revised local environment rules for clarity and added guidelines for README content and Mermaid diagrams. Improved the documentation writer skill to reflect the new pattern README structure and content guidelines.
Enhanced the README to include a comprehensive overview of the project, detailing the architectural challenges and the nine design patterns developed to address them. Added badges for project dependencies and links to relevant documentation, improving accessibility and clarity for users. Updated the structure to better reflect the progression of design patterns within the context of a crypto intelligence platform.
Introduced AGENTS.md to document learned user preferences and workspace facts for agent development. Added code quality gate rules to enforce project conventions for Python files in examples. Included guidelines for FastAPI apps, agent nodes, imports, and a quick checklist to ensure code quality. Updated .gitignore to exclude new hooks state directory.
Revised AGENTS.md to clarify usage of GitHub CLI and updated testing commands to utilize `uv` for consistency. Enhanced local environment documentation with GitHub CLI details and canonical commands for linting and type checking. Ensured CI commands align with local development practices to maintain a single source of truth.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
- ✅ Fixed: Wrong parameter name for DuckDuckGo search results
- Changed num_results=8 to max_results=8 in both Pattern 01 and Pattern 02 news_scanner.py files to match the langchain-community>=0.3 API.
- ✅ Fixed: MCP client not entered as async context manager
- Added explicit aenter() call in init_mcp() and aexit() call in close_mcp() to properly establish and close MCP server connections.
- ✅ Fixed: Test mock doesn't configure ainvoke method correctly
- Changed mock configuration to explicitly set mock_search.ainvoke = AsyncMock(return_value=...) to ensure the ainvoke method returns the intended search results.
Or push these changes by commenting:
@cursor push b43e33b173
Preview (b43e33b173)
diff --git a/examples/01-orchestrator-pipeline/src/agents/news_scanner.py b/examples/01-orchestrator-pipeline/src/agents/news_scanner.py
--- a/examples/01-orchestrator-pipeline/src/agents/news_scanner.py
+++ b/examples/01-orchestrator-pipeline/src/agents/news_scanner.py
@@ -30,7 +30,7 @@
verbose_log("NewsScanner", f"Searching for: {user_input[:80]}")
search = DuckDuckGoSearchResults(
- num_results=8,
+ max_results=8,
output_format="list",
)
raw_results = await search.ainvoke(f"{user_input} crypto project news 2026")
diff --git a/examples/02-mcp-tool-integration/src/agents/news_scanner.py b/examples/02-mcp-tool-integration/src/agents/news_scanner.py
--- a/examples/02-mcp-tool-integration/src/agents/news_scanner.py
+++ b/examples/02-mcp-tool-integration/src/agents/news_scanner.py
@@ -31,7 +31,7 @@
user_input = state["input"]
verbose_log("NewsScanner", f"Searching for: {user_input[:80]}")
- search = DuckDuckGoSearchResults(num_results=8, output_format="list")
+ search = DuckDuckGoSearchResults(max_results=8, output_format="list")
raw_results = await search.ainvoke(f"{user_input} crypto project latest news 2026")
verbose_log("NewsScanner", f"Got {len(raw_results) if isinstance(raw_results, list) else '?'} search results")
diff --git a/examples/02-mcp-tool-integration/src/mcp_setup.py b/examples/02-mcp-tool-integration/src/mcp_setup.py
--- a/examples/02-mcp-tool-integration/src/mcp_setup.py
+++ b/examples/02-mcp-tool-integration/src/mcp_setup.py
@@ -33,6 +33,7 @@
verbose_log("MCP", f"Connecting to MCP servers: {list(config.keys())}")
_mcp_client = MultiServerMCPClient(config) # type: ignore[arg-type]
+ await _mcp_client.__aenter__()
tools: list[BaseTool] = await _mcp_client.get_tools() # type: ignore[misc]
_mcp_tools = {t.name: t for t in tools}
verbose_log("MCP", f"Loaded {len(_mcp_tools)} tools: {list(_mcp_tools.keys())}")
@@ -42,6 +43,7 @@
"""Disconnect from all MCP servers."""
global _mcp_client, _mcp_tools # noqa: PLW0603
if _mcp_client:
+ await _mcp_client.__aexit__(None, None, None)
_mcp_client = None
_mcp_tools = {}
verbose_log("MCP", "Disconnected from MCP servers")
diff --git a/examples/02-mcp-tool-integration/tests/unit/test_agent_nodes.py b/examples/02-mcp-tool-integration/tests/unit/test_agent_nodes.py
--- a/examples/02-mcp-tool-integration/tests/unit/test_agent_nodes.py
+++ b/examples/02-mcp-tool-integration/tests/unit/test_agent_nodes.py
@@ -46,7 +46,8 @@
model = _DummyModel("Arbitrum announced Orbit chains. TVL exceeded $10B.")
monkeypatch.setattr(news_scanner, "get_chat_model", lambda: model)
- mock_search = AsyncMock(return_value=[{"title": "Arbitrum news", "snippet": "Orbit chains launched"}])
+ mock_search = AsyncMock()
+ mock_search.ainvoke = AsyncMock(return_value=[{"title": "Arbitrum news", "snippet": "Orbit chains launched"}])
with patch.object(news_scanner, "DuckDuckGoSearchResults", return_value=mock_search):
result = await news_scanner.news_scanner_node({"input": "Research Arbitrum", "plan": "1. News\n2. Tech"})|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
…cycle, fix mocks and healthcheck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Major restructuring of the agent-patterns-lab project to align with the crypto intelligence platform vision:
examples/01-orchestrator-pipeline/with dedicated crypto intelligence agents (Research Planner, News Scanner, Intelligence Compiler) and addedexamples/02-mcp-tool-integration/with MCP server configuration and 5 specialized agents (Community Analyst, Project Profiler, etc.).env.example, MCP server config, linting scripts, and CI workflow updatesCommits included
test: add test infrastructure with unit, API, and e2e test suitesfeat: add MCP server configuration and environment scriptrefactor: restructure example and curriculum for agent patternschore: update linting configuration and testing guidelinesrefactor: update async mock implementations in unit testsdocs: update SKILL.md with mocking guidelines for LangChain/MCP toolsdocs: enhance README and project vision documentationdocs: expand README with design patterns and project overviewTest plan
examples/01-orchestrator-pipeline/tests pass withuv run pytestexamples/02-mcp-tool-integration/tests pass withuv run pytestdocker compose up --buildworks for both examplesNote
Medium Risk
Medium risk due to broad repo restructuring (example renames/new examples) plus CI/pre-commit, mypy, and test-runner changes that can break developer workflow or pipelines if misconfigured.
Overview
Refactors the repo from lesson-based examples to a crypto-intelligence pattern progression, including a new
examples/01-orchestrator-pipeline(3-agent pipeline with DuckDuckGo search) and a newexamples/02-mcp-tool-integration(5-agent pipeline plus a CoinGecko-backedcrypto-dataMCP server and MCP client lifecycle management).Adds a standardized testing + quality gate: new per-example
tests/unit,tests/api, andtests/e2esuites, a cross-reposcripts/testing/run_test_suite.py, and a per-directoryscripts/linting/run_mypy.pyto avoid monorepo duplicate-module issues; CI now runs pre-commit, uses the wrapper mypy script, and runs the full test suite with coverage.Updates project foundations and tooling: expands top-level docs (
README.md,docs/curriculum.md, newdocs/vision.md), updates.env.examplefor MCP-related vars, bumps and simplifies.pre-commit-config.yaml(removes mypy hook), tweaksMakefilesetup, and adds Cursor MCP/rules/skills plus.gitignoreentries for Cursor state.Written by Cursor Bugbot for commit dcb16bf. This will update automatically on new commits. Configure here.