fix: require a model, default to empty value during onboarding

and add a WORKSPACE_PATH constant to make tracking that path easier
This commit is contained in:
Joe Fleming
2026-03-13 20:42:00 -06:00
parent 14aa1c1e7f
commit b6df31fcbf
4 changed files with 13 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
import { z } from 'zod';
import { WORKSPACE_PATH } from './constants.ts'
// ---------------------------------------------------------------------------
// Mattermost
@@ -41,7 +42,7 @@ export type ChannelsConfig = z.infer<typeof ChannelsConfigSchema>;
export const AgentConfigSchema = z.object({
model: z.string().default('anthropic/claude-sonnet-4-5'),
workspacePath: z.string().default('~/.config/nanobot'),
workspacePath: z.string().default(WORKSPACE_PATH),
maxTokens: z.number().int().default(4096),
contextWindowTokens: z.number().int().default(65536),
temperature: z.number().default(0.7),
@@ -113,14 +114,7 @@ export type HeartbeatConfig = z.infer<typeof HeartbeatConfigSchema>;
export const ConfigSchema = z.object({
providers: ProvidersConfigSchema.default(() => ({})),
agent: AgentConfigSchema.default(() => ({
model: 'anthropic/claude-sonnet-4-5',
workspacePath: '~/.config/nanobot',
maxTokens: 4096,
contextWindowTokens: 65536,
temperature: 0.7,
maxToolIterations: 40,
})),
agent: AgentConfigSchema,
heartbeat: HeartbeatConfigSchema.default(() => ({ enabled: false, intervalMinutes: 30 })),
channels: ChannelsConfigSchema.default(() => ({ sendProgress: true, sendToolHints: true })),
tools: ToolsConfigSchema.default(() => ({