Skip to content

fix: register LAST30DAYS_DEBUG in env keys, lazy resolution, fix xai_x crash#770

Open
23241a6749 wants to merge 1 commit into
mvanhorn:mainfrom
23241a6749:fix/last30days-debug-env-registration
Open

fix: register LAST30DAYS_DEBUG in env keys, lazy resolution, fix xai_x crash#770
23241a6749 wants to merge 1 commit into
mvanhorn:mainfrom
23241a6749:fix/last30days-debug-env-registration

Conversation

@23241a6749

Copy link
Copy Markdown
Contributor

Summary

LAST30DAYS_DEBUG had three bugs:

  1. Not registered in CONFIGURATION_KEYS — .env values were silently ignored.
  2. Eager module-level os.environ.get() in log.py — --debug flag and .env values never picked up.
  3. http.DEBUG in xai_x.py:144 — AttributeError on xAI API errors.

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes debug-mode configuration and the xAI error logging path. The main changes are:

  • Registers LAST30DAYS_DEBUG in the config loader.
  • Resolves debug mode lazily from os.environ.
  • Accepts on as a debug truthy value.
  • Uses log.is_debug() when logging full xAI error responses.
  • Documents --debug and the env-based debug option.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
CONFIGURATION.md Adds documentation for --debug and LAST30DAYS_DEBUG.
skills/last30days/scripts/lib/env.py Registers LAST30DAYS_DEBUG and exports loaded values without overriding shell values.
skills/last30days/scripts/lib/log.py Makes debug checks lazy and accepts on as a truthy value.
skills/last30days/scripts/lib/xai_x.py Uses log.is_debug() for full xAI error-response logging.

Reviews (2): Last reviewed commit: "fix: register LAST30DAYS_DEBUG in env ke..." | Re-trigger Greptile

Comment thread skills/last30days/scripts/lib/log.py Outdated
…x crash

LAST30DAYS_DEBUG had three bugs:
1. Not registered in CONFIGURATION_KEYS - .env values were silently ignored
2. Eager module-level os.environ.get() in log.py meant --debug flag
   and .env values were never picked up by log.debug()
3. http.DEBUG in xai_x.py referenced a non-existent attribute,
   causing AttributeError on xAI API errors

Fixes:
- Add LAST30DAYS_DEBUG to the CONFIGURATION_KEYS tuple in env.py
- Export to os.environ after get_config() so log.py's lazy check
  picks up .env values
- Replace eager DEBUG constant with lazy is_debug() function
- Fix http.DEBUG -> log.is_debug() in xai_x.py
- Add CONFIGURATION.md section for --debug / LAST30DAYS_DEBUG
@23241a6749 23241a6749 force-pushed the fix/last30days-debug-env-registration branch from 4cc9c40 to 8649ee5 Compare July 7, 2026 01:07
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