chore(api): register MessageDto as a named OpenAPI component (#365) #368

Merged
james merged 1 commit from 365-name-messagedto-component into main 2026-06-29 13:53:23 +00:00
Owner

MessageDto only appears nested in ConversationDetailDto.messages[] / TurnResponseDto.messages[], so the metadata-only namedDto(...) never surfaced it as a component — consumers had to derive it from TurnResponseDto["messages"][number] (see agent-stream.ts, #344). Register it directly so components.schemas.MessageDto exists.

What's in it

  • openapi-routes.ts: registry.register("MessageDto", zMessageDto); (mirrors how ProblemDetails is registered); removed the dead void MessageDto. No zod-shape or route change.
  • packages/api-client/src/agent-stream.ts: uses components["schemas"]["MessageDto"] instead of the TurnResponseDto["messages"][number] derivation.
  • openapi.json + api-client types regenerated.

Verification

  • api typecheck ✓ · openapi:check ✓ · openapi:coverage 119 (unchanged — no new path) · api-client check ✓ · api-client typecheck ✓ · api-client test 42 · api test (SQLite leg) 1010 passed, no openapi-shape assertion broke

Merge note

This and #366 (conversation rename/delete) both regenerate openapi.json + schema.d.ts. Whichever merges second should rebase and re-run openapi:generate + the api-client generate — the generated files are deterministic, so it's a mechanical re-regen, not a hand-merge.

Closes #365

🤖 Generated with Claude Code

`MessageDto` only appears nested in `ConversationDetailDto.messages[]` / `TurnResponseDto.messages[]`, so the metadata-only `namedDto(...)` never surfaced it as a component — consumers had to derive it from `TurnResponseDto["messages"][number]` (see `agent-stream.ts`, #344). Register it directly so `components.schemas.MessageDto` exists. ## What's in it - `openapi-routes.ts`: `registry.register("MessageDto", zMessageDto);` (mirrors how `ProblemDetails` is registered); removed the dead `void MessageDto`. No zod-shape or route change. - `packages/api-client/src/agent-stream.ts`: uses `components["schemas"]["MessageDto"]` instead of the `TurnResponseDto["messages"][number]` derivation. - `openapi.json` + api-client types regenerated. ## Verification - `api typecheck` ✓ · `openapi:check` ✓ · `openapi:coverage` 119 (unchanged — no new path) · `api-client check` ✓ · `api-client typecheck` ✓ · `api-client test` 42 · `api test` (SQLite leg) 1010 passed, no openapi-shape assertion broke ## Merge note This and **#366** (conversation rename/delete) both regenerate `openapi.json` + `schema.d.ts`. Whichever merges second should rebase and re-run `openapi:generate` + the api-client `generate` — the generated files are deterministic, so it's a mechanical re-regen, not a hand-merge. Closes #365 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore(api): register MessageDto as a named OpenAPI component (#365)
All checks were successful
Commits / Conventional Commits (pull_request) Successful in 14s
PR / OpenAPI (pull_request) Successful in 1m48s
PR / Typecheck (pull_request) Successful in 2m24s
PR / Lint (pull_request) Successful in 2m44s
PR / Static analysis (pull_request) Successful in 2m24s
PR / Build (pull_request) Successful in 3m23s
PR / Client (web export smoke) (pull_request) Successful in 3m18s
PR / OSV-Scanner (pull_request) Successful in 1m51s
PR / Package age policy (soft) (pull_request) Successful in 1m1s
Secrets / gitleaks (pull_request) Successful in 1m0s
PR / pnpm audit (pull_request) Successful in 2m22s
PR / Test (postgres) (pull_request) Successful in 3m22s
PR / E2E (Playwright) (pull_request) Successful in 4m7s
PR / Test (sqlite) (pull_request) Successful in 3m51s
PR / Trivy (image) (pull_request) Successful in 3m26s
PR / Coverage (soft) (pull_request) Successful in 3m30s
789759d929
MessageDto only appears nested in ConversationDetailDto.messages[] /
TurnResponseDto.messages[], so the metadata-only namedDto(...) never
surfaced it as a component — consumers had to derive it from
TurnResponseDto["messages"][number]. Register it directly (like
ProblemDetails) so components.schemas.MessageDto exists.

- openapi-routes.ts: registry.register("MessageDto", zMessageDto);
  removed the dead `void MessageDto`.
- packages/api-client/src/agent-stream.ts: use
  components["schemas"]["MessageDto"] instead of the derivation.
- openapi.json + api-client types regenerated (both drift gates green;
  coverage unchanged at 119 — no new path).

Closes #365

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
james merged commit ec27a4cab1 into main 2026-06-29 13:53:23 +00:00
james deleted branch 365-name-messagedto-component 2026-06-29 13:53:24 +00:00

📊 Test coverage

Patch coverage: no testable lines changed.

Overall (app/, lib/, db/, excluding UI per ADR-0019):

Metric Value Soft target
Lines 79.3% ≥ 50%
Branches 71.1% ⚠️ ≥ 75%
Functions 80.5% informational

Soft thresholds per ADR-0019. Coverage is informational and does not block merge.

<!-- coverage-comment --> ## 📊 Test coverage **Patch coverage:** no testable lines changed. **Overall** (`app/`, `lib/`, `db/`, excluding UI per ADR-0019): | Metric | Value | Soft target | |---|---|---| | Lines | 79.3% ✅ | ≥ 50% | | Branches | 71.1% ⚠️ | ≥ 75% | | Functions | 80.5% | informational | Soft thresholds per [ADR-0019](docs/adr/0019-coverage-soft-targets.md). Coverage is informational and does not block merge.
Sign in to join this conversation.
No description provided.