fix: regenerate API client for SessionResponse additionalProperties - #78
Merged
Conversation
The staging OpenAPI spec at us-staging.notte.cc set `additionalProperties: true` on the SessionResponse schema between 2026-08-27 16:02 UTC and 2026-08-28 09:07 UTC. oapi-codegen responds by emitting an AdditionalProperties map plus Get/Set/MarshalJSON/ UnmarshalJSON methods, which the committed client.gen.go lacked. Since the "Check generated code is up to date" CI step regenerates against the live spec, every run after that deploy went red regardless of its contents -- including the goreleaser brew-formula bump on main (693b501), whose only diff was nine lines of Formula/notte.rb checksums, and unrelated PR branches. Regenerated with `make generate`; no hand edits. SearchRequest already carried the same treatment from #76. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| internal/api/client.gen.go | Adds generated SessionResponse additional-property round-tripping correctly, but without a focused integration regression test. |
Prompt To Fix All With AI
### Issue 1
internal/api/client.gen.go:3684-3699
**Missing additional-properties regression test**
The new `SessionResponse` decoding and encoding behavior has no integration test covering preservation of unknown properties, so later schema or generator changes can silently break this round trip. Repository bug-fix guidelines require at least one integration test.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix: regenerate API client for SessionRe..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Regenerates
internal/api/client.gen.goviamake generate. No hand edits.Why
CI's "Check generated code is up to date" step has been red on every run since ~09:00 UTC today, including
mainand unrelated PR branches.Nothing in the repo broke it. That step regenerates against the live staging spec (
scripts/generate.shcurlshttps://us-staging.notte.cc/openapi.jsonat job time), so its input can change without a commit. Between 2026-08-27 16:02 UTC (last greenmain) and 2026-08-28 09:07 UTC (first red), a staging deploy setadditionalProperties: trueon theSessionResponseschema.oapi-codegen reacts by emitting an
AdditionalPropertiesmap plusGet/Set/MarshalJSON/UnmarshalJSONmethods — 433 lines the committed file lacked, sogit status --porcelaincame back dirty and the step exited 1.The clearest evidence it isn't commit-related: the red
mainrun is693b501, the goreleaser brew bump, whose entire diff over the previous green run is nine lines ofFormula/notte.rbchecksums and zero Go files.SearchRequestalready carried the identical treatment from #76 — this is the same drift recurring on a second schema.Diff
SessionResponsegainsAdditionalProperties map[string]interface{}json:"-"Get/Set/UnmarshalJSON/MarshalJSONforSessionResponseByte-identical to what CI produced in its failure output.
Verification
Ran locally against the regenerated tree:
go build -v ./...— cleango test -race -short ./...— all 11 packages passgolangci-lint run ./...— 0 issues (local v2.8.0; CI pins v2.12.0)./scripts/generate.shis now a no-op, which is what the failing step assertsFollow-up worth considering
This will recur on the next staging schema change. Because generation hits a live server, the check can go red on any push with no code change, and a push during a partial rollout could bake a half-deployed schema into the client. Vendoring a spec snapshot refreshed by an explicit PR would make CI deterministic. Out of scope here — flagging it, not doing it.
🤖 Generated with Claude Code