Skip to content

Increase toolCallBudget of some hosted-copilot-sdk invocation tests - #1935

Merged
JasonYeMSFT (JasonYeMSFT) merged 1 commit into
microsoft:mainfrom
JasonYeMSFT:chuye/tool-call-budget
Apr 17, 2026
Merged

Increase toolCallBudget of some hosted-copilot-sdk invocation tests#1935
JasonYeMSFT (JasonYeMSFT) merged 1 commit into
microsoft:mainfrom
JasonYeMSFT:chuye/tool-call-budget

Conversation

@JasonYeMSFT

Copy link
Copy Markdown
Member

Description

The modified tests expect the agent to view the codebase to find out it needs to invoke the azure-hosted-copilot-sdk skill. Reading files in the workspace uses tool calls. The default 3 tool call budget is not enough for the agent to read the files and invoke the skill. Extending it to 10.

Checklist

  • Tests pass locally (cd tests && npm test)
  • If modifying skill descriptions: verified routing correctness with integration tests (npm run test:skills:integration -- <skill>)
  • If modifying skill USE FOR / DO NOT USE FOR / PREFER OVER clauses: confirmed no routing regressions for competing skills
  • Version bumped in skill frontmatter (if skill files changed)

Related Issues

Copilot AI review requested due to automatic review settings April 17, 2026 17:16

Copilot AI 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.

Pull request overview

This PR increases the allowed “early tool calls” window for the azure-hosted-copilot-sdk integration tests so the agent can scan the workspace (via tool calls) before being required to invoke the expected skill.

Changes:

  • Extend shouldEarlyTerminateForSkillInvocation to accept an optional toolCallBudget override.
  • Update the azure-hosted-copilot-sdk integration tests to use a higher budget (10) for scenarios that rely on codebase scanning.
Show a summary per file
File Description
tests/utils/evaluate.ts Adds an optional toolCallBudget parameter to control the early-termination threshold per test.
tests/azure-hosted-copilot-sdk/integration.test.ts Increases the early-termination tool call threshold to 10 for the “existing SDK app” scenarios.

Copilot's findings

Comments suppressed due to low confidence (1)

tests/azure-hosted-copilot-sdk/integration.test.ts:116

  • Same as above: consider using a named constant instead of repeating the 10 tool-call budget literal, so the value can be tuned in one place.
        const rate = await measureInvocationRate(agent, SKILL_NAME, {
          setup: setupCopilotSdkApp,
          prompt: "Add a new feature to this app that summarizes pull requests",
          shouldEarlyTerminate: (agentMetadata) => shouldEarlyTerminateForSkillInvocation(agentMetadata, SKILL_NAME, 10),
        }, "existing-sdk-modify", RUNS_PER_PROMPT);
  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread tests/utils/evaluate.ts
Comment thread tests/azure-hosted-copilot-sdk/integration.test.ts
@JasonYeMSFT JasonYeMSFT (JasonYeMSFT) changed the title Add toolCallBudget Increase toolCallBudget of some hosted-copilot-sdk invocation tests Apr 17, 2026

@jongio Jon Gallant (jongio) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean test tuning. The optional toolCallBudget keeps the default behavior for every other callsite, and raising to 10 matches the two setupCopilotSdkApp scenarios where the agent has to scan the workspace before it can reasonably invoke the skill. The other three tests in the same file don't need the bump, so the targeted split is right.

Agree with your call on keeping 10 inline until there's a third usage, and on skipping input validation for a 2-callsite internal helper.

@JasonYeMSFT
JasonYeMSFT (JasonYeMSFT) merged commit edfe3f4 into microsoft:main Apr 17, 2026
15 checks passed
Barbara 4bes (Ba4bes) pushed a commit to Ba4bes/GitHub-Copilot-for-Azure that referenced this pull request Apr 24, 2026
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.

3 participants