Skip to content

fix[format/openai]: return error on empty msg.#6511

Merged
zanesq merged 4 commits intoblock:mainfrom
Yorisoft:yorisoft/fix_copilot_no_credit_empty_response
Jan 27, 2026
Merged

fix[format/openai]: return error on empty msg.#6511
zanesq merged 4 commits intoblock:mainfrom
Yorisoft:yorisoft/fix_copilot_no_credit_empty_response

Conversation

@Yorisoft
Copy link
Contributor

@Yorisoft Yorisoft commented Jan 15, 2026

Summary

Return an error message when receiving an empty response.

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

cargo check \
  && cargo test \
  && cargo fmt \
  && ./scripts/clippy-lint.sh
  
  
Finished `dev` profile [unoptimized + debuginfo] target(s) in 40.03s
  
✅ All baseline clippy checks passed!  
🔒 Checking for banned TLS crates... 
✓ No banned TLS crates found (native-tls, openssl, openssl-sys)  
✅ Done

Related Issues

Relates to: fixes #6470

Screenshots/Demos (for UX changes)

Before:
image

After:
image

@The-Best-Codes The-Best-Codes force-pushed the yorisoft/fix_copilot_no_credit_empty_response branch from e6707bc to ec39c12 Compare January 15, 2026 14:54
Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could see treating it as an error if we can't get a message from the payload.

But are sure we aren't dropping an error somewhere else from Github when we hit this? I'd be surprised if GH isn't telling us the real error somewhere.

@The-Best-Codes
Copy link
Collaborator

Thanks Jack.
cc @Yorisoft do you want to look into that or do you want me to?

@Yorisoft
Copy link
Contributor Author

@The-Best-Codes
Let me take a look - I'll let you know if I need help

@Yorisoft Yorisoft force-pushed the yorisoft/fix_copilot_no_credit_empty_response branch 3 times, most recently from f08f474 to b79df2e Compare January 17, 2026 06:26
Signed-off-by: Yelsin Sepulveda <yelsinsepulveda@gmail.com>
Signed-off-by: Yelsin Sepulveda <yelsinsepulveda@gmail.com>
@Yorisoft Yorisoft force-pushed the yorisoft/fix_copilot_no_credit_empty_response branch from b79df2e to 0ecb4d8 Compare January 17, 2026 09:59
Signed-off-by: Yelsin Sepulveda <yelsinsepulveda@gmail.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where empty API responses were silently converted to empty messages instead of returning an error. The fix adds proper error handling to detect and report API errors or missing message content.

Changes:

  • Added error handling for API responses with explicit error fields
  • Added fallback error for missing message content in responses
  • Replaced silent empty message creation with informative error messages

Signed-off-by: The-Best-Codes <bestcodes.official@gmail.com>
@The-Best-Codes The-Best-Codes force-pushed the yorisoft/fix_copilot_no_credit_empty_response branch from 326d1d1 to b970507 Compare January 19, 2026 02:09
@The-Best-Codes
Copy link
Collaborator

Can somebody re-request a review from Copilot please?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@zanesq zanesq merged commit bc0881c into block:main Jan 27, 2026
40 checks passed
zanesq added a commit that referenced this pull request Jan 27, 2026
…upport

* origin/main: (79 commits)
  fix[format/openai]: return error on empty msg. (#6511)
  Fix: ElevenLabs API Key Not Persisting (#6557)
  Logging uplift for model training purposes (command injection model) [Small change] (#6330)
  fix(goose): only send agent-session-id when a session exists (#6657)
  BERT-based command injection detection in tool calls (#6599)
  chore: [CONTRIBUTING.md] add Hermit to instructions (#6518)
  fix: update Gemini context limits (#6536)
  Document r slash command (#6724)
  Upgrade GitHub Actions to latest versions (#6700)
  fix: Manual compaction does not update context window. (#6682)
  Removed the Acceptable Usage Policy (#6204)
  Document spellcheck toggle (#6721)
  fix: docs workflow cleanup and prevent cancellations (#6713)
  Docs: file bug directly (#6718)
  fix: dispatch ADD_ACTIVE_SESSION event before navigating from "View All" (#6679)
  Speed up Databricks provider init by removing fetch of supported models (#6616)
  fix: correct typos in documentation and Justfile (#6686)
  docs: frameDomains and baseUriDomains for mcp apps (#6684)
  docs: add Remotion video creation tutorial (#6675)
  docs: export recipe and copy yaml (#6680)
  ...

# Conflicts:
#	ui/desktop/src/hooks/useChatStream.ts
katzdave added a commit that referenced this pull request Jan 27, 2026
…ovider

* 'main' of github.com:block/goose:
  fix slash and @ keyboard navigation popover background color (#6550)
  fix[format/openai]: return error on empty msg. (#6511)
  Fix: ElevenLabs API Key Not Persisting (#6557)
  Logging uplift for model training purposes (command injection model) [Small change] (#6330)
  fix(goose): only send agent-session-id when a session exists (#6657)
  BERT-based command injection detection in tool calls (#6599)
  chore: [CONTRIBUTING.md] add Hermit to instructions (#6518)
  fix: update Gemini context limits (#6536)
  Document r slash command (#6724)
  Upgrade GitHub Actions to latest versions (#6700)
zanesq added a commit that referenced this pull request Jan 27, 2026
* 'main' of github.com:block/goose:
  Create default gooseignore file when missing (#6498)
  fix slash and @ keyboard navigation popover background color (#6550)
  fix[format/openai]: return error on empty msg. (#6511)
  Fix: ElevenLabs API Key Not Persisting (#6557)
  Logging uplift for model training purposes (command injection model) [Small change] (#6330)
  fix(goose): only send agent-session-id when a session exists (#6657)
  BERT-based command injection detection in tool calls (#6599)
  chore: [CONTRIBUTING.md] add Hermit to instructions (#6518)
  fix: update Gemini context limits (#6536)
  Document r slash command (#6724)
  Upgrade GitHub Actions to latest versions (#6700)
  fix: Manual compaction does not update context window. (#6682)
  Removed the Acceptable Usage Policy (#6204)
  Document spellcheck toggle (#6721)
  fix: docs workflow cleanup and prevent cancellations (#6713)
  Docs: file bug directly (#6718)
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.

Copilot provider returns empty response, not error, when usage limit exceeded

4 participants