Repository navigation
Prompting a session bound to an extension-published agent fails with 500 "skills: agent not found" #349
Description
Prompting a session bound to an extension-published agent fails with 500 "skills: agent not found"
Version: 0.3.0-beta.13 (daemon), Linux
Summary
Any session whose agent is published by an extension (including the bundled dev-cycle agents reviewer, code_implementer, review_fixer) cannot be prompted: prompt ingress fails with an internal error while building the session command catalog. Sessions bound to agents authored on disk (~/.compozy/agents/<name>/AGENT.md) work normally.
Reproduction (100%)
# dev-cycle is bundled and enabled; "reviewer" is one of its published agents
compozy session new --cwd "$PWD" --agent reviewer --name repro
compozy session commands <session-id> -o json
# => {"error":"session: build command catalog for \"<id>\": daemon: project command skills: skills: agent not found: \"reviewer\""}
compozy session prompt <session-id> "hello"
# => 500 Internal Server Error (same root error)Meanwhile the daemon itself lists the agent fine:
compozy agent list -o json # shows "reviewer" (origin: global, from the extension)
compozy extension inventory dev-cycle -o json # shows the agent as liveRoot cause (from reading the source)
internal/daemon/session_commands.go → commandSkillCandidates:
- When the session has an
AgentDefsnapshot, it uses
CommandCandidatesForAgentDefSession— which is explicitly documented to
support "extension and bundle agents that are not authored on disk". This
path works. - When the session has no snapshot (e.g. a freshly created, still-unbound
session), it falls back to the name-based
CommandCandidatesForAgentSession→Registry.ForAgentSession→
resolveAgentScope(internal/skills/registry_agent.go), which resolves
only:resolved.Agents(workspace-authored) → builtin defs → the global
authored dir (agentsDir). Extension-published agents are in none of those
sources, so the fallback returnsErrAgentNotFoundand the catalog build
(and therefore every prompt) fails.
The inconsistency: the agent catalog service used by compozy agent list
resolves extension-published agents; the skills registry's name-based scope
resolver does not.
Suggested fix
In the no-snapshot fallback of commandSkillCandidates, resolve the concrete
AgentDef through the same registry the agent catalog uses (which includes
extension/bundle publications) and then call
CommandCandidatesForAgentDefSession; keep the current name-based path only
as the final fallback. Alternatively, teach resolveAgentScope a fourth
source (extension-published agents) so every consumer benefits.
Happy to submit a PR — I have the environment where this reproduces and can
add an integration test mirroring
internal/daemon/agent_skill_resources_integration_test.go.
Workaround we are using
Authoring a duplicate global AGENT.md for each extension agent
(compozy agent create <name> --prompt-file ...). Note the interaction:
extension enable then refuses with extension_agent_conflict, so the
authored copy must be deleted before enable and re-created after.
Possibly related (can file separately)
- Automation triggers accept
--event loop.terminalat creation but never
fire (empty history after multiple loop terminals in the same workspace). - A
watch-eventsLoop subscribed toloop.terminalarms its subscription
(visible in the dormant read-model, cursor advances) but never wakes on
matching terminals.
Activity