Run your first AI agent task — from ticket to deployed fix.
Your First Agent
This guide walks you through creating a ticket, assigning it to an AI agent, watching the agent work, reviewing the output, and deploying the fix. By the end, you will have seen the full loop: ticket to deployed code.
1. Create a Ticket
Via the Dashboard
- Go to your project in the Codmir dashboard
- Click New Ticket
- Fill in the details:
- Title: "Fix password reset email not sending"
- Type: Bug
- Priority: High
- Click Create
Via the API
import { CodmirClient } from '@codmir/sdk';
const client = new CodmirClient({
apiKey: process.env.CODMIR_API_KEY,
});
const ticket = await client.createTicket({
projectId: 'my-project-id',
title: 'Fix password reset email not sending',
description: 'Users report that clicking "Reset Password" shows success but no email arrives. Check the email service integration and SMTP configuration.',
type: 'bug',
priority: 'high',
});
console.log(`Ticket created: ${ticket.id}`);2. Assign to an AI Agent
Via the Dashboard
- Open the ticket
- Click Assign to Agent
- Select the agent type (or let Codmir auto-select)
- Click Start
Via the API
const task = await client.createAgentTask({
projectId: 'my-project-id',
type: 'bug_fix',
title: 'Fix password reset email not sending',
description: 'Investigate why password reset emails are not being sent. Check email service, SMTP config, and error logs.',
priority: 'high',
});
console.log(`Agent task created: ${task.id}`);
console.log(`Status: ${task.status}`);3. Watch the Agent Work
Once assigned, the agent follows this workflow:
- Investigate -- reads error logs, traces the code path, checks configuration
- Plan -- creates a task breakdown with specific files to change
- Code -- writes the fix, following project conventions from the Cortex Protocol
- Test -- runs the test suite against the changes
- PR -- opens a pull request with the fix
Monitor Progress via API
// Check task status
const task = await client.getAgentTask('task-id');
console.log(`Status: ${task.status}`);
// Stream real-time updates
const stream = await client.createFrameworkTaskStream('task-id');
stream.subscribe((event) => {
console.log(`[${event.type}] ${event.data.message || ''}`);
});Monitor via the Orchestrator
If you have the Overseer orchestrator running, check what the agent is doing:
import { createOrchestrator } from '@codmir/overseer';
const orchestrator = createOrchestrator({
overseer: {
projectId: 'my-project-id',
organizationId: 'my-org',
apiKey: process.env.CODMIR_API_KEY!,
},
defaultRepoUrl: 'https://github.com/my-org/my-app',
defaultBranch: 'main',
});
// "What are you working on?"
const summary = orchestrator.getStatusSummary();
console.log(summary);
// Is it already handling this ticket?
const handling = orchestrator.isWorkingOn('ticket-id');
console.log(`Already on it: ${handling}`);4. Review and Approve
When the agent finishes, you receive a notification. The pull request includes:
- A description of the root cause
- The code changes with explanations
- Test results
- A link back to the original ticket
Review the PR as you would any human-authored code:
// List agent tasks and their results
const tasks = await client.listAgentTasks('my-project-id');
for (const task of tasks) {
if (task.status === 'completed') {
console.log(`${task.title}: ${task.status}`);
}
}5. Auto-Deploy
If your CI/CD pipeline is connected, merging the PR triggers an automatic deployment. Codmir tracks the deployment and monitors for regressions.
If a regression is detected after deployment:
- Overseer captures the new errors
- The DecisionEngine evaluates severity
- If critical, the fix is reverted automatically
- You are notified via the configured escalation chain
The Full Loop
Ticket Created
↓
Agent Assigned
↓
Investigate → Plan → Code → Test → PR
↓
Human Review
↓
Merge → Deploy → Monitor
↓
(Regression?) → Auto-Revert → EscalateUsing Developer Agents
For more control over the agent's behavior, use the DevTeam from @codmir/ai:
import { createDevTeam } from '@codmir/ai';
const team = createDevTeam({
projectContext: {
projectId: 'my-project',
name: 'My App',
techStack: ['TypeScript', 'Next.js', 'Prisma'],
},
});
const result = await team.assignTicket({
id: 'TICKET-42',
title: 'Fix password reset email',
description: 'Password reset emails are not sending',
priority: 'high',
status: 'open',
});
console.log(result.plan); // Task breakdown
console.log(result.changes); // Files modified
console.log(result.tests); // Tests written or updatedNext Steps
- Self-Healing -- let agents fix bugs automatically without creating tickets
- Swarm Execution -- scale agent work across thousands of workers
- Cortex Protocol -- give agents deep project context for better fixes