merge: land monit contract + diagnose-evidence SDK fixes onto main#33
Merged
Conversation
feat(sdk): model monit diagnose evidence
Regenerated from flashduty-docs after the monit contract sync and the a2a
tag repair (flashduty-docs PR #190).
What changes for consumers:
ToolInvokeResponseResultsItem gains Summary, Params and Truncated.
These have been missing since the type was first generated, so
`fduty monit-agent invoke` silently dropped the per-tool summary on
every successful call — the field simply had nowhere to decode into.
Verified against the live dev API: rebuilding the CLI on this SDK turns
[agent_elapsed_ms data e2e_elapsed_ms error tool tool_version]
into
[agent_elapsed_ms data e2e_elapsed_ms error params summary tool
tool_version truncated]
with a real summary line ("os.overview cpu=30.69% mem=74.53% ...").
Diagnose evidence types now come from the docs spec rather than a
hand-edited vendored copy, so `make sync-spec` no longer erases them.
New services Licenses and SessionReplay appear because the docs spec has
moved on since this branch last synced. No service is lost — the
generated service set is a strict superset of the previous one.
Note on `en.go`: regenerating against the *unfixed* docs spec produced a
bogus `EnService` and dropped `A2aAgents` entirely, because seven
/safari/a2a-agent/* operations carried a bare "en"/"zh" tag instead of
"AI SRE/A2A agents". That is fixed on the docs side in the same PR; the
stale generated file is removed here.
Still outstanding: response structs decode absent optional objects into
zero values, so the CLI re-serializes `error:{"code":"","message":""}` and
`truncated:{"reason":""}` even though the API omits both. That needs a
generator change (optional nested structs in response types should emit as
pointers with omitempty) and is deliberately not bundled into this regen.
…ving spec
Picks up flashduty-docs' x-flashduty-preserve-absence markers on the sparse
tool-invoke / tool-catalog response fields. The generator already honours the
extension (internal/cmd/gen/main.go), so this is a pure spec-driven regen:
10 fields move from value types to *T + omitempty, matching monit-webapi's
omit-when-empty wire contract.
Closes the second half of the monit contract drift: consumers no longer
materialise a fabricated error:{"code":"","message":""} / truncated:{"reason":""}
on successful calls. params, tool, and the two elapsed counters stay value
types — webapi always emits them.
Spec-driven regen from flashduty-docs. `ToolInvokeResponseError.TargetKinds`
and `ToolCatalogResponseError.TargetKinds` become `*[]string` + omitempty,
matching webapi's `json:"target_kinds,omitempty"`.
Verified on live dev: a CLI built from this SDK now returns a bare
{"error":{"code","message"},"tools":[]} on the target_unavailable path,
byte-shape-identical to the webapi response. Previously it appended
"target_kinds": null.
Example-only change; models_gen.go is byte-identical. TestSpecExamplesRoundTrip green against the live-captured failure entry.
regen: sync SDK with corrected monit + a2a specs
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.
Why
mainandfeat/api-review-auto-fixdiverged at PR #27. Since then:mainpicked up PR fix: clarify non-JSON 5xx responses as intermediary/gateway errors #32 (clearer error message for non-JSON 5xx responses from intermediaries/gateways).feat/api-review-auto-fixpicked up PR feat(sdk): model monit diagnose evidence #29 (SDK sync for automation run + monit diagnose evidence) and PR regen: sync SDK with corrected monit + a2a specs #31 (monit tool-invoke response now correctly decodessummary/params/truncatedas sparse/absent-preserving fields instead of silently dropping them, plus atarget_kindsnull-leak fix and newLicenses/SessionReplayservices).The released flashduty-cli has been pinned to a
feat/api-review-auto-fixpseudo-version this whole time (not a taggedmainrelease), specifically to get the monit sparse-field fixes. That's a stopgap — the CLI can't cut a clean tagged release againstmainuntil these two lines are back together.What this does
Merges
feat/api-review-auto-fixintomain, bringing PR #29 + PR #31's monit/diagnose/licenses/session-replay work onto the same branch as PR #32's gateway error fix. No manual conflict resolution was needed —flashduty.go(touched by both sides) auto-merged cleanly.Verification
Local test-merge of
origin/feat/api-review-auto-fixintoorigin/main:go build ./...— cleango vet ./...— cleango test -race -count=1 ./...— all packages passgo generate ./...followed bygit diff— no drift (matches CI's generate-drift gate)After this merges
go-flashduty gets a new tag (next patch after the current
v0.5.6) on the merge commit, and flashduty-cli bumps to that tag — replacing its current pseudo-version pin with a normal tagged release.