Skip to content

fix(image-gen): preserve xAI API error status#15971

Closed
camaragon wants to merge 1 commit into
NousResearch:mainfrom
camaragon:auto/hermes-self-improvement
Closed

fix(image-gen): preserve xAI API error status#15971
camaragon wants to merge 1 commit into
NousResearch:mainfrom
camaragon:auto/hermes-self-improvement

Conversation

@camaragon
Copy link
Copy Markdown
Contributor

@camaragon camaragon commented Apr 26, 2026

Why change

xAI image generation errors can report HTTP status 0 even when xAI returns a real 4xx/5xx response. requests.Response objects are falsy for error status codes, so the HTTPError handler treated real error responses as missing.

Files changed

  • plugins/image_gen/xai/__init__.py: check HTTPError.response is not None before reading status/message.
  • tests/plugins/image_gen/test_xai_provider.py: add regression coverage with a real requests.Response status 401.

Verification run

  • /home/caragon/.hermes/hermes-agent/venv/bin/python -m pytest tests/plugins/image_gen/test_xai_provider.py -q → 19 passed
  • inspected diff for secrets/regressions

Risk level

Low. Error-handling only; success path unchanged.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard tool/browser Browser automation (CDP, Playwright) labels Apr 26, 2026
@camaragon camaragon force-pushed the auto/hermes-self-improvement branch 2 times, most recently from f56ed2c to 40930a0 Compare April 26, 2026 15:06
@camaragon camaragon force-pushed the auto/hermes-self-improvement branch 8 times, most recently from 01c3e35 to 56ded12 Compare April 29, 2026 13:13
@camaragon camaragon changed the title fix(doctor): detect global agent-browser installs fix(agent): reset exhausted fallback index between turns Apr 29, 2026
@camaragon camaragon force-pushed the auto/hermes-self-improvement branch 3 times, most recently from 61aff13 to 8172e34 Compare April 30, 2026 01:24
@camaragon camaragon changed the title fix(agent): reset exhausted fallback index between turns fix(image-gen): preserve xAI API error status Apr 30, 2026
@camaragon camaragon force-pushed the auto/hermes-self-improvement branch 10 times, most recently from 6bed3cb to c3f510b Compare April 30, 2026 22:44
@camaragon camaragon force-pushed the auto/hermes-self-improvement branch 25 times, most recently from 1328bb3 to c6dcd81 Compare May 4, 2026 07:34
@teknium1
Copy link
Copy Markdown
Contributor

teknium1 commented May 4, 2026

Salvaged via #19697 onto current main - your commit authorship was preserved. Thanks!

@teknium1 teknium1 closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have tool/browser Browser automation (CDP, Playwright) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants