waveterm/pkg
Geoff Hudik 78ab9e0b94
Add configurable verbosity for OpenAI Responses API (#2776)
# Add configurable verbosity for OpenAI Responses API

Fixes #2775

## Problem

Models like `gpt-5.2-codex` and other newer OpenAI models only support
`medium` reasoning and verbosity levels, but the codebase was using
`low` by default. This caused 400 Bad Request errors:

```
Failed to stream openai-responses chat: openai 400 Bad Request:
Unsupported value: 'low' is not supported with the 'gpt-5.2-codex' model.
Supported values are: 'medium'.
```


## Solution

This PR implements a scalable, user-configurable approach instead of
hardcoding model-specific constraints:

1. **Changed default verbosity** from `"low"` to `"medium"` - more
widely supported across OpenAI models
2. **Added `ai:verbosity` config option** - allows users to configure
verbosity per model in `waveai.json`
3. **Changed rate limit fallback** from `low` to `medium` thinking level
for better compatibility
4. **Removed hardcoded model checks** - solution is scalable for future
models

## Changes

### Backend Changes
- `pkg/aiusechat/openai/openai-convertmessage.go` - Use configurable
verbosity with safe defaults
- `pkg/aiusechat/uctypes/uctypes.go` - Add `Verbosity` field to
`AIOptsType`
- `pkg/aiusechat/usechat.go` - Pass verbosity from config to options
- `pkg/wconfig/settingsconfig.go` - Add `Verbosity` to
`AIModeConfigType`

### Schema Changes
- `schema/waveai.json` - Add `ai:verbosity` with enum values
(low/medium/high)
- `frontend/types/gotypes.d.ts` - Auto-generated TypeScript types

### Configuration Example

Users can now configure both thinking level and verbosity per model:

```json
{
  "openai-gpt52-codex": {
    "display:name": "GPT-5.2 Codex",
    "ai:provider": "openai",
    "ai:model": "gpt-5.2-codex",
    "ai:thinkinglevel": "medium",
    "ai:verbosity": "medium"
  }
}
```
2026-02-04 18:31:57 -08:00
..
aiusechat Add configurable verbosity for OpenAI Responses API (#2776) 2026-02-04 18:31:57 -08:00
authkey Happy new year! (#1684) 2025-01-04 20:56:57 -08:00
baseds very large refactor of wshrouter (#2732) 2026-01-01 17:44:00 -08:00
blockcontroller More Durable Shell Bug Fixes (#2822) 2026-02-04 11:10:21 -08:00
blocklogger conn updates 3 (#1711) 2025-01-10 14:09:32 -08:00
buildercontroller more misc builder improvements (#2592) 2025-11-24 13:37:24 -08:00
eventbus waveapps builder window (scaffolding, restructure AI panel to work in both builder and tab windows) (#2482) 2025-10-26 17:48:01 -07:00
faviconcache web bookmarks (#1930) 2025-02-07 16:11:40 -08:00
filebackup Add Write File Tools to WaveAI (#2492) 2025-10-31 14:40:03 -07:00
filestore Fix windows path for wsh url (#1798) 2025-01-22 17:28:59 -08:00
genconn WSL Updates for New Architecture (#1756) 2025-01-16 15:54:58 -08:00
gogen Embedded Structs in Code Generation (#1909) 2025-02-07 13:13:47 -08:00
ijson Happy new year! (#1684) 2025-01-04 20:56:57 -08:00
jobcontroller More Durable Shell Bug Fixes (#2822) 2026-02-04 11:10:21 -08:00
jobmanager More Durable Shell Bug Fixes (#2822) 2026-02-04 11:10:21 -08:00
panichandler new tevents analytics framework (#1894) 2025-02-03 15:32:44 -08:00
remote Session Durability Checkpoint (#2821) 2026-02-03 11:49:52 -08:00
schema settings schema.json (#1874) 2025-02-03 14:20:50 -08:00
secretstore minor v0.13 fixes (#2649) 2025-12-08 21:58:54 -08:00
service Persistent Terminal Sessions (+ improvements and bug fixes) (#2806) 2026-01-28 13:30:48 -08:00
shellexec More Durable Shell Bug Fixes (#2822) 2026-02-04 11:10:21 -08:00
streamclient new job manager / framework for creating persistent remove sessions (#2779) 2026-01-21 16:54:18 -08:00
suggestion Do not allow large/recursive file transfers (for now), remove s3 and wavefile fs implementations (#2808) 2026-01-28 14:28:31 -08:00
telemetry first definition of "first day", and minor doc mod (#2810) 2026-01-28 16:11:57 -08:00
trimquotes Add license identifiers to missing files (#1806) 2025-01-22 20:06:36 -08:00
tsgen Session Durability Checkpoint (#2821) 2026-02-03 11:49:52 -08:00
tsunamiutil builder secrets, builder config/data tab hooked up (#2581) 2025-11-21 10:36:51 -08:00
userinput Known Hosts User Input Fix (#1778) 2025-01-20 14:38:40 -08:00
util More Durable Shell Bug Fixes (#2822) 2026-02-04 11:10:21 -08:00
utilds Persistent Terminal Sessions (+ improvements and bug fixes) (#2806) 2026-01-28 13:30:48 -08:00
vdom Happy new year! (#1684) 2025-01-04 20:56:57 -08:00
waveai update to gpt-5.1 (#2552) 2025-11-13 21:10:28 -08:00
waveapp Persistent Terminal Sessions (+ improvements and bug fixes) (#2806) 2026-01-28 13:30:48 -08:00
waveappstore show apps icon in the widgets bar which shows a tsunami app launcher (#2554) 2025-11-14 09:34:14 -08:00
waveapputil v0.12.4 release notes (#2590) 2025-11-21 16:03:15 -08:00
wavebase Tab Indicators, Confirm on Quit, etc (#2811) 2026-01-29 17:04:29 -08:00
wavejwt Persistent Terminal Sessions (+ improvements and bug fixes) (#2806) 2026-01-28 13:30:48 -08:00
waveobj Session Durability Checkpoint (#2821) 2026-02-03 11:49:52 -08:00
wcloud very large refactor of wshrouter (#2732) 2026-01-01 17:44:00 -08:00
wconfig Add configurable verbosity for OpenAI Responses API (#2776) 2026-02-04 18:31:57 -08:00
wcore More Durable Shell Bug Fixes (#2822) 2026-02-04 11:10:21 -08:00
web Do not allow large/recursive file transfers (for now), remove s3 and wavefile fs implementations (#2808) 2026-01-28 14:28:31 -08:00
wps Session Durability Checkpoint (#2821) 2026-02-03 11:49:52 -08:00
wshrpc Session Durability Checkpoint (#2821) 2026-02-03 11:49:52 -08:00
wshutil Do not allow large/recursive file transfers (for now), remove s3 and wavefile fs implementations (#2808) 2026-01-28 14:28:31 -08:00
wsl More Durable Shell Bug Fixes (#2822) 2026-02-04 11:10:21 -08:00
wslconn very large refactor of wshrouter (#2732) 2026-01-01 17:44:00 -08:00
wstore Persistent Terminal Sessions (+ improvements and bug fixes) (#2806) 2026-01-28 13:30:48 -08:00