Skip to content

chore: sync OpenAPI spec from flashduty-docs + regenerate (adds session/delete; drops console-only skill/download)#14

Merged
ysyneu merged 2 commits into
mainfrom
chore/sync-spec-session-delete
Jun 24, 2026
Merged

chore: sync OpenAPI spec from flashduty-docs + regenerate (adds session/delete; drops console-only skill/download)#14
ysyneu merged 2 commits into
mainfrom
chore/sync-spec-session-delete

Conversation

@ysyneu

@ysyneu ysyneu commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Why

The vendored OpenAPI under openapi/ is a synced copy of the single source (flashduty-docs api-reference/openapi.{en,zh}.json). It had drifted behind docs main. Re-sync via the blessed make sync-spec + make generate and land go-flashduty back in sync.

What changed

  • Sessions.WriteDelete added — POST /safari/session/delete (was public but had no SDK method).
  • Session methods renamed Info/ListReadInfo/ReadList to match the safari read/write operationId convention already used by mcp (ReadServerGet), skill (ReadGet), and a2a — session was the only bare-named safari resource. (Breaking for direct callers of Sessions.Info/List. go-flashduty is v0.x; the flashduty-cli command surface is path-derived and unaffected.)
  • /safari/skill/download dropped entirely — it was reclassified auth=all → jwt (console-only binary application/zip download, used only by the Customize UI via session cookie; flashduty-docs #106, fc-pgy #570). It's no longer in the public spec, so the old broken Skills.ReadDownload(...) (*string, ...) (which could not decode a zip) and its SkillDownloadRequest model are gone. No consumer breaks — the only public consumers were broken, unused codegen artifacts.
  • Model refresh from the current spec: Timestamp → TimestampMilli, omitempty scalar fields → pointers, SkillUploadRequest added.
  • ExportLine/ExportUsage relocated into sessions_export.go as hand-maintained types, alongside the hand-written streaming Export endpoint that consumes them (the generator prunes them as unreferenced — session/export is NDJSON, excluded like the now-removed zip download).

Verification

make check green: gofmt + gci clean, golangci-lint 0 issues, go test -race ./... ok, go build ./... clean. Vendored openapi/*.json is byte-identical to flashduty-docs main (post-#106).

Follow-up

flashduty-cli bumps to this commit + regen — adds the session-delete command, drops the (broken, unused) skill-download command. Its "every public op reachable" coverage invariant passes cleanly (verified locally against this branch). PR'd to feat/ai-sre after this merges.

ysyneu added 2 commits June 24, 2026 21:57
Catch the vendored spec up to flashduty-docs main and regenerate the typed
service layer.

- Sessions.WriteDelete added — POST /safari/session/delete.
- Session methods renamed Info/List -> ReadInfo/ReadList, matching the safari
  read/write operationId convention already used by mcp / skill / a2a (session
  was the only bare-named safari resource).
- Skills.ReadDownload removed: /safari/skill/download returns application/zip,
  which the generator correctly excludes (non-JSON / streaming response, same
  rule as session/export); the old (*string) method could not decode a zip.
- Model refresh from the current spec: Timestamp -> TimestampMilli and
  omitempty scalar fields -> pointers; SkillUploadRequest added; orphan
  ExportLine / ExportUsage dropped from the generated models.
- ExportLine / ExportUsage relocated into sessions_export.go as hand-maintained
  types, alongside the hand-written streaming Export endpoint that consumes
  them (the generator prunes them as unreferenced).

make check is green (gofmt, gci, golangci-lint 0 issues, go test -race, build).
/safari/skill/download is now auth=jwt in the registry (fc-pgy #570): a
console-only application/zip download with no app_key consumer. Re-sync from
the updated docs spec removes it from the vendored OpenAPI and the generated
SDK entirely (SkillDownloadRequest dropped) — so it no longer appears as a
broken (*string) binary method. The Customize console keeps downloading via
its session cookie (jwt); the SDK simply doesn't model a non-public op.
@ysyneu ysyneu changed the title chore: sync OpenAPI spec from flashduty-docs + regenerate (adds session/delete) chore: sync OpenAPI spec from flashduty-docs + regenerate (adds session/delete; drops console-only skill/download) Jun 24, 2026
@ysyneu ysyneu merged commit 0219338 into main Jun 24, 2026
4 checks passed
@ysyneu ysyneu deleted the chore/sync-spec-session-delete branch June 24, 2026 14:31
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