Repository navigation
Description
Problem
compose / plan refuse a plain Completion for directory kinds (skill_dir needs a WorkspaceAgent), but the reverse mismatch is silent: kind: "text" with agent: {ref: "claude_code"} (or codex / dsh / opencode) composes and plans as ok: true.
Reproduced on main (a7fbb7c) with claude on PATH (a stub binary is enough):
| input | result |
|---|---|
kind=skill_dir, agent="echo" (plain Completion) |
SpecError: kind='skill_dir' needs a WorkspaceAgent ... |
kind=text, agent={"ref":"claude_code"} |
compose succeeds; plan returns ok: true |
| same text+CLI plan warnings | only the isolate/login warning — nothing about kind/agent mismatch |
WorkspaceAgent is intentionally a Completion (prompt -> str), so the composed run literally starts a full coding-agent session per case to answer a one-shot question. That is exactly the trap the shipped skill documents:
text— the agent is the model being prompted … Never a CLI coding agent here:claude_code/codex/dsh/opencodeare file-editing agents, and pointing one at a prompt costs a whole agent session per case …
plan exists so a wrong field fails by name before a detached run. Host plugins drive this surface (#165); the skill text alone is not enough when plan green-lights the mistake.
Expected
compose/planrefusekind="text"whenagentresolves to aWorkspaceAgent(or whenrefis one ofclaude_code/codex/dsh/opencode/cli_agent), with aSpecErrornaming the field and pointing atopenai_compatible/host_model/claude(SDK) instead.- Directory kinds keep their existing WorkspaceAgent requirement (no change).
Suggested fix
In compose for the kind == "text" branch (mirror of the skill_dir check around the WorkspaceAgent gate): after _resolve(spec.agent, ...), if isinstance(agent, WorkspaceAgent) (or ref in the CLI set), raise SpecError naming agent and the kind.
Optionally also surface the same message in _unusable_refs / plan warnings for older clients, but refusal at compose is the acceptance path.
Acceptance
-
compose/planof akind=textspec withagent.refin{claude_code, codex, dsh, opencode}raisesSpecErrornamingagent(notok: true). -
kind=textwithopenai_compatible/echo/ a plain Completion still composes. -
kind=skill_dirwith a WorkspaceAgent still composes; plain Completion still refused. - Regression test in
tests/test_evolvespec.py(and a plan-level check if plan has its own suite).
Related: plugin surface / #165 (host agents write EvolveSpecs); not a duplicate of #336–#339.
Activity
test: adapt selection-warning case after text+CLI refuse
fix(evolvespec): refuse kind=text with a WorkspaceAgent agent (ThinkF…
Merge origin/main into feat/meta-evolution