Skip to content
Merged
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
8 changes: 7 additions & 1 deletion aiprompts/config-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ waveterm/
```

**Key Files:**

- **[`pkg/wconfig/settingsconfig.go`](pkg/wconfig/settingsconfig.go)** - Defines the `SettingsType` struct with all configuration fields
- **[`schema/settings.json`](schema/settings.json)** - JSON Schema for validation and type checking
- **[`pkg/wconfig/defaultconfig/settings.json`](pkg/wconfig/defaultconfig/settings.json)** - Default values for all settings
Expand All @@ -65,10 +66,12 @@ Wave Terminal supports block-level configuration overrides through the metadata
3. **Block Metadata** - Override settings for individual blocks

**Key Files for Block Overrides:**

- **[`pkg/waveobj/wtypemeta.go`](pkg/waveobj/wtypemeta.go)** - Defines the `MetaTSType` struct for block-level metadata
- Block metadata fields should match the corresponding settings fields for consistency

**Frontend Usage:**

```typescript
// Use getOverrideConfigAtom for hierarchical config resolution
const settingValue = useAtomValue(getOverrideConfigAtom(blockId, "namespace:setting"));
Expand All @@ -77,6 +80,7 @@ const settingValue = useAtomValue(getOverrideConfigAtom(blockId, "namespace:sett
```

**Setting Block Metadata:**

```bash
# Set for current block
wsh setmeta namespace:setting=value
Expand Down Expand Up @@ -143,6 +147,7 @@ type MetaTSType struct {
```

**Block Metadata Guidelines:**

- Use pointer types (`*string`, `*bool`, `*int`, `*float64`) for optional overrides
- JSON tags should exactly match the corresponding settings field
- This enables the hierarchical config system: block metadata → connection config → global settings
Expand Down Expand Up @@ -197,7 +202,7 @@ If your setting should have a default value, add it to [`pkg/wconfig/defaultconf
```json
{
"ai:preset": "ai@global",
"ai:model": "gpt-4o-mini",
"ai:model": "gpt-5-mini",
// ... existing defaults ...

"mynew:setting": "default value",
Expand Down Expand Up @@ -239,6 +244,7 @@ task generate
```

Or run them individually:

```bash
# Regenerate JSON schema
task build:schema
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ For reference, this is the current default configuration (v0.11.5):
```json
{
"ai:preset": "ai@global",
"ai:model": "gpt-4o-mini",
"ai:maxtokens": 2048,
"ai:model": "gpt-5-mini",
"ai:maxtokens": 4000,
"ai:timeoutms": 60000,
"app:defaultnewblock": "term",
"autoupdate:enabled": true,
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/view/waveai/waveai.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class WaveAiModel implements ViewModel {
viewTextChildren.push({
elemtype: "iconbutton",
icon: "cloud",
title: "Using Wave's AI Proxy (gpt-4o-mini)",
title: "Using Wave's AI Proxy (gpt-5-mini)",
noAction: true,
});
} else {
Expand Down
6 changes: 3 additions & 3 deletions pkg/wconfig/defaultconfig/presets/ai.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"ai:*": true
},
"ai@wave": {
"display:name": "Wave Proxy - gpt-4o-mini",
"display:name": "Wave Proxy - gpt-5-mini",
"display:order": 0,
"ai:*": true,
"ai:apitype": "",
"ai:baseurl": "",
"ai:apitoken": "",
"ai:name": "",
"ai:orgid": "",
"ai:model": "gpt-4o-mini",
"ai:maxtokens": 2048,
"ai:model": "gpt-5-mini",
"ai:maxtokens": 4000,
"ai:timeoutms": 60000
}
}
4 changes: 2 additions & 2 deletions pkg/wconfig/defaultconfig/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ai:preset": "ai@global",
"ai:model": "gpt-4o-mini",
"ai:maxtokens": 2048,
"ai:model": "gpt-5-mini",
"ai:maxtokens": 4000,
"ai:timeoutms": 60000,
"app:defaultnewblock": "term",
"autoupdate:enabled": true,
Expand Down
Loading