Skip to content
Open
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
2 changes: 1 addition & 1 deletion cloud-agent-next/src/kilo/wrapper-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ describe('WrapperClient', () => {
const options: WrapperPromptOptions = {
prompt: 'Complex prompt',
model: { providerID: 'kilo', modelID: 'anthropic/claude-sonnet-4-20250514' },
agent: 'build',
agent: 'code',
messageId: 'msg_custom',
system: 'You are a helpful assistant',
tools: { read_file: true, write_file: false },
Expand Down
2 changes: 1 addition & 1 deletion cloud-agent-next/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type CloudAgentTags = {
inflightId?: string;

// Execution context
mode?: 'plan' | 'code' | 'build' | 'orchestrator' | 'architect' | 'ask' | 'custom';
mode?: 'plan' | 'code' | 'debug' | 'build' | 'orchestrator' | 'architect' | 'ask' | 'custom';
model?: string;
isResume?: boolean;

Expand Down
2 changes: 1 addition & 1 deletion cloud-agent-next/src/persistence/CloudAgentSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ export class CloudAgentSession extends DurableObject {
metadata.gitToken = request.tokenOverrides.gitToken;
}

const mode = (request.mode ?? metadata.mode ?? 'build') as ExecutionMode;
const mode = (request.mode ?? metadata.mode ?? 'code') as ExecutionMode;
const model = normalizeKilocodeModel(request.model ?? metadata.model);
if (!model) {
return this.buildStartError(
Expand Down
4 changes: 2 additions & 2 deletions cloud-agent-next/src/router.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ describe('router sessionId validation', () => {
gitUrl: undefined,
gitToken: undefined,
prompt: 'Build a feature',
mode: 'build',
mode: 'code',
model: 'claude-3-sonnet',
autoCommit: true,
upstreamBranch: 'main',
Expand All @@ -667,7 +667,7 @@ describe('router sessionId validation', () => {
expect(result.orgId).toBe('org-123');
expect(result.githubRepo).toBe('acme/repo');
expect(result.prompt).toBe('Build a feature');
expect(result.mode).toBe('build');
expect(result.mode).toBe('code');
expect(result.model).toBe('claude-3-sonnet');
expect(result.autoCommit).toBe(true);
expect(result.upstreamBranch).toBe('main');
Expand Down
41 changes: 23 additions & 18 deletions cloud-agent-next/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,31 @@ import type { MCPServerConfig } from './persistence/types.js';
* Internal agent modes used by the kilo CLI.
* These are the actual modes passed to `kilo run --agent <mode>`.
*/
export const InternalAgentModes = ['plan', 'code', 'custom'] as const;
export const InternalAgentModes = [
'code',
'plan',
'debug',
'orchestrator',
'ask',
'custom',
] as const;
export type InternalAgentMode = (typeof InternalAgentModes)[number];

/**
* Input agent modes accepted by the API.
* These include aliases that map to internal modes:
* - plan: maps to 'plan'
* - code: maps to 'code'
* - build: maps to 'code' (alias)
* - orchestrator: maps to 'code' (alias)
* - architect: maps to 'plan' (alias)
* - ask: maps to 'plan' (alias)
* - custom: maps to 'custom'
* These include backward-compatible aliases:
* - build: maps to 'code'
* - architect: maps to 'plan'
* All other modes pass through 1:1 to the CLI.
*/
export const AgentModes = [
'plan',
'code',
'build',
'plan',
'debug',
'orchestrator',
'architect',
'ask',
'build',
'architect',
'custom',
] as const;
export type AgentMode = (typeof AgentModes)[number];
Expand All @@ -37,16 +41,17 @@ export const AgentModeSchema = z.enum(AgentModes);
*/
export function normalizeAgentMode(mode: AgentMode): InternalAgentMode {
switch (mode) {
case 'build':
return 'code';
case 'architect':
case 'ask':
case 'plan':
return 'plan';
case 'orchestrator':
case 'build':
case 'code':
return 'code';
case 'plan':
case 'debug':
case 'orchestrator':
case 'ask':
case 'custom':
return 'custom';
return mode;
}
}

Expand Down
Loading