Add Agent requirements - #11762
Conversation
Introduce a Kilo-owned CLI requirements module that preflights agent declarations before session creation. The helper resolves requirement status via the SDK, blocks agents with unmet skills, errored MCPs, or VS Code extension dependencies, and produces grouped actionable guidance for terminal users. Includes planning documents and a focused test suite covering all blocking and allow paths.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous Review Summaries (5 snapshots, latest commit 3209f01)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3209f01)Status: No Issues Found | Recommendation: Merge Files Reviewed (8 files)
Previous review (commit 6a8b81a)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous review (commit d524365)Status: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
Previous review (commit 1a238cf)Status: 1 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Previous review (commit d3a3bff)Status: 3 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (67 files)
Reviewed by gpt-5.4-20260305 · Input: 83.5K · Output: 5.5K · Cached: 355.6K Review guidance: REVIEW.md from base branch |
…tions Wrap vscode.extensions.onDidChange in a typeof check so the subscribe callback is undefined in environments where the API is unavailable. Skip posting agentRequirementsInvalidated when the controller cache is already empty to avoid spurious messages to the webview. Update the associated test to seed cache state before asserting on the clear-triggered invalidation flow.
…-identity tokens Switch the controller's supersession tracking from incrementing counters to ephemeral object references, ensuring stale tokens are cleaned up on both success and failure paths. This eliminates a class of race conditions where cleared counters could alias with fresh requests. Conditionally emit the "Install the required skills..." footer in the CLI formatter only when skills or MCPs are actually present, preventing misleading guidance for extension-only requirement failures.
Cover the GET /kilocode/agent/requirements route in the HTTP API exercise harness, asserting that the response echoes the requested agent, uses the routed workspace directory, and correctly reports the disabled state with empty skills/mcps/extensions arrays.
|
@imanolmzd-svg |
markijbema
left a comment
There was a problem hiding this comment.
Had a bot review, and added my own thoughts where it seems up for discussion. I think especially how we work with different platforms requires some thought still
…ID validation Lift the VS Code–only restriction from the requirements guard so that blocked skills/MCPs fail for CLI and other clients as well. VS Code extension requirements remain client-specific. The evaluate function now accepts pre-decoded requirements as an explicit input rather than decoding internally, and the schema switches from the strict alphanumeric ID pattern to a permissive non-whitespace Name pattern allowing slashes and spaces in skill/MCP identifiers. Update prompt interfaces to surface RequirementBlockedError in the typed error channel and preserve "ready" results in the webview cache alongside blocked/error states.
* feat(agent-requirements): gate agents on declared requirements * feat(cli): add agent requirements preflight helpers Introduce a Kilo-owned CLI requirements module that preflights agent declarations before session creation. The helper resolves requirement status via the SDK, blocks agents with unmet skills, errored MCPs, or VS Code extension dependencies, and produces grouped actionable guidance for terminal users. Includes planning documents and a focused test suite covering all blocking and allow paths. * chore: update kilo-vscode visual regression baselines * fix(vscode): guard extension subscription and suppress empty invalidations Wrap vscode.extensions.onDidChange in a typeof check so the subscribe callback is undefined in environments where the API is unavailable. Skip posting agentRequirementsInvalidated when the controller cache is already empty to avoid spurious messages to the webview. Update the associated test to seed cache state before asserting on the clear-triggered invalidation flow. * refactor(agent-requirements): replace numeric generations with object-identity tokens Switch the controller's supersession tracking from incrementing counters to ephemeral object references, ensuring stale tokens are cleaned up on both success and failure paths. This eliminates a class of race conditions where cleared counters could alias with fresh requests. Conditionally emit the "Install the required skills..." footer in the CLI formatter only when skills or MCPs are actually present, preventing misleading guidance for extension-only requirement failures. * test(httpapi): add exercise scenario for agent requirements endpoint Cover the GET /kilocode/agent/requirements route in the HTTP API exercise harness, asserting that the response echoes the requested agent, uses the routed workspace directory, and correctly reports the disabled state with empty skills/mcps/extensions arrays. * feat(agent-requirements): enforce guard across all clients and relax ID validation Lift the VS Code–only restriction from the requirements guard so that blocked skills/MCPs fail for CLI and other clients as well. VS Code extension requirements remain client-specific. The evaluate function now accepts pre-decoded requirements as an explicit input rather than decoding internally, and the schema switches from the strict alphanumeric ID pattern to a permissive non-whitespace Name pattern allowing slashes and spaces in skill/MCP identifiers. Update prompt interfaces to surface RequirementBlockedError in the typed error channel and preserve "ready" results in the webview cache alongside blocked/error states. * chore(opencode): fix requirement guard annotations --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* feat(agent-requirements): gate agents on declared requirements * feat(cli): add agent requirements preflight helpers Introduce a Kilo-owned CLI requirements module that preflights agent declarations before session creation. The helper resolves requirement status via the SDK, blocks agents with unmet skills, errored MCPs, or VS Code extension dependencies, and produces grouped actionable guidance for terminal users. Includes planning documents and a focused test suite covering all blocking and allow paths. * chore: update kilo-vscode visual regression baselines * fix(vscode): guard extension subscription and suppress empty invalidations Wrap vscode.extensions.onDidChange in a typeof check so the subscribe callback is undefined in environments where the API is unavailable. Skip posting agentRequirementsInvalidated when the controller cache is already empty to avoid spurious messages to the webview. Update the associated test to seed cache state before asserting on the clear-triggered invalidation flow. * refactor(agent-requirements): replace numeric generations with object-identity tokens Switch the controller's supersession tracking from incrementing counters to ephemeral object references, ensuring stale tokens are cleaned up on both success and failure paths. This eliminates a class of race conditions where cleared counters could alias with fresh requests. Conditionally emit the "Install the required skills..." footer in the CLI formatter only when skills or MCPs are actually present, preventing misleading guidance for extension-only requirement failures. * test(httpapi): add exercise scenario for agent requirements endpoint Cover the GET /kilocode/agent/requirements route in the HTTP API exercise harness, asserting that the response echoes the requested agent, uses the routed workspace directory, and correctly reports the disabled state with empty skills/mcps/extensions arrays. * feat(agent-requirements): enforce guard across all clients and relax ID validation Lift the VS Code–only restriction from the requirements guard so that blocked skills/MCPs fail for CLI and other clients as well. VS Code extension requirements remain client-specific. The evaluate function now accepts pre-decoded requirements as an explicit input rather than decoding internally, and the schema switches from the strict alphanumeric ID pattern to a permissive non-whitespace Name pattern allowing slashes and spaces in skill/MCP identifiers. Update prompt interfaces to surface RequirementBlockedError in the typed error channel and preserve "ready" results in the webview cache alongside blocked/error states. * chore(opencode): fix requirement guard annotations --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
What changed
Add agent requirements to agent declarations so experimental agents can declare the skills, MCP servers, and VS Code extensions they need before they run.
The requirement check now powers both clients:
Screenshots
Testing
bun run script/check-opencode-annotations.tsbun run typecheckfrompackages/opencodebun test ./test/kilocode/agent-requirements.test.tsfrompackages/opencodebun test ./test/kilocode/agent-requirements-cli.test.tsfrompackages/opencode