Commit 7531470
committed
refactor(desktop): define the codecs of every payload this change touched
`desktop/AGENTS.md` requires an explicit `FromJson`/`ToJson` for anything
crossing the JSON boundary, and requires replacing a derived codec in the same
change that modifies its type. This change gave `agent.start`, `agent.compact`,
`agent.goal`, `session.load`(`_archived`) and `session.archive`/`unarchive` a
required `workspace`, and all five still derived theirs.
The five codecs now say what the derive left implicit, and say it the same way
the neighbouring payloads in this file already do. A required field must be
present and of its type; `null` is not a value for one, so it is refused rather
than read as absence — which for `workspace` is the point, since reading it as
an absent field would leave the host guessing which store was meant. An optional field reads
`null` and absence alike as `None` and refuses any other type, so a `null`
`text` still clears a goal rather than setting an empty one. Unknown fields are
ignored, which is what lets a host accept and drop a client-authored
`session_root`. The encoder writes every required field and omits an absent
optional instead of emitting `null`.
Reported by Codex on #886.1 parent 0f4ff34 commit 7531470
3 files changed
Lines changed: 385 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 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 | + | |
198 | 277 | | |
199 | 278 | | |
200 | 279 | | |
| |||
0 commit comments