Skip to content

Comments

refactor: move optimizer and SubagentInvocation to pytest-aitest; consolidate subagent tool factories#14

Merged
sbroenne merged 1 commit intomainfrom
refactor/move-optimizer-subagent-to-aitest
Feb 20, 2026
Merged

refactor: move optimizer and SubagentInvocation to pytest-aitest; consolidate subagent tool factories#14
sbroenne merged 1 commit intomainfrom
refactor/move-optimizer-subagent-to-aitest

Conversation

@sbroenne
Copy link
Owner

Summary

Removes Copilot-specific copies of provider-agnostic functionality now that it lives in \pytest-aitest\ (see sbroenne/pytest-aitest#68).

Changes

Removed: \copilot/optimizer.py\

\InstructionSuggestion\ and \optimize_instruction()\ are deleted from this repo. Import from \pytest_aitest\ directly. Both are still re-exported from \pytest_codingagents\ for convenience.

\\python

canonical

from pytest_aitest import InstructionSuggestion, optimize_instruction

still works

from pytest_codingagents import InstructionSuggestion, optimize_instruction
\\

\SubagentInvocation\ moved to \pytest-aitest\

Removed from
esult.py's _all_. Import from \pytest_aitest:

\\python
from pytest_aitest import SubagentInvocation
\\

\personas.py\ — consolidated tool factories

_make_runsubagent_tool\ and _make_task_tool\ were ~90% identical. Extracted into a single _make_subagent_dispatch_tool(tool_name, ...)\ factory.

Docs

  • \how-to/optimize.md\ — autodoc references updated to \pytest_aitest.execution.optimizer.*\

  • eference/api.md\ — same

  • eference/result.md\ — \SubagentInvocation\ section updated with correct import path

Dependency order

⚠️ Merge sbroenne/pytest-aitest#68 first — this PR requires \pytest-aitest>=0.5.7.

…ubagent tool factories

- Remove copilot/optimizer.py (InstructionSuggestion and optimize_instruction now live
  in pytest_aitest.execution.optimizer; re-exported from pytest_codingagents.__init__)
- result.py: remove SubagentInvocation from __all__; import from pytest_aitest directly
- events.py: import SubagentInvocation directly from pytest_aitest.core.result
- personas.py: consolidate _make_runsubagent_tool and _make_task_tool into shared
  _make_subagent_dispatch_tool(tool_name, ...) factory
- Raise pytest-aitest lower bound to >=0.5.7
- Update docs: fix autodoc references, add correct import examples
- Update tests: import optimizer types from pytest_aitest directly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

License Issues

pyproject.toml

PackageVersionLicenseIssue Type
pytest-aitest>= 0.5.7NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
pip/pytest-aitest >= 0.5.7 UnknownUnknown

Scanned Files

  • pyproject.toml

@sbroenne sbroenne merged commit b8dad33 into main Feb 20, 2026
13 of 21 checks passed
@sbroenne sbroenne deleted the refactor/move-optimizer-subagent-to-aitest branch February 20, 2026 15:49
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.

1 participant