feat: Conductor Expert — opt-in knowledge base for Conductor-aware agents (#180)#215
feat: Conductor Expert — opt-in knowledge base for Conductor-aware agents (#180)#215brrusino wants to merge 5 commits into
Conversation
…ents (microsoft#180) Add a bundled knowledge base that gives agents deep understanding of Conductor's YAML schema, execution model, authoring patterns, and CLI commands. This is Phase 1: reuse existing plugin reference docs with a runtime injection mechanism. Schema changes: - AgentDef.conductor_expert: bool | None (tri-state: None=inherit, True=enable, False=disable). Forbidden on script/workflow/human_gate. - RuntimeConfig.conductor_expert: bool (workflow-wide default, False) Implementation: - src/conductor/expert/ — new package with loader.py and bundled knowledge/ docs (yaml-schema.md, authoring.md, execution.md) - loader.py uses importlib.resources + lru_cache for zero-cost repeated calls, wraps content in <conductor_knowledge> tags - AgentExecutor._build_prompt_prefix() composes workspace instructions + expert knowledge, shared by execute() and render_prompt() - WorkflowEngine passes conductor_expert_default to both single- provider and multi-provider executor paths Example YAML: agents: - name: workflow_reviewer conductor_expert: true prompt: Review this workflow... # Or workflow-wide: workflow: runtime: conductor_expert: true Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🤖 Multi-Agent PR Review #1PR: #1 — feat: Conductor Expert — opt-in knowledge base for Conductor-aware agents (#180) 📋 SummaryClean, well-scoped Phase 1 of the Conductor Expert feature. The tri-state opt-in resolution, shared prompt-prefix builder, and schema validation rejecting the flag on non-provider-backed agents are all implemented correctly, and test coverage hits the meaningful seams (loader caching, tag wrapping, tri-state, ordering, validator rejections). No security or correctness blockers — the knowledge content is static package data with no user-controlled paths. The one item worth addressing before merge is that the bundled knowledge docs the feature is supposed to teach agents from are now stale: they don't document the new 🔍 Consensus Findings
💡 Suggested fix for R2-001 (stale knowledge docs) max_agent_iterations: integer # Max tool-use roundtrips per agent (1-500, optional)
max_session_seconds: float # Wall-clock timeout per agent session in seconds (optional)
default_reasoning_effort: string # Workflow-wide reasoning/thinking effort: low, medium, high, xhigh (optional)
+ conductor_expert: boolean # Inject bundled Conductor knowledge into provider-backed agents (default: false)
mcp_servers: # MCP server configurations💡 Suggested fix for R1-002 (loader error handling)- text = resource.read_text(encoding="utf-8").strip()
+ try:
+ text = resource.read_text(encoding="utf-8").strip()
+ except (FileNotFoundError, OSError, UnicodeDecodeError) as e:
+ raise RuntimeError(
+ f"Conductor Expert knowledge file '{name}' is missing or unreadable. "
+ "This usually indicates a broken install; try reinstalling conductor."
+ ) from e💡 Suggested fix for R1-001 (explicit packaging artifacts) [tool.hatch.build.targets.wheel]
packages = ["src/conductor"]
+artifacts = ["src/conductor/expert/knowledge/*.md"]
exclude = [
"src/conductor/web/frontend",
]🔎 Unique / Disputed FindingsNone — all findings reached consensus in round 1. 📊 Model Comparison
🏁 VerdictReviewers agree on the substance: no blockers, one warning worth addressing (stale bundled knowledge docs), and a few polish suggestions. Updating the bundled Merge readiness: |
R2-001 (warning): Document conductor_expert in bundled knowledge docs - yaml-schema.md: add conductor_expert to runtime and agent field refs - authoring.md: add conductor_expert section with examples and tri-state semantics, update quick-reference YAML snippets R1-002 (suggestion): Add error handling to knowledge loader - Wrap resource.read_text() in try/except for FileNotFoundError, OSError, UnicodeDecodeError; raise RuntimeError with reinstall guidance R1-001 (suggestion): Declare explicit package data artifacts - Add artifacts rule for expert/knowledge/*.md in pyproject.toml Fix CI: Update integration tests that assert exact RuntimeConfig dumps - conductor_expert: False now appears in model_dump(exclude_none=True) - Update assertions in test_existing_workflows_integration.py and test_mixed_providers.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #215 +/- ##
=======================================
Coverage ? 88.27%
=======================================
Files ? 62
Lines ? 9700
Branches ? 0
=======================================
Hits ? 8563
Misses ? 1137
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Let the provider's default model apply — the conductor_expert flag is model-agnostic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add test for RuntimeError when a knowledge doc is missing/unreadable, covering the except block at loader.py:58-59 flagged by Codecov. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Implements Phase 1 of issue #180: bundles the existing plugin reference docs as package data and wires them into the instructions pipeline with an opt-in flag. This gives agents deep understanding of Conductor's YAML schema, execution model, authoring patterns, and CLI commands.
Changes
New:
src/conductor/expert/packageloader.py— loads and caches (~70KB) bundled reference docs viaimportlib.resources+lru_cache, wraps in<conductor_knowledge>tagsknowledge/— bundled markdown reference docs (yaml-schema.md, authoring.md, execution.md)Schema (
config/schema.py)AgentDef.conductor_expert: bool | None— tri-state: None = inherit workflow default, True = force enable, False = force disable. Forbidden on script/workflow/human_gate agents.RuntimeConfig.conductor_expert: bool— workflow-wide default (False)Executor (
executor/agent.py)_build_prompt_prefix()helper shared byexecute()andrender_prompt()_should_inject_expert()— resolves tri-state agent flag vs workflow defaultEngine (
engine/workflow.py)conductor_expert_defaulttoAgentExecutorin both single-provider and multi-provider pathsTests & Docs
tests/test_expert/covering loader, schema validation, and executor integrationAGENTS.mdwith expert package documentationexamples/conductor-expert.yamlexample workflowCloses #180 (Phase 1)