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:
Mark IJbema
2026-04-08 13:36:24 +02:00
parent 359410fad2
commit 69754b851e
2 changed files with 6 additions and 0 deletions
@@ -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: () => [],