Skip to content

Commit 0e3b5d2

Browse files
committed
refactor: update default model and provider settings in agent configuration
- Changed default provider from "anthropic" to "openai" and updated the default model to "gpt-5.2" in agent metadata. - Added a new development command for the TUI and gateway integration in package.json. - Updated CLI banner art to reflect the new branding and simplified tagline. - Enhanced the development configuration to seed the default model in the OpenSoul config. - Adjusted the OpenAI default model constant to match the new version.
1 parent 975f9fa commit 0e3b5d2

7 files changed

Lines changed: 69 additions & 77 deletions

File tree

‎.npmrc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
allow-build-scripts=@whiskeysockets/baileys,sharp,esbuild,protobufjs,fs-ext,node-pty,@lydell/node-pty,@matrix-org/matrix-sdk-crypto-nodejs
22

3-
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
3+
# Configure GitHub Packages auth token in user-level ~/.npmrc when needed:
4+
# //npm.pkg.github.com/:_authToken=ghp_xxx
45
@njx-njx:registry=https://npm.pkg.github.com

‎package.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@
5050
"./cli-entry": "./opensoul.mjs"
5151
},
5252
"publishConfig": {
53-
"registry": "https://registry.npmjs.org",
54-
"access": "public"
53+
"access": "public",
54+
"registry": "https://registry.npmjs.org"
5555
},
5656
"scripts": {
57-
"preinstall": "node scripts/check-node-version.mjs",
5857
"android:assemble": "cd apps/android && ./gradlew :app:assembleDebug",
5958
"android:install": "cd apps/android && ./gradlew :app:installDebug",
6059
"android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.opensoul.android/.MainActivity",
@@ -67,6 +66,7 @@
6766
"check:docs": "pnpm format:docs && pnpm lint:docs && pnpm docs:build",
6867
"check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 2000 --max-function 150 --top 10 --report .check-loc-report.json",
6968
"dev": "node scripts/run-node.mjs",
69+
"dev:tui+gateway": "set OPENSOUL_PROFILE=dev&& start \"opensoul-gateway\" cmd /k \"set OPENSOUL_SKIP_CHANNELS=1&& set OPENSOUL_GATEWAY_TOKEN=dev-token&& node scripts/run-node.mjs --dev gateway\" && timeout /t 2 >nul && pnpm opensoul --dev tui --token dev-token",
7070
"docs:bin": "node scripts/build-docs-list.mjs",
7171
"docs:build": "cd docs && pnpm dlx --reporter append-only mint broken-links",
7272
"docs:check-links": "node scripts/docs-link-audit.mjs",
@@ -98,6 +98,7 @@
9898
"opensoul": "node scripts/run-node.mjs",
9999
"opensoul:rpc": "node scripts/run-node.mjs agent --mode rpc --json",
100100
"plugins:sync": "node --import tsx scripts/sync-plugin-versions.ts",
101+
"preinstall": "node scripts/check-node-version.mjs",
101102
"prepack": "pnpm build && pnpm ui:build",
102103
"prepare": "command -v git >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0",
103104
"protocol:check": "pnpm protocol:gen && pnpm protocol:gen:swift && git diff --exit-code -- dist/protocol.schema.json apps/macos/Sources/OpenSoulProtocol/GatewayModels.swift",

‎src/agents/defaults.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Defaults for agent metadata when upstream does not supply them.
2-
// Model id uses pi-ai's built-in Anthropic catalog.
3-
export const DEFAULT_PROVIDER = "anthropic";
4-
export const DEFAULT_MODEL = "claude-opus-4-6";
2+
// Model id uses the configured provider/model runtime catalog.
3+
export const DEFAULT_PROVIDER = "openai";
4+
export const DEFAULT_MODEL = "gpt-5.2";
55
// Conservative fallback used when model metadata is unavailable.
66
export const DEFAULT_CONTEXT_TOKENS = 200_000;

‎src/cli/banner.ts‎

Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,6 @@ type BannerOptions = TaglineOptions & {
1212

1313
let bannerEmitted = false;
1414

15-
const graphemeSegmenter =
16-
typeof Intl !== "undefined" && "Segmenter" in Intl
17-
? new Intl.Segmenter(undefined, { granularity: "grapheme" })
18-
: null;
19-
20-
function splitGraphemes(value: string): string[] {
21-
if (!graphemeSegmenter) {
22-
return Array.from(value);
23-
}
24-
try {
25-
return Array.from(graphemeSegmenter.segment(value), (seg) => seg.segment);
26-
} catch {
27-
return Array.from(value);
28-
}
29-
}
30-
3115
const hasJsonFlag = (argv: string[]) =>
3216
argv.some((arg) => arg === "--json" || arg.startsWith("--json="));
3317

@@ -39,8 +23,8 @@ export function formatCliBannerLine(version: string, options: BannerOptions = {}
3923
const commitLabel = commit ?? "unknown";
4024
const tagline = pickTagline(options);
4125
const rich = options.richTty ?? isRich();
42-
const title = "🦞 OpenSoul";
43-
const prefix = "🦞 ";
26+
const title = "OpenSoul";
27+
const prefix = "";
4428
const columns = options.columns ?? process.stdout.columns ?? 120;
4529
const plainFullLine = `${title} ${version} (${commitLabel}) — ${tagline}`;
4630
const fitsOnOneLine = visibleWidth(plainFullLine) <= columns;
@@ -64,47 +48,26 @@ export function formatCliBannerLine(version: string, options: BannerOptions = {}
6448
return `${line1}\n${line2}`;
6549
}
6650

67-
const LOBSTER_ASCII = [
68-
"▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄",
69-
"██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██",
70-
"██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██",
71-
"██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██",
72-
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀",
73-
" 🦞 OPENSOUL 🦞 ",
74-
" ",
51+
const OPENSOUL_ASCII = [
52+
" ____ _____ _ ",
53+
" / __ \\ / ____| | |",
54+
" | | | |_ __ ___ _ __ | (___ ___ _ _| |",
55+
" | | | | '_ \\ / _ \\ '_ \\ \\___ \\ / _ \\| | | | |",
56+
" | |__| | |_) | __/ | | |____) | (_) | |_| | |",
57+
" \\____/| .__/ \\___|_| |_|_____/ \\___/ \\__,_|_|",
58+
" | | ",
59+
" |_| ",
7560
];
7661

7762
export function formatCliBannerArt(options: BannerOptions = {}): string {
7863
const rich = options.richTty ?? isRich();
7964
if (!rich) {
80-
return LOBSTER_ASCII.join("\n");
65+
return OPENSOUL_ASCII.join("\n");
8166
}
82-
83-
const colorChar = (ch: string) => {
84-
if (ch === "█") {
85-
return theme.accentBright(ch);
86-
}
87-
if (ch === "░") {
88-
return theme.accentDim(ch);
89-
}
90-
if (ch === "▀") {
91-
return theme.accent(ch);
92-
}
93-
return theme.muted(ch);
94-
};
95-
96-
const colored = LOBSTER_ASCII.map((line) => {
97-
if (line.includes("OPENSOUL")) {
98-
return (
99-
theme.muted(" ") +
100-
theme.accent("🦞") +
101-
theme.info(" OPENSOUL ") +
102-
theme.accent("🦞")
103-
);
104-
}
105-
return splitGraphemes(line).map(colorChar).join("");
106-
});
107-
67+
const linePalette = [theme.accentBright, theme.accent, theme.info, theme.accentDim];
68+
const colored = OPENSOUL_ASCII.map((line, index) =>
69+
linePalette[index % linePalette.length](line),
70+
);
10871
return colored.join("\n");
10972
}
11073

@@ -122,8 +85,9 @@ export function emitCliBanner(version: string, options: BannerOptions = {}) {
12285
if (hasVersionFlag(argv)) {
12386
return;
12487
}
88+
const art = formatCliBannerArt(options);
12589
const line = formatCliBannerLine(version, options);
126-
process.stdout.write(`\n${line}\n\n`);
90+
process.stdout.write(`\n${art}\n\n${line}\n\n`);
12791
bannerEmitted = true;
12892
}
12993

‎src/cli/gateway-cli/dev.ts‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import fs from "node:fs";
22
import os from "node:os";
33
import path from "node:path";
44
import type { OpenSoulConfig } from "../../config/types.js";
5+
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../../agents/defaults.js";
56
import { resolveWorkspaceTemplateDir } from "../../agents/workspace-templates.js";
67
import { resolveDefaultAgentWorkspaceDir } from "../../agents/workspace.js";
78
import { handleReset } from "../../commands/onboard-helpers.js";
@@ -14,6 +15,7 @@ export const DEV_IDENTITY_NAME = "sophie";
1415
const DEV_IDENTITY_THEME = "protocol droid";
1516
const DEV_IDENTITY_EMOJI = "🤖";
1617
const DEV_AGENT_WORKSPACE_SUFFIX = "dev";
18+
const DEV_DEFAULT_MODEL_REF = `${DEFAULT_PROVIDER}/${DEFAULT_MODEL}`;
1719

1820
async function loadDevTemplate(name: string, fallback: string): Promise<string> {
1921
try {
@@ -121,6 +123,37 @@ function enforceDevAgentInConfig(cfg: OpenSoulConfig, workspace: string): OpenSo
121123
};
122124
}
123125

126+
function seedDevDefaultModel(cfg: OpenSoulConfig): OpenSoulConfig {
127+
const defaults = cfg.agents?.defaults;
128+
const existingModel = defaults?.model;
129+
const primary =
130+
typeof existingModel === "string"
131+
? existingModel.trim()
132+
: typeof existingModel?.primary === "string"
133+
? existingModel.primary.trim()
134+
: "";
135+
if (primary) {
136+
return cfg;
137+
}
138+
139+
const nextModels = { ...defaults?.models };
140+
if (!nextModels[DEV_DEFAULT_MODEL_REF]) {
141+
nextModels[DEV_DEFAULT_MODEL_REF] = {};
142+
}
143+
144+
return {
145+
...cfg,
146+
agents: {
147+
...cfg.agents,
148+
defaults: {
149+
...defaults,
150+
model: { primary: DEV_DEFAULT_MODEL_REF },
151+
models: nextModels,
152+
},
153+
},
154+
};
155+
}
156+
124157
export async function ensureDevGatewayConfig(opts: { reset?: boolean }) {
125158
const workspace = resolveDevWorkspaceDir();
126159
if (opts.reset) {
@@ -133,7 +166,7 @@ export async function ensureDevGatewayConfig(opts: { reset?: boolean }) {
133166

134167
if (configExists && !opts.reset) {
135168
const cfg = loadConfig();
136-
const enforced = enforceDevAgentInConfig(cfg, workspace);
169+
const enforced = seedDevDefaultModel(enforceDevAgentInConfig(cfg, workspace));
137170
await writeConfigFile(enforced);
138171
} else {
139172
await writeConfigFile({
@@ -143,6 +176,10 @@ export async function ensureDevGatewayConfig(opts: { reset?: boolean }) {
143176
},
144177
agents: {
145178
defaults: {
179+
model: { primary: DEV_DEFAULT_MODEL_REF },
180+
models: {
181+
[DEV_DEFAULT_MODEL_REF]: {},
182+
},
146183
workspace,
147184
skipBootstrap: true,
148185
},

‎src/cli/tagline.ts‎

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const DEFAULT_TAGLINE = "All your chats, one OpenSoul.";
1+
const DEFAULT_TAGLINE = "thank you for using opensoul";
22

33
const HOLIDAY_TAGLINES = {
44
newYear:
@@ -252,19 +252,8 @@ export function activeTaglines(options: TaglineOptions = {}): string[] {
252252
}
253253

254254
export function pickTagline(options: TaglineOptions = {}): string {
255-
const env = options.env ?? process.env;
256-
const override = env?.OPENSOUL_TAGLINE_INDEX;
257-
if (override !== undefined) {
258-
const parsed = Number.parseInt(override, 10);
259-
if (!Number.isNaN(parsed) && parsed >= 0) {
260-
const pool = TAGLINES.length > 0 ? TAGLINES : [DEFAULT_TAGLINE];
261-
return pool[parsed % pool.length];
262-
}
263-
}
264-
const pool = activeTaglines(options);
265-
const rand = options.random ?? Math.random;
266-
const index = Math.floor(rand() * pool.length) % pool.length;
267-
return pool[index];
255+
void options;
256+
return DEFAULT_TAGLINE;
268257
}
269258

270259
export { TAGLINES, HOLIDAY_RULES, DEFAULT_TAGLINE };

‎src/commands/openai-model-default.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { OpenSoulConfig } from "../config/config.js";
22
import { ensureModelAllowlistEntry } from "./model-allowlist.js";
33

4-
export const OPENAI_DEFAULT_MODEL = "openai/gpt-5.1-codex";
4+
export const OPENAI_DEFAULT_MODEL = "openai/gpt-5.2";
55

66
export function applyOpenAIProviderConfig(cfg: OpenSoulConfig): OpenSoulConfig {
77
const next = ensureModelAllowlistEntry({

0 commit comments

Comments
 (0)