mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(vscode): add allAgents to story mocks to fix storybook render errors
The AgentBehaviourTab now uses session.allAgents() but the story mocks only provided agents(), causing 'Cannot read properties of undefined (reading length)' errors in storybook.
This commit is contained in:
@@ -163,6 +163,7 @@ export function mockSessionValue(overrides?: {
|
||||
costBreakdown: () => [],
|
||||
contextUsage: () => undefined,
|
||||
agents: () => [{ name: "code", description: "Code mode", mode: "primary" as const }],
|
||||
allAgents: () => [{ name: "code", description: "Code mode", mode: "primary" as const }],
|
||||
skills: () => [],
|
||||
refreshSkills: noop,
|
||||
removeSkill: noop,
|
||||
|
||||
@@ -63,6 +63,7 @@ export const AgentBehaviourAgents: Story = {
|
||||
const session = {
|
||||
...mockSessionValue({ id: "agents-story", status: "idle" }),
|
||||
agents: () => MOCK_AGENTS,
|
||||
allAgents: () => MOCK_AGENTS,
|
||||
removeMode: noop,
|
||||
removeMcp: noop,
|
||||
skills: () => [],
|
||||
@@ -87,6 +88,7 @@ export const AgentBehaviourEditCustomMode: Story = {
|
||||
const session = {
|
||||
...mockSessionValue({ id: "edit-mode-story", status: "idle" }),
|
||||
agents: () => MOCK_AGENTS,
|
||||
allAgents: () => MOCK_AGENTS,
|
||||
removeMode: noop,
|
||||
removeMcp: noop,
|
||||
skills: () => [],
|
||||
@@ -179,6 +181,7 @@ export const AgentBehaviourWorkflows: Story = {
|
||||
const session = {
|
||||
...mockSessionValue({ id: "workflows-story", status: "idle" }),
|
||||
agents: () => MOCK_AGENTS,
|
||||
allAgents: () => MOCK_AGENTS,
|
||||
removeMode: noop,
|
||||
removeMcp: noop,
|
||||
skills: () => [],
|
||||
@@ -201,6 +204,7 @@ export const AgentBehaviourWorkflowsEmpty: Story = {
|
||||
const session = {
|
||||
...mockSessionValue({ id: "workflows-empty-story", status: "idle" }),
|
||||
agents: () => MOCK_AGENTS,
|
||||
allAgents: () => MOCK_AGENTS,
|
||||
removeMode: noop,
|
||||
removeMcp: noop,
|
||||
skills: () => [],
|
||||
@@ -298,6 +302,7 @@ export const ModeEditExport: Story = {
|
||||
const session = {
|
||||
...mockSessionValue({ id: "export-story", status: "idle" }),
|
||||
agents: () => MOCK_AGENTS,
|
||||
allAgents: () => MOCK_AGENTS,
|
||||
removeMode: noop,
|
||||
removeMcp: noop,
|
||||
skills: () => [],
|
||||
|
||||
Reference in New Issue
Block a user