Commit bfb4d57
authored
[app-server-protocol] Add types for config (#7658)
Currently the config returned by `config/read` in untyped. Add types so
it's easier for client to parse the config. Since currently configs are
all defined in snake case we'll keep that instead of using camel case
like the rest of V2.
Sample output by testing using the app server test client:
```
{
< "id": "f28449f4-b015-459b-b07b-eef06980165d",
< "result": {
< "config": {
< "approvalPolicy": null,
< "compactPrompt": null,
< "developerInstructions": null,
< "features": {
< "experimental_use_rmcp_client": true
< },
< "forcedChatgptWorkspaceId": null,
< "forcedLoginMethod": null,
< "instructions": null,
< "model": "gpt-5.1-codex-max",
< "modelAutoCompactTokenLimit": null,
< "modelContextWindow": null,
< "modelProvider": null,
< "modelReasoningEffort": null,
< "modelReasoningSummary": null,
< "modelVerbosity": null,
< "model_providers": {
< "local": {
< "base_url": "http://localhost:8061/api/codex",
< "env_http_headers": {
< "ChatGPT-Account-ID": "OPENAI_ACCOUNT_ID"
< },
< "env_key": "CHATGPT_TOKEN_STAGING",
< "name": "local",
< "wire_api": "responses"
< }
< },
< "model_reasoning_effort": "medium",
< "notice": {
< "hide_gpt-5.1-codex-max_migration_prompt": true,
< "hide_gpt5_1_migration_prompt": true
< },
< "profile": null,
< "profiles": {},
< "projects": {
< "/Users/celia/code": {
< "trust_level": "trusted"
< },
< "/Users/celia/code/codex": {
< "trust_level": "trusted"
< },
< "/Users/celia/code/openai": {
< "trust_level": "trusted"
< }
< },
< "reviewModel": null,
< "sandboxMode": null,
< "sandboxWorkspaceWrite": null,
< "tools": {
< "viewImage": null,
< "webSearch": null
< }
< },
< "origins": {
< "features.experimental_use_rmcp_client": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "model": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "model_providers.local.base_url": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "model_providers.local.env_http_headers.ChatGPT-Account-ID": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "model_providers.local.env_key": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "model_providers.local.name": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "model_providers.local.wire_api": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "model_reasoning_effort": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "notice.hide_gpt-5.1-codex-max_migration_prompt": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "notice.hide_gpt5_1_migration_prompt": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "projects./Users/celia/code.trust_level": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "projects./Users/celia/code/codex.trust_level": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "projects./Users/celia/code/openai.trust_level": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< },
< "tools.web_search": {
< "name": "user",
< "source": "/Users/celia/.codex/config.toml",
< "version": "sha256:a1d8eaedb5d9db5dfdfa69f30fa9df2efec66bb4dd46aa67f149fcc67cd0711c"
< }
< }
< }
< }
```1 parent 4953b2a commit bfb4d57
File tree
3 files changed
+222
-50
lines changed- codex-rs
- app-server-protocol/src/protocol
- app-server
- src
- tests/suite/v2
3 files changed
+222
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
125 | | - | |
126 | | - | |
127 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
128 | 149 | | |
129 | | - | |
| 150 | + | |
130 | 151 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
134 | 160 | | |
135 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
136 | 191 | | |
137 | 192 | | |
138 | 193 | | |
| |||
159 | 214 | | |
160 | 215 | | |
161 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
162 | 283 | | |
163 | 284 | | |
164 | 285 | | |
| |||
237 | 358 | | |
238 | 359 | | |
239 | 360 | | |
240 | | - | |
| 361 | + | |
241 | 362 | | |
242 | 363 | | |
243 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | | - | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
773 | 776 | | |
774 | 777 | | |
775 | 778 | | |
| 779 | + | |
776 | 780 | | |
777 | 781 | | |
778 | 782 | | |
| |||
895 | 899 | | |
896 | 900 | | |
897 | 901 | | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
| 902 | + | |
902 | 903 | | |
903 | 904 | | |
904 | 905 | | |
| |||
953 | 954 | | |
954 | 955 | | |
955 | 956 | | |
956 | | - | |
957 | | - | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
958 | 961 | | |
959 | 962 | | |
960 | 963 | | |
| |||
1093 | 1096 | | |
1094 | 1097 | | |
1095 | 1098 | | |
1096 | | - | |
| 1099 | + | |
1097 | 1100 | | |
1098 | 1101 | | |
1099 | 1102 | | |
| |||
0 commit comments