feat: add per-session model selection

This commit is contained in:
Peter Steinberger
2025-12-23 23:45:20 +00:00
parent b6bfd8e34f
commit 364a6a9444
34 changed files with 729 additions and 300 deletions

View File

@@ -46,24 +46,25 @@ export async function setupCommand(
const existingRaw = await readConfigFileRaw();
const cfg = existingRaw.parsed;
const inbound = cfg.inbound ?? {};
const agent = cfg.agent ?? {};
const workspace =
desiredWorkspace ?? inbound.workspace ?? DEFAULT_AGENT_WORKSPACE_DIR;
desiredWorkspace ?? agent.workspace ?? DEFAULT_AGENT_WORKSPACE_DIR;
const next: ClawdisConfig = {
...cfg,
inbound: {
...inbound,
agent: {
...agent,
workspace,
},
};
if (!existingRaw.exists || inbound.workspace !== workspace) {
if (!existingRaw.exists || agent.workspace !== workspace) {
await writeConfigFile(next);
runtime.log(
!existingRaw.exists
? `Wrote ${CONFIG_PATH_CLAWDIS}`
: `Updated ${CONFIG_PATH_CLAWDIS} (set inbound.workspace)`,
: `Updated ${CONFIG_PATH_CLAWDIS} (set agent.workspace)`,
);
} else {
runtime.log(`Config OK: ${CONFIG_PATH_CLAWDIS}`);