• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vstorm-co / subagents-pydantic-ai / 31019879729
100%

Build:
DEFAULT BRANCH: main
Ran 05 Aug 2026 03:21PM UTC
Jobs 1
Files 16
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Aug 2026 03:21PM UTC coverage: 100.0%. Remained the same
31019879729

push

github

web-flow
fix: a caller-supplied subagent honours can_ask_questions (#76)

## What this fixes

A subagent whose agent the caller supplies — `SubAgentConfig["agent"]`
or
`agent_factory` — could never ask the parent a question, whatever its
`can_ask_questions` said.

`_compile_subagent` attaches the `ask_parent` toolset only to an agent
it builds
itself; a caller-supplied agent is used as-is and skips that step.
`task` then
hardcoded `inject_ask_parent=False` for the configured path, so the
run-time
injection that would have made up for it never happened. Consumers that
hand every
delegate over pre-built (agenticos does — each delegate arrives as
`SubAgentConfig["agent"]`) therefore had no delegate that could ask,
ever.

## What changed

- `src/subagents_pydantic_ai/toolset.py` — `task` now decides
`inject_ask_parent`
from whether the caller supplied the agent
(`_agent_supplied_by_caller`), instead
of hardcoding `False` for the configured path. `_execute` already gates
the
injection on `can_ask_questions`, so the tool appears only when the
subagent's
  config opts in.
- `tests/test_toolset.py` — four tests through `create_subagent_toolset`
and a real
  run.
- `docs/concepts/toolset.md` — note that a caller-supplied agent honours
  `can_ask_questions` via run-time injection.

## Behaviour

| Subagent | `can_ask_questions` | `ask_parent` before | after |
|---|---|---|---|
| Prebuilt (`agent=`) | `True` | never | ✅ injected at run time |
| Prebuilt (`agent=`) | `False` | never | not injected |
| Factory (`agent_factory=`) | `True` | never | ✅ injected at run time |
| Default (library-built) | `True` | compiled in | unchanged — not
injected again |

No double injection: a default-built agent still gets the tool exactly
once, at
compile time.

## Testing

- `tests/test_toolset.py::TestConfiguredSubagentQuestions` — 4 new
tests, all green.
- Full suite: 1177 passed, **100% coverage** (the gate).
- `ruff format --check`, `ruff check`, `pyright` (strict) and `mkdocs
buil... (continued)

1567 of 1567 relevant lines covered (100.0%)

1.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 31019879729.1 05 Aug 2026 03:21PM UTC 16
100.0
GitHub Action Run
Source Files on build 31019879729
  • Tree
  • List 16
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #31019879729
  • 9a71a921 on github
  • Prev Build on main (#30769416466)
  • Next Build on main (#31020282384)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc