mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-01 15:32:11 +08:00
d89b1b6e16
* 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>