refactor(agents): unify provider resolution and subagent guidance - #118
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
50c065c to
3f01013
Compare
7cfaebd to
691998e
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/local-agent-resolution.test.ts (1)
59-87: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the
target_not_foundbranch.All
LocalAgentResolutionErrorkinds are exercised excepttarget_not_found(an unknowntargetthat matches neither a profile nor a known provider id) — the one branch unique to CLI-style resolution.✅ Suggested additional case
+assert.throws( + () => resolveLocalAgentExecution({ + target: "not-a-real-target", + prompt: "x", + profiles: [reviewer], + availableProviders: ["codex"], + }), + (error) => error instanceof LocalAgentResolutionError && error.kind === "target_not_found", +); +🤖 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 `@src/local-agent-resolution.test.ts` around lines 59 - 87, The tests around resolveLocalAgentExecution cover the other LocalAgentResolutionError kinds but omit target_not_found. Add an assertion using an unknown target that matches neither a configured profile nor an available provider ID, and verify it throws LocalAgentResolutionError with kind "target_not_found".
🤖 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 `@docs/configuration.md`:
- Line 96: Update the documentation to describe effective persisted capability
settings rather than requiring environment variables: in docs/configuration.md
lines 96 and 108-109, docs/chatgpt-coding-workflow.md lines 90-91 and 122-125,
and docs/gotchas.md lines 204-205, state that workflow fallback uses the
resolved Subagents setting and bundled skills are included whenever their
capability is enabled.
In `@skills/subagents/SKILL.md`:
- Around line 10-12: Update the target-selection guidance near open_workspace so
calling it is not mandatory for CLI delegation. When its workspace catalog is
available, restrict choices to returned profiles/providers; otherwise permit an
explicitly named target and rely on runtime availability validation to reject
unusable providers.
---
Nitpick comments:
In `@src/local-agent-resolution.test.ts`:
- Around line 59-87: The tests around resolveLocalAgentExecution cover the other
LocalAgentResolutionError kinds but omit target_not_found. Add an assertion
using an unknown target that matches neither a configured profile nor an
available provider ID, and verify it throws LocalAgentResolutionError with kind
"target_not_found".
🪄 Autofix (Beta)
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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d342b90d-5f0a-4c75-8c79-c1d7f29b0974
📒 Files selected for processing (41)
docs/chatgpt-coding-workflow.mddocs/configuration.mddocs/dynamic-workflow/devspace/plan.mddocs/dynamic-workflow/devspace/primitives-spec.mddocs/gotchas.mdpackage.jsonskills/dynamic-workflows/SKILL.mdskills/subagent-delegation/SKILL.mdskills/subagents/SKILL.mdskills/subagents/references/claude.mdskills/subagents/references/codex.mdskills/subagents/references/copilot.mdskills/subagents/references/cursor.mdskills/subagents/references/opencode.mdskills/subagents/references/pi.mdsrc/cli.tssrc/config.test.tssrc/config.tssrc/local-agent-availability.tssrc/local-agent-capabilities.test.tssrc/local-agent-capabilities.tssrc/local-agent-catalog.test.tssrc/local-agent-catalog.tssrc/local-agent-profiles.tssrc/local-agent-resolution.test.tssrc/local-agent-resolution.tssrc/local-agent-targets.tssrc/open-workspace-capabilities.test.tssrc/server.tssrc/skills.test.tssrc/skills.tssrc/ui/card-types.tssrc/ui/workflow-dashboard.tssrc/user-config.tssrc/workflow-api.tssrc/workflow-cli.tssrc/workflow-contracts.tssrc/workflow-engine.test.tssrc/workflow-engine.tssrc/workflow-tools.tssrc/workflow-types.ts
💤 Files with no reviewable changes (3)
- skills/subagent-delegation/SKILL.md
- src/workflow-contracts.ts
- src/workflow-types.ts
b347a82
into
pr/dw-15-profile-api-workflow-paths
The experimental provider configuration mixed persisted policy with live availability, while direct subagents and workflow agents resolved provider, model, and effort through different paths. Subagents and Dynamic Workflows also shared one capability gate, and copied bundled skills could become stale after package upgrades.
Keep provider discovery runtime-only and share one execution-target resolver across direct and workflow agent calls. Separate the Subagents and Dynamic Workflows gates, advertise only enabled and currently usable capabilities from
open_workspace, replace the legacy delegation guidance with a compact package-managedsubagentsskill, and load provider-specific overrides on demand.Stack
Final merged layer inside #94 before the follow-up refinement chain #119 → #120 → #121.
Summary by CodeRabbit
New Features
subagentsskill for delegating tasks through DevSpace agent commands.Improvements
Documentation