Skip to content

fix(api): response_model=None for 5 streaming/binary endpoints — #5317 follow-up#5845

Merged
mrveiss merged 1 commit intoDev_new_guifrom
rm-r8b
Apr 25, 2026
Merged

fix(api): response_model=None for 5 streaming/binary endpoints — #5317 follow-up#5845
mrveiss merged 1 commit intoDev_new_guifrom
rm-r8b

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Apr 25, 2026

Summary

Fixes a bug introduced by #5834 (#5317 sweep): 5 endpoints received response_model=DataResponse but actually return non-JSON responses and must use response_model=None.

File Endpoint Returns
api/a2a.py stream_task_events() StreamingResponse (SSE)
api/conversation_files.py download_conversation_file() FileResponse
api/files.py download_file() FileResponse
api/process_management.py get_process_logs() PlainTextResponse
api/prometheus_endpoint.py metrics_endpoint() Prometheus text (CONTENT_TYPE_LATEST)

response_model=DataResponse on a streaming/binary endpoint would produce incorrect OpenAPI documentation claiming a JSON body is returned.

Discovery process

Caught by post-implementation gap review: AST-scanned all endpoints annotated with DataResponse and cross-referenced function bodies for StreamingResponse, FileResponse, and PlainTextResponse returns.

🤖 Generated with Claude Code

…y endpoints (#5317 follow-up)

Five endpoints introduced in the #5317 100% coverage sweep incorrectly
received response_model=DataResponse but actually return non-JSON responses:

  - api/a2a.py: stream_task_events() — SSE StreamingResponse
  - api/conversation_files.py: download_conversation_file() — FileResponse
  - api/files.py: download_file() — FileResponse
  - api/process_management.py: get_process_logs() — PlainTextResponse
  - api/prometheus_endpoint.py: metrics_endpoint() — Prometheus text format

response_model=None is correct for these: FastAPI skips response
validation and omits the model from the OpenAPI schema, which prevents
misleading documentation claiming these return DataResponse JSON.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrveiss mrveiss merged commit e79642a into Dev_new_gui Apr 25, 2026
2 of 4 checks passed
@mrveiss mrveiss deleted the rm-r8b branch April 25, 2026 10:05
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