Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.

Commit 868ac0f

Browse files
committed
Don't recreate toolsets per run
1 parent 0d6cfd4 commit 868ac0f

File tree

2 files changed

+21
-21
lines changed
  • fastmcp-agents-library/agents/fastmcp-agents-library-agents/src/fastmcp_agents/library/agents

2 files changed

+21
-21
lines changed

fastmcp-agents-library/agents/fastmcp-agents-library-agents/src/fastmcp_agents/library/agents/github/agents.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,26 @@ def research_github_issue_instructions(ctx: RunContext[tuple[InvestigateIssue, R
4444
return f"""Gather context about GitHub issue {issue.issue_number} in {issue.owner}/{issue.repo}."""
4545

4646

47+
48+
github_triage_agent = Agent[tuple[InvestigateIssue, ReplyToIssue | None], GitHubIssueSummary | Failure](
49+
model=os.getenv("MODEL_RESEARCH_GITHUB_ISSUE") or os.getenv("MODEL"),
50+
system_prompt=[
51+
WHO_YOU_ARE,
52+
YOUR_GOAL,
53+
YOUR_MINDSET,
54+
],
55+
instructions=[
56+
GATHER_INSTRUCTIONS,
57+
REPORTING_CONFIDENCE,
58+
research_github_issue_instructions,
59+
INVESTIGATION_INSTRUCTIONS,
60+
RESPONSE_FORMAT,
61+
],
62+
deps_type=tuple[InvestigateIssue, ReplyToIssue | None],
63+
output_type=[GitHubIssueSummary, Failure],
64+
)
65+
66+
@github_triage_agent.toolset(per_run_step=False)
4767
async def github_triage_toolset(
4868
ctx: RunContext[tuple[InvestigateIssue, ReplyToIssue | None]],
4969
) -> FastMCPServerToolset[tuple[InvestigateIssue, ReplyToIssue | None]]:
@@ -74,26 +94,6 @@ async def github_triage_toolset(
7494
return FastMCPServerToolset[tuple[InvestigateIssue, ReplyToIssue | None]].from_mcp_server(name="github", mcp_server=github_mcp_server)
7595

7696

77-
github_triage_agent = Agent[tuple[InvestigateIssue, ReplyToIssue | None], GitHubIssueSummary | Failure](
78-
model=os.getenv("MODEL_RESEARCH_GITHUB_ISSUE") or os.getenv("MODEL"),
79-
system_prompt=[
80-
WHO_YOU_ARE,
81-
YOUR_GOAL,
82-
YOUR_MINDSET,
83-
],
84-
instructions=[
85-
GATHER_INSTRUCTIONS,
86-
REPORTING_CONFIDENCE,
87-
research_github_issue_instructions,
88-
INVESTIGATION_INSTRUCTIONS,
89-
RESPONSE_FORMAT,
90-
],
91-
deps_type=tuple[InvestigateIssue, ReplyToIssue | None],
92-
toolsets=[github_triage_toolset],
93-
output_type=[GitHubIssueSummary, Failure],
94-
)
95-
96-
9797
@github_triage_agent.tool
9898
async def investigate_code_base(ctx: RunContext[tuple[InvestigateIssue, ReplyToIssue | None]], task: str): # pyright: ignore[reportUnusedFunction]
9999
"""Investigate the code base of the repository in relation to the issue."""

fastmcp-agents-library/agents/fastmcp-agents-library-agents/src/fastmcp_agents/library/agents/simple_code/agents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def add_branch_info(ctx: RunContext[Path]) -> str: # pyright: ignore[reportUnus
6464
)
6565

6666

67-
@code_implementation_agent.toolset
67+
@code_implementation_agent.toolset(per_run_step=False)
6868
async def read_write_filesystem_toolset_func(ctx: RunContext[Path]) -> FastMCPServerToolset[Path]:
6969
return FastMCPServerToolset[Path].from_mcp_server(name="filesystem", mcp_server=read_write_filesystem_mcp(root_dir=ctx.deps))
7070

0 commit comments

Comments
 (0)