Skip to content

Run BC-Bench's Copilot CLI call through the core CopilotHarness - #1014

Merged
Sun Haoran (haoranpb) merged 2 commits into
haoranpb/core-copilot-harnessfrom
haoranpb/prompt-out-of-harness
Nov 6, 2026
Merged

Sun Haoran (haoranpb) merged 2 commits into
haoranpb/core-copilot-harnessfrom
haoranpb/prompt-out-of-harness

Conversation

@haoranpb

@haoranpb Sun Haoran (haoranpb) commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #1013.

  • Delegate Copilot execution and timeout handling to core; keep benchmark-specific preparation in BC-Bench.
  • Preserve caller-typed harness names and experiment metadata in core results and timeouts.
  • Rename the registry to HarnessName and the execution protocol to AgentHarness.

No runtime behavior change. Validation: 264 focused tests, Ruff, workspace type checks, and pre-commit passed.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 11:32

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.

🟢 Approval recommended

No active review issues are reported for the change moving prompt rendering from agent harnesses into the CLI.

No open issues 🎉

What changed in this PR

Moves prompt rendering from agent harnesses into the CLI, separating benchmark policy from harness execution. This continues #1013’s work toward harnesses that consume prepared agent input.

Changes:

  • Adds AgentTask to carry a dataset entry and its rendered prompt through evaluation requests.
  • Moves Copilot and Claude prompt rendering into CLI commands and updates all BC-Bench harnesses to accept the new task structure.
  • Updates fixtures and tests to verify prompt forwarding, including the al_mcp option.
File Description
tests/​test_review_runners.py Uses concrete entries and checks wrapped harness tasks.
tests/​test_pr_review_agent.py Wraps PR Review test input in AgentTask.
tests/​test_evaluate_pipeline.py Updates the test pipeline’s harness type.
tests/​test_dataquery_evaluation.py Supplies a prompt in evaluation contexts.
tests/​test_copilot_agent.py Passes prompts directly instead of mocking rendering.
tests/​test_cli_commands.py Checks prompt forwarding and rendering options.
tests/​test_claude_code_agent.py Supplies a rendered prompt directly to Claude.
tests/​test_bcal_agent_provider.py Wraps BCal test input with its prompt.
tests/​conftest.py Updates shared harness and context fixtures.
src/​bcbench/​types.py Defines AgentTask and forwards context prompts.
src/​bcbench/​evaluate/​base.py Updates pipeline signatures for wrapped tasks.
src/​bcbench/​commands/​run.py Prepares prompts before invoking harnesses.
src/​bcbench/​commands/​evaluate.py Populates evaluation prompts and updates mock types.
src/​bcbench/​agent/​pr_review/​agent.py Extracts the entry from the wrapped task.
src/​bcbench/​agent/​copilot/​agent.py Consumes the supplied prompt without rendering it.
src/​bcbench/​agent/​claude/​agent.py Consumes the supplied prompt without rendering it.
src/​bcbench/​agent/​bcal/​agent.py Uses the supplied prompt for invocation and logging.

Review effort: Balanced

@haoranpb
Sun Haoran (haoranpb) force-pushed the haoranpb/prompt-out-of-harness branch from e42ca22 to db14622 Compare November 5, 2026 13:07
@haoranpb Sun Haoran (haoranpb) changed the title Render the agent prompt outside the harnesses Run BC-Bench's Copilot through the core CopilotHarness Nov 5, 2026
The core CopilotHarness gets a required name (keeping StrEnum names intact in
identity) and an optional experiment configuration reported with results and
timeouts. BC-Bench's CopilotHarness still prepares each task but delegates the
CLI invocation and timeout handling to it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@haoranpb Sun Haoran (haoranpb) changed the title Run BC-Bench's Copilot through the core CopilotHarness Run BC-Bench's Copilot CLI call through the core CopilotHarness Nov 5, 2026
@haoranpb
Sun Haoran (haoranpb) force-pushed the haoranpb/prompt-out-of-harness branch from db14622 to 1e375c2 Compare November 5, 2026 14:11
Rename the application AgentHarness registry to HarnessName and the core Harness protocol to AgentHarness. Update implementations, consumers, tests and contributor guidance without changing runtime behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/bcbench/agent/shared/lsp.py Dismissed
Comment thread tests/conftest.py Dismissed
@github-code-quality

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest

haoranpb/core-copilo... 4921d34 haoranpb/prompt-out-... 88c70c7 +/-
88% 88% 0%
View coverage of the 10 most impacted files.
File haoranpb/core-copilo... 4921d34 haoranpb/prompt-out-... 88c70c7 +/-
src/bcbench/evaluate/nl2al.py 81% 79% -2%
src/bcbench/evaluate/bugfix.py 52% 51% -1%
src/bcbench/eva...stgeneration.py 56% 56% 0%
src/bcbench/eva...te/dataquery.py 68% 69% +1%
src/bcbench/eva...quest_triage.py 61% 62% +1%
src/bcbench/evaluate/base.py 90% 93% +3%
src/bcbench/eva...st_implement.py 68% 71% +3%
src/bcbench/eva...e/codereview.py 89% 93% +4%
src/bcbench/eva...uest_advisor.py 92% 100% +8%
packages/bcbenc...ilot/harness.py 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@haoranpb
Sun Haoran (haoranpb) merged commit 62ab59e into main Nov 6, 2026
17 checks passed
@haoranpb
Sun Haoran (haoranpb) deleted the haoranpb/prompt-out-of-harness branch November 6, 2026 09:12
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