refactor(agents): implement integration-driven capability architecture#593
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 1, 2026
Merged
Conversation
Collaborator
|
Error: Claude Code process exited with code 1 Manual intervention may be required. |
Collaborator
|
Error: Claude Code process exited with code 1 Manual intervention may be required. |
d89314e to
41a51b1
Compare
Replace the ad-hoc capability system with a unified capability-centric
architecture where integrations provide capabilities and capabilities
provide tools.
Key changes:
**New capability system (`src/agents/capabilities/`):**
- Add capability registry mapping capabilities to gadgets and SDK tools
- Add resolver functions for deriving integrations from capabilities
- Add `resolveEffectiveCapabilities()` for runtime optional capability filtering
- Add `createIntegrationChecker()` factory for project integration lookups
- Add `generateUnavailableCapabilitiesNote()` for system prompt injection
**Schema changes (`src/agents/definitions/schema.ts`):**
- Replace boolean capability flags with typed capability arrays
- `capabilities: { required: Capability[], optional: Capability[] }`
- Remove separate `integrations` and `tools` sections (now derived)
- Remove `gadgetBuilder` strategy (replaced by capability-based building)
**Agent definition updates (all YAML files):**
- Migrate all 10 agent definitions to new capability format
- debug.yaml: Remove fs:write (read-only analysis agent)
- respond-to-ci.yaml: Add pm:checklist to optional capabilities
**Runtime improvements:**
- Wire `IntegrationChecker` through profiles.ts and llmist backend
- Optional capabilities filtered by actual project integration availability
- Fix: Throw on missing gadget constructors (was silently skipped)
- Fix: Only fall back to full access for "not found" errors in legacy shim
- Fix: Pass correct agentType to preExecute hooks
- Add validation warning for missing tools in filterToolManifests
**Test coverage:**
- Add comprehensive resolver.test.ts for capability resolution functions
- Update all affected tests for new capability format
- Add mock for createIntegrationChecker in llmist tests
This refactoring:
- Eliminates redundancy between schema and runtime capability logic
- Makes integration requirements derivable from capability declarations
- Provides architectural safety (tools don't exist if cap not enabled)
- Enables graceful degradation for optional integrations
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
41a51b1 to
e5d1c24
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a major refactoring of the agent capability system, replacing ad-hoc capability flags with a unified capability-centric architecture where:
pmintegration providespm:read,pm:write,pm:checklist)pm:readprovidesReadWorkItem,ListWorkItemsgadgets)