OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Updates an existing AI agent configuration.
Goal
Allow users to modify agent settings and configuration.
Context
Called from the agent settings UI.
Source Definition
import {
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
import { AgentStatusEnum, ModelProviderEnum } from './agent.enum';
import { AgentCreatedEvent } from './agent.event';
import {
AgentSummaryModel,
AgentWithToolsModel,
CreateAgentInputModel,
UpdateAgentInputModel,
} from './agent.schema';
export const UpdateAgentCommand = defineCommand({
meta: {
key: 'agent-console.agent.update',
version: '1.0.0',
stability: 'stable',
owners: ['@agent-console-team'],
tags: ['agent', 'update'],
description: 'Updates an existing AI agent configuration.',
goal: 'Allow users to modify agent settings and configuration.',
context: 'Called from the agent settings UI.',
},
io: {
input: UpdateAgentInputModel,
output: defineSchemaModel({
name: 'UpdateAgentOutput',
fields: {
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
status: { type: AgentStatusEnum, isOptional: false },
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
},
}),
errors: {
AGENT_NOT_FOUND: {
description: 'The specified agent does not exist',
http: 404,
gqlCode: 'AGENT_NOT_FOUND',
when: 'Agent ID is invalid',
},
},
},
policy: { auth: 'user' },
sideEffects: {
emits: [
{
key: 'agent.updated',
version: '1.0.0',
stability: 'stable',
owners: ['@agent-console-team'],
tags: ['agent', 'updated'],
when: 'Agent is updated',
payload: AgentSummaryModel,
},
],
audit: ['agent.updated'],
},
acceptance: {
scenarios: [
{
key: 'update-agent-happy-path',
given: ['Agent exists', 'User owns the agent'],
when: ['User submits updated configuration'],
then: ['Agent is updated', 'AgentUpdated event is emitted'],
},
{
key: 'update-agent-not-found',
given: ['Agent does not exist'],
when: ['User attempts to update'],
then: ['AGENT_NOT_FOUND error is returned'],
},
],
examples: [
{
key: 'update-name',
input: {
agentId: 'agent-123',
name: 'Updated Assistant',
systemPrompt: 'You are a helpful assistant.',
},
output: {
id: 'agent-123',
name: 'Updated Assistant',
status: 'draft',
updatedAt: '2025-01-01T00:00:00Z',
},
},
],
},
});