Skip to content

merge: land monit contract + diagnose-evidence SDK fixes onto main#33

Merged
ysyneu merged 12 commits into
mainfrom
feat/api-review-auto-fix
Jul 21, 2026
Merged

merge: land monit contract + diagnose-evidence SDK fixes onto main#33
ysyneu merged 12 commits into
mainfrom
feat/api-review-auto-fix

Conversation

@ysyneu

@ysyneu ysyneu commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Why

main and feat/api-review-auto-fix diverged at PR #27. Since then:

The released flashduty-cli has been pinned to a feat/api-review-auto-fix pseudo-version this whole time (not a tagged main release), specifically to get the monit sparse-field fixes. That's a stopgap — the CLI can't cut a clean tagged release against main until these two lines are back together.

What this does

Merges feat/api-review-auto-fix into main, 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-fix into origin/main:

  • go build ./... — clean
  • go vet ./... — clean
  • go test -race -count=1 ./... — all packages pass
  • go generate ./... followed by git 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.

ysyneu added 12 commits July 14, 2026 00:46
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
@ysyneu
ysyneu merged commit 28ed671 into main Jul 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant