Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/remove-agent-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kilocode/cli": patch
"kilo-code": patch
---

Remove the experimental agent requirements check and its configuration flag.
59 changes: 1 addition & 58 deletions packages/core/src/v1/config/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,6 @@ const Color = Schema.Union([
Schema.Literals(["primary", "secondary", "accent", "success", "warning", "error", "info"]),
])

// kilocode_change start - agent skill/MCP/VS Code extension requirements schema
const RequirementID = Schema.String.check(
Schema.isMinLength(1),
Schema.isMaxLength(128),
Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]*$/),
)
const RequirementName = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(128), Schema.isPattern(/\S/))

export const VSCodeExtension = Schema.Struct({
name: RequirementName,
id: RequirementID,
})
export type VSCodeExtension = Schema.Schema.Type<typeof VSCodeExtension>

const RequirementGroup = Schema.mutable(Schema.Array(RequirementName)).check(
Schema.isMinLength(1),
Schema.isMaxLength(20),
)
const VSCodeExtensions = Schema.mutable(Schema.Array(VSCodeExtension)).check(
Schema.isMinLength(1),
Schema.isMaxLength(20),
)

export const Requirements = Schema.Struct({
skills: Schema.optional(RequirementGroup),
mcps: Schema.optional(RequirementGroup),
vscode_extensions: Schema.optional(VSCodeExtensions),
}).check(
Schema.makeFilter((input) => {
const issues: Schema.FilterIssue[] = []
if (!input.skills && !input.mcps && !input.vscode_extensions) {
issues.push({ path: [], issue: "At least one requirement group is required" })
}

for (const group of ["skills", "mcps"] as const) {
const seen = new Set<string>()
for (const [index, value] of (input[group] ?? []).entries()) {
if (seen.has(value)) issues.push({ path: [group, index], issue: `Duplicate ${group} requirement` })
seen.add(value)
}
}

const seen = new Set<string>()
for (const [index, extension] of (input.vscode_extensions ?? []).entries()) {
if (seen.has(extension.id)) {
issues.push({ path: ["vscode_extensions", index, "id"], issue: "Duplicate vscode_extensions requirement" })
}
seen.add(extension.id)
}

return issues
}),
)
export type Requirements = Schema.Schema.Type<typeof Requirements>
// kilocode_change end

const AgentSchema = Schema.StructWithRest(
Schema.Struct({
model: Schema.optional(Schema.NullOr(Schema.String)), // kilocode_change - nullable for delete sentinel
Expand Down Expand Up @@ -108,7 +52,6 @@ const AgentSchema = Schema.StructWithRest(
// kilocode_change end
maxSteps: Schema.optional(PositiveInt).annotate({ description: "@deprecated Use 'steps' field instead." }),
permission: Schema.optional(ConfigPermissionV1.Info),
requirements: Schema.optional(Requirements), // kilocode_change
}),
[Schema.Record(Schema.String, Schema.Any)],
)
Expand All @@ -132,7 +75,7 @@ const KNOWN_KEYS = new Set([
"permission",
"disable",
"tools",
Comment thread
marius-kilocode marked this conversation as resolved.
Resolved
"requirements", // kilocode_change
"requirements", // kilocode_change - ignore declarations from removed agent requirements feature
])

const normalize = (agent: Schema.Schema.Type<typeof AgentSchema>): Schema.Schema.Type<typeof AgentSchema> => {
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/v1/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,6 @@ export const Info = Schema.Struct({
image_generation_model: Schema.optional(Schema.String).annotate({
description: "Model ID to use for image generation (default: openrouter/auto)",
}),
agent_requirements: Schema.optional(Schema.Boolean).annotate({
description: "Require declared agent skills, MCPs, and VS Code extensions before VS Code prompts can run",
}),
native_notebook_tools: Schema.optional(Schema.Boolean).annotate({
description: "Enable native tools for reading, editing, and executing VS Code notebooks",
}),
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

44 changes: 0 additions & 44 deletions packages/kilo-vscode/src/KiloProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
import { GitOps } from "./agent-manager/GitOps"
import { GitStatsPoller, type LocalStats } from "./agent-manager/GitStatsPoller"
import { createMarketplaceRemover, removeMcp } from "./kilo-provider/remove-config-item"
import { AgentRequirementsController } from "./kilo-provider/agent-requirements-controller"
import type { RemoteStatusService } from "./services/RemoteStatusService"
import { resolveProjectDirectory } from "./project-directory"
import { seedSessionStatuses } from "./session-status"
Expand Down Expand Up @@ -467,7 +466,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
private diffVirtualProvider: import("./DiffVirtualProvider").DiffVirtualProvider | undefined
private remoteService: RemoteStatusService | null = null
private unsubscribeRemote: (() => void) | null = null
private readonly requirements: AgentRequirementsController

constructor(
private readonly extensionUri: vscode.Uri,
Expand All @@ -480,24 +478,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
this.unsubscribeSandboxPreference = this.connectionService.sandboxPreference?.onChange(() => {
if (this.connectionState === "connected") void this.fetchAndSendSandboxDefault()
})
this.requirements = new AgentRequirementsController({
post: (msg) => this.postMessage(msg),
client: () => this.client,
connected: () => this.connectionState === "connected",
generation: () => this.connectionGeneration,
root: () => this.getRootDirectory(),
folders: () => vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath),
project: () => this.projectDirectory,
sessions: () => this.sessionDirectories,
worktrees: this.opts.worktreeDirectories,
extension: (id) => vscode.extensions.getExtension(id),
subscribe:
typeof vscode.extensions.onDidChange === "function"
? (listener) => vscode.extensions.onDidChange(listener)
: undefined,
error: getErrorMessage,
})

TelemetryProxy.getInstance().setProvider(this)
}

Expand Down Expand Up @@ -575,7 +555,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
this.cachedConfigMessage = null
this.postMessage({ type: "workspaceDirectoryChanged", directory: directory ?? "" })
this.postMessage({ type: "configBindingExpired", reason: "project-changed" })
this.requirements.clear()
}

public setDiffVirtualProvider(provider: import("./DiffVirtualProvider").DiffVirtualProvider): void {
Expand Down Expand Up @@ -663,7 +642,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
this.cachedAgentsMessage = null
this.cachedConfigMessage = null
await Promise.all([this.fetchAndSendAgents(), this.fetchAndSendConfig()])
this.requirements.clear()
},
storage: this.extensionContext?.globalStorageUri,
}
Expand Down Expand Up @@ -840,15 +818,13 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
const current = this.sessionDirectories.get(sessionId) ?? this.getRootDirectory()
this.aborts.preserve(sessionId, this.sessionStatusMap.get(sessionId), current)
this.sessionDirectories.set(sessionId, directory)
this.requirements.clear()
if (this.connectionState === "connected") void this.fetchAndSendSandboxStatus(sessionId)
}

public clearSessionDirectory(sessionId: string): void {
const current = this.sessionDirectories.get(sessionId) ?? this.getRootDirectory()
this.aborts.preserve(sessionId, this.sessionStatusMap.get(sessionId), current)
this.sessionDirectories.delete(sessionId)
this.requirements.clear()
if (this.connectionState === "connected") void this.fetchAndSendSandboxStatus(sessionId)
}

Expand Down Expand Up @@ -1275,16 +1251,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
case "requestSkills":
this.fetchAndSendSkills().catch((e) => console.error("[Kilo New] fetchAndSendSkills failed:", e))
break
case "requestAgentRequirements":
this.requirements
.fetch({
agent: message.agent,
directory: message.directory,
sessionID: message.sessionID,
force: message.force === true,
})
.catch((e) => console.error("[Kilo New] fetchAndSendAgentRequirements failed:", e))
break
case "requestCommands":
this.fetchAndSendCommands().catch((e) => console.error("[Kilo New] fetchAndSendCommands failed:", e))
break
Expand Down Expand Up @@ -1967,7 +1933,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
})
.catch((e: unknown) => console.warn("[Kilo New] KiloProvider: getSession failed (non-critical):", e))
this.postMessage({ type: "workspaceDirectoryChanged", directory: this.getWorkspaceDirectory(sessionID) })
this.requirements.clear()
this.client.session
.status({ directory: dir })
.then((r) => {
Expand Down Expand Up @@ -2661,7 +2626,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
this.cachedSkillsMessage = null
this.cachedCommandsMessage = null
await Promise.all([this.fetchAndSendSkills(), this.fetchAndSendCommands()])
this.requirements.clear()
return true
}

Expand All @@ -2678,7 +2642,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
}
this.cachedAgentsMessage = null
await this.fetchAndSendAgents()
this.requirements.clear()
}

private async handleRemoveMcp(name: string): Promise<void> {
Expand All @@ -2690,7 +2653,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper

private async refreshMcpStatus(): Promise<void> {
await this.fetchAndSendMcpStatus()
this.requirements.clear()
}

private async fetchAndSendMcpStatus(): Promise<void> {
Expand Down Expand Up @@ -3277,7 +3239,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
settings: this.configSettings(),
features: configFeatures(snapshot.effective),
})
this.requirements.clear()
await Promise.all([
refreshProviders ? this.fetchAndSendProviders() : Promise.resolve(),
refreshAgents ? this.fetchAndSendAgents() : Promise.resolve(),
Expand Down Expand Up @@ -3740,7 +3701,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
}
parts.push({ type: "text", text, metadata: review ? reviewMetadata(review) : undefined })

await this.requirements.assertAgentRequirements(agent, dir)
const editorContext = await this.gatherEditorContext(dir)
if (draftID && this.closedDrafts.delete(draftID)) {
for (const [k, v] of this.draftSessions) if (v.sid === sid) this.draftSessions.delete(k)
Expand Down Expand Up @@ -3835,7 +3795,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
source: f.source,
}))

await this.requirements.assertAgentRequirements(agent, dir)
await this.checkpoints.get(sid)
await runWithMessageConfirmation(this.confirmations, messageID, "KiloProvider: Command request", () =>
this.withRetry(
Expand Down Expand Up @@ -4205,7 +4164,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper

/** Re-fetch all server-side state after an auth change. */
private async reloadAfterAuthChange(): Promise<void> {
this.requirements.clear()
await this.fetchAndSendConfig()
await Promise.all([
this.fetchAndSendProviders(),
Expand Down Expand Up @@ -4511,7 +4469,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
// Fetch and push the updated config + refresh agents and providers so the
// Settings panel and mode/model pickers reflect the change.
if (event.type === "global.config.updated") {
this.requirements.clear()
void Promise.all([this.fetchAndSendConfigUpdated(), this.fetchAndSendAgents(), this.fetchAndSendProviders()])
return
}
Expand Down Expand Up @@ -5151,7 +5108,6 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
this.anacondaDesktop.dispose()
this.aborts.clear()
this.sessionStatusMap.clear()
this.requirements.dispose()
this.ignoreController?.dispose()
this.chatAutocomplete?.dispose()
disposeGitChangesTarget()
Expand Down
Loading
Loading