Repository navigation
fix: resolve extension-published agents for session command catalogs - #350
Conversation
Sessions bound to an extension-published agent (e.g. the bundled dev-cycle reviewer/code_implementer agents) could not be prompted because commandSkillCandidates fell back to the name-based CommandCandidatesForAgentSession path whenever no agent snapshot was present, and that path only resolves workspace-authored, builtin, and global authored agents, never extension-published ones. sessionCommandService now tries to resolve the concrete AgentDef via the daemon's resource-backed agent catalog (resourceAgentCatalog, already used everywhere else agents are resolved) before falling back to the name-based lookup, so it can route through CommandCandidatesForAgentDefSession, which supports extension and bundle agents. Review fixes: harden the fallback test with errors.Is + a call-count assertion proving the name-based path actually ran, drive the extension-agent test through the public Catalog() entry point, replace the switch/break branch with a plain if/else chain, and add the compile-time sessionCommandAgentResolver interface guard next to resourceAgentCatalog's existing guards. Boot-order fix: bootPromptProviders constructs sessionCommandService before bootRuntime populates state.agentCatalog, so capturing the resolver by value at construction time permanently bound it to a nil catalog and silently degraded every session to the old name-based fallback. agentResolver is now a lazy provider (func() -> sessionCommandAgentResolver), mirroring workspaceResolver's existing shape, and is evaluated at each resolveAgentDef call instead of once at construction time. Added a regression test proving a provider that returns nil at build time and a working resolver later is used once available.
|
@franciscpd is attempting to deploy a commit to the Compozy Team on Vercel. A member of the Team first needs to authorize it. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughSession command skill lookup now resolves extension-published agents through a deferred agent catalog. Existing authored-agent validation and fallback errors remain unchanged. Unit and end-to-end tests cover command lookup, prompt execution, SSE completion, and persisted history. ChangesSession command agent resolution
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Session
participant sessionCommandService
participant AgentResolver
participant resourceAgentCatalog
participant SkillRegistry
Session->>sessionCommandService: request commands or prompt
sessionCommandService->>AgentResolver: resolve agent name
AgentResolver->>resourceAgentCatalog: find AgentDef
resourceAgentCatalog-->>AgentResolver: return extension AgentDef
AgentResolver-->>sessionCommandService: return AgentDef
sessionCommandService->>SkillRegistry: resolve command candidates
SkillRegistry-->>sessionCommandService: return skill content
sessionCommandService-->>Session: return commands or prompt result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| internal/daemon/session_commands.go | Adds lazy catalog fallback only for agent-not-found results while preserving authored validation errors. |
| internal/daemon/native_tool_registry_skills.go | Routes source-qualified skill views through the explicit session agent resolver and documents the resolution contract. |
| internal/daemon/native_tools_dependencies_builder.go | Wires the production resource agent catalog into both catalog and resolver dependencies. |
| internal/daemon/agent_skill_catalog.go | Adds a compile-time assertion that the production catalog satisfies the session agent resolver interface. |
| internal/daemon/daemon_extension_agent_fixture_e2e_integration_test.go | Adds end-to-end coverage for extension command discovery, prompting, slash invocation, and persisted source metadata. |
Sequence Diagram
sequenceDiagram
participant Caller
participant Commands as Session Command Service
participant Registry as Authored Skills Registry
participant Catalog as Workspace Agent Catalog
Caller->>Commands: Request session command catalog
Commands->>Registry: Resolve agent skills by name
alt Authored agent found or validation fails
Registry-->>Commands: Candidates or authoritative error
else Agent not found
Commands->>Catalog: Resolve extension/bundled agent
Catalog-->>Commands: Concrete agent definition
Commands->>Registry: Resolve candidates from definition
Registry-->>Commands: Source-qualified candidates
end
Commands-->>Caller: Effective command catalog
Reviews (5): Last reviewed commit: "test: cover skill_view command_id when t..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
internal/daemon/session_commands_test.go (1)
69-70: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMark the top-level test as parallel.
Add
t.Parallel()immediately after Line 69. The parallel subtests do not make the top-level test parallel.As per coding guidelines, “Before editing Go tests, activate
eng-test-conventions; use … defaultt.Parallel.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/daemon/session_commands_test.go` around lines 69 - 70, Add t.Parallel() immediately at the start of TestSessionCommandServiceCommandSkillCandidatesExtensionAgent, before the t.Run call, so the top-level Go test executes in parallel with other tests while preserving its existing parallel subtests.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/daemon/native_tool_registry_skills.go`:
- Around line 226-233: The resolveSkillViewTarget flow must allow command-ID
skill views when sessionAgentDefinition has no snapshot: replace the early
rejection with an empty AgentDef and continue into service.project. Preserve
commandSkillCandidates resolution through info.AgentName and AgentCatalog, and
update the canonical native-tool test to cover this extension-agent command-ID
path.
---
Nitpick comments:
In `@internal/daemon/session_commands_test.go`:
- Around line 69-70: Add t.Parallel() immediately at the start of
TestSessionCommandServiceCommandSkillCandidatesExtensionAgent, before the t.Run
call, so the top-level Go test executes in parallel with other tests while
preserving its existing parallel subtests.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e0f2c16e-e1f9-4731-b554-0eeb422db8af
📒 Files selected for processing (7)
internal/daemon/agent_skill_catalog.gointernal/daemon/boot.gointernal/daemon/native_tool_registry_skills.gointernal/daemon/native_tools_test.gointernal/daemon/prompt_skills_test.gointernal/daemon/session_commands.gointernal/daemon/session_commands_test.go
…path CodeRabbit flagged that resolveSkillViewTarget's compozy__skill_view native tool rejected any command_id lookup for a session with no cached concrete agent snapshot, before ever reaching the catalog resolver wired into its ad-hoc sessionCommandService. That made the resolver unreachable for exactly the sessions this PR fixes: extension-published agents whose snapshot has not persisted yet. sessionAgentDefinition now distinguishes "session dependency unavailable" (still a hard failure) from "no snapshot cached for this session yet" via a new sentinel error. resolveSkillViewTarget treats only the latter as non-fatal: it proceeds with an empty AgentDef and lets commandSkillCandidates resolve the concrete definition itself (agent catalog, then the name-based lookup as a final fallback for truly unknown agents) instead of rejecting outright. Added a regression test proving the command_id path now resolves an extension-published agent with no cached snapshot, alongside the existing coverage for a genuinely unavailable session dependency. Also addresses the remaining PR review feedback: t.Parallel() on the top-level extension-agent test (subtests already were), and godoc comments on every function/type/interface this branch added or touched, to close the PR's docstring coverage gap.
|
All three CodeRabbit findings addressed in f15d9e5:
|
|
PR review remediation is now pushed in The original PR found the right missing dependency, but its catalog-first ordering could bypass live authored-agent validation, and its no-snapshot
The remaining Vercel authorization check is external to the code change. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/daemon/daemon_extension_agent_fixture_e2e_integration_test.go`:
- Around line 74-76: Update the session setup exercised by this test so it
explicitly has an empty or missing AgentDef snapshot, rather than relying only
on an empty Runtime.ACPSessionID. Use the existing session creation or runtime
snapshot symbols to assert the snapshot is absent before the first prompt, then
preserve the current unbound-ACP assertion.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f3dd8b1c-032a-4aef-92cc-c1768f0c96ff
⛔ Files ignored due to path filters (2)
docs/qa/reports/2026-08-12-issue-349-extension-agent-commands.mdis excluded by!**/*.mddocs/qa/scenarios/ET-session-command-catalog-parity.mdis excluded by!**/*.md
📒 Files selected for processing (9)
internal/daemon/agent_skill_catalog.gointernal/daemon/boot.gointernal/daemon/daemon_extension_agent_fixture_e2e_integration_test.gointernal/daemon/native_tool_dependencies.gointernal/daemon/native_tool_registry_skills.gointernal/daemon/native_tools_dependencies_builder.gointernal/daemon/native_tools_test.gointernal/daemon/prompt_skills_test.gointernal/daemon/session_commands.go
🚧 Files skipped from review as they are similar to previous changes (4)
- internal/daemon/agent_skill_catalog.go
- internal/daemon/boot.go
- internal/daemon/session_commands.go
- internal/daemon/native_tools_test.go
CreateSession stores the agent definition snapshot before ACP binding, so the unbound-session E2E cannot construct the missing-snapshot state. Pin that branch at the unit layer instead: a session manager whose snapshot reader reports no cached definition must surface the dependency error on the command_id skill view path. Co-Authored-By: Claude Fable 5 <[email protected]>
Fixes #349.
Problem
Sessions using an extension-published agent could not build their effective command catalog. That blocked
session commands, Web command suggestions, normal prompts, and slash-skill prompts withskills: agent not found.The failing case has a concrete agent snapshot with a
SourcePath. That path is valid for extension agents, but the command service treated every source-backed agent as authored and used the name-based skills registry. The name-based registry intentionally resolves authored and built-in agents, not extension publications.Root fix
skills.ErrAgentNotFound.CommandCandidatesForAgentDefSession, which supports extension and bundled agents.compozy__skill_view(command_id)to the same explicitsession.AgentResolver; retain the concrete session snapshot requirement.This removes the earlier catalog-first precedence change and the no-snapshot sentinel path. No public HTTP, UDS, CLI, native-tool schema, event, config, or persistence contract changed.
Tests
skill_view(command_id)coverage for a source-backed extension agent.dev-cycle, creates an unboundreviewersession, reads its HTTP command catalog, sends a normal prompt, sends an extension slash-skill prompt, and verifies the source-qualified invocation persisted in session history.Focused race-enabled unit and integration tests pass.
Real-user QA
A fresh isolated targeted lab verified:
dev-cycleextension skills.compozy__command_listand source-qualifiedcompozy__skill_viewsuccessfully.clean: trueand no surviving processes.Verification
make gate-full— PASS (fullmake verify)5b26be80c002fcf6e238b2d2931a185e3c075413Remediation commit:
aba35230.The Vercel authorization status is external to this code change; the repository verification pipeline is green.
Compozy Impact Audit
compozy__command_listandcompozy__skill_view(command_id)inherit the corrected resolver ordering.Summary by CodeRabbit
New Features
Bug Fixes