refactor(proto): consolidate SummarizeArticleResponse status fields (#813)

* refactor(proto): consolidate SummarizeArticleResponse status fields

Replace redundant boolean/string status fields (cached, skipped, error,
error_type, reason) with a SummarizeStatus enum and a single
status_detail string. This addresses L-8 lint issue by reducing field
count and making the response status unambiguous.

- Add SummarizeStatus enum (UNSPECIFIED, SUCCESS, CACHED, SKIPPED, ERROR)
- Replace cached/skipped booleans with status enum field
- Merge error/error_type/reason into statusDetail string
- Reserve old field numbers (4, 7, 8, 9, 10) for wire compatibility
- Update server handlers and client code to use new fields
- Regenerate TypeScript types and OpenAPI docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(proto): restore error and errorType fields for programmatic error handling

Keep the new SummarizeStatus enum and statusDetail for consolidated
status tracking, but restore the separate error and errorType fields
(proto field numbers 9, 10) to preserve structured error information
for downstream consumers that need to programmatically handle errors.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Elie Habib <elie.habib@gmail.com>
This commit is contained in:
Nicolas Gomes Ferreira Dos Santos
2026-03-02 13:15:44 -08:00
committed by GitHub
parent a88a0c8e59
commit ee27b91c8f
8 changed files with 63 additions and 50 deletions

View File

@@ -169,6 +169,15 @@ components:
required:
- provider
description: SummarizeArticleRequest specifies parameters for LLM article summarization.
SummarizeStatus:
type: string
enum:
- SUMMARIZE_STATUS_UNSPECIFIED
- SUMMARIZE_STATUS_SUCCESS
- SUMMARIZE_STATUS_CACHED
- SUMMARIZE_STATUS_SKIPPED
- SUMMARIZE_STATUS_ERROR
description: SummarizeStatus indicates the outcome of a summarization request.
SummarizeArticleResponse:
type: object
properties:
@@ -181,9 +190,6 @@ components:
provider:
type: string
description: Provider that produced the result (or "cache").
cached:
type: boolean
description: Whether the result came from Redis cache.
tokens:
type: integer
format: int32
@@ -191,18 +197,17 @@ components:
fallback:
type: boolean
description: Whether the client should try the next provider in the fallback chain.
skipped:
type: boolean
description: Whether this provider was skipped (credentials missing).
reason:
type: string
description: Human-readable skip/error reason.
error:
type: string
description: Error message if the request failed.
errorType:
type: string
description: Error type/name (e.g. "TypeError").
status:
$ref: '#/components/schemas/SummarizeStatus'
statusDetail:
type: string
description: Human-readable detail for non-success statuses (error message, skip reason, etc.).
description: SummarizeArticleResponse contains the LLM summarization result.
GetSummarizeArticleCacheRequest:
type: object