[PR #9] [CLOSED] fix: resolve 11 bugs across codebase #8

Closed
opened 2026-03-01 14:51:12 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/atiilla/GeoIntel/pull/9
Author: @PierrunoYT
Created: 2/27/2026
Status: Closed

Base: mainHead: fix/bug-analysis


📝 Commits (5)

  • 0c218ee Implement comprehensive refactoring of GeoIntel codebase, introducing new modules for configuration, image processing, prompt building, API communication, response parsing, CLI argument handling, and output formatting. The main orchestration logic has been streamlined in geointel.py and cli.py, maintaining 100% backward compatibility while significantly reducing code complexity and improving maintainability.
  • c882020 Refactor get_api_key function to improve error handling and type annotations, ensuring a ValueError is raised if no API key is provided and enhancing code clarity.
  • 6967bea Enhance error handling in encode_image_to_base64 function by validating MIME type and improving exception messages. Ensure clear feedback for connection issues and HTTP errors while maintaining existing functionality.
  • adb18b9 Update API configuration in config.py for improved performance and adjust generation parameters for better accuracy. Minor formatting updates in various files to maintain consistency.
  • 8d49f83 fix: resolve 11 bugs across codebase

📊 Changes

13 files changed (+1101 additions, -268 deletions)

View changed files

BUG_REPORT.md (+79 -0)
IMPLEMENTATION_CHECKLIST.md (+248 -0)
REFACTORING_SUMMARY.md (+205 -0)
geointel/api_client.py (+85 -0)
📝 geointel/cli.py (+8 -56)
geointel/cli_args.py (+44 -0)
geointel/cli_formatter.py (+93 -0)
geointel/config.py (+37 -0)
📝 geointel/geointel.py (+34 -207)
geointel/image_utils.py (+82 -0)
geointel/prompt_builder.py (+94 -0)
geointel/response_parser.py (+87 -0)
📝 setup.py (+5 -5)

📄 Description

Summary

This PR fixes 11 bugs and issues found across the codebase, categorized by severity.

🔴 Critical / High

  1. Python 3.9 compatibility — \str | None\ → \Optional[str]\ in \config.py\
  2. API key leak in error messages — sanitized error output in \pi_client.py\
  3. Hardcoded browser-fingerprint headers — removed unnecessary DevTools headers from API client
  4. No response structure validation — added _normalize_location()\ with field validation and safe defaults

🟡 Medium

  1. Missing file encoding on Windows — added \ncoding='utf-8'\ to output file writing
  2. API timeout too short — increased from 20s to 60s
  3. Version constraint missing — added
    equests>=2.31.0\ to \setup.py\
  4. HTTP error loses context — error messages now include status code and URL

🟢 Low

  1. Inconsistent type annotations — unified to \Optional[str]\ style
  2. No image size limit — added 20 MB limit for local and remote images
  3. setup.py formatting — fixed inconsistent indentation

See \BUG_REPORT.md\ for full details on each issue and its fix.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/atiilla/GeoIntel/pull/9 **Author:** [@PierrunoYT](https://github.com/PierrunoYT) **Created:** 2/27/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/bug-analysis` --- ### 📝 Commits (5) - [`0c218ee`](https://github.com/atiilla/GeoIntel/commit/0c218ee0fd201975abd430f9071c0d2a5d1a10d9) Implement comprehensive refactoring of GeoIntel codebase, introducing new modules for configuration, image processing, prompt building, API communication, response parsing, CLI argument handling, and output formatting. The main orchestration logic has been streamlined in `geointel.py` and `cli.py`, maintaining 100% backward compatibility while significantly reducing code complexity and improving maintainability. - [`c882020`](https://github.com/atiilla/GeoIntel/commit/c8820201f99e9168d5976e0ee78823a1c343c5ee) Refactor get_api_key function to improve error handling and type annotations, ensuring a ValueError is raised if no API key is provided and enhancing code clarity. - [`6967bea`](https://github.com/atiilla/GeoIntel/commit/6967bead91424c4dda7367d33f1cc38e054b1f5d) Enhance error handling in encode_image_to_base64 function by validating MIME type and improving exception messages. Ensure clear feedback for connection issues and HTTP errors while maintaining existing functionality. - [`adb18b9`](https://github.com/atiilla/GeoIntel/commit/adb18b9366ee5b5e55c90d7b48a9147a3297d96e) Update API configuration in config.py for improved performance and adjust generation parameters for better accuracy. Minor formatting updates in various files to maintain consistency. - [`8d49f83`](https://github.com/atiilla/GeoIntel/commit/8d49f831cc560b6936394291a6f496bdde0865bb) fix: resolve 11 bugs across codebase ### 📊 Changes **13 files changed** (+1101 additions, -268 deletions) <details> <summary>View changed files</summary> ➕ `BUG_REPORT.md` (+79 -0) ➕ `IMPLEMENTATION_CHECKLIST.md` (+248 -0) ➕ `REFACTORING_SUMMARY.md` (+205 -0) ➕ `geointel/api_client.py` (+85 -0) 📝 `geointel/cli.py` (+8 -56) ➕ `geointel/cli_args.py` (+44 -0) ➕ `geointel/cli_formatter.py` (+93 -0) ➕ `geointel/config.py` (+37 -0) 📝 `geointel/geointel.py` (+34 -207) ➕ `geointel/image_utils.py` (+82 -0) ➕ `geointel/prompt_builder.py` (+94 -0) ➕ `geointel/response_parser.py` (+87 -0) 📝 `setup.py` (+5 -5) </details> ### 📄 Description ## Summary This PR fixes 11 bugs and issues found across the codebase, categorized by severity. ### 🔴 Critical / High 1. **Python 3.9 compatibility** — \str | None\ → \Optional[str]\ in \config.py\ 2. **API key leak in error messages** — sanitized error output in \pi_client.py\ 3. **Hardcoded browser-fingerprint headers** — removed unnecessary DevTools headers from API client 4. **No response structure validation** — added \_normalize_location()\ with field validation and safe defaults ### 🟡 Medium 5. **Missing file encoding on Windows** — added \ncoding='utf-8'\ to output file writing 6. **API timeout too short** — increased from 20s to 60s 7. **Version constraint missing** — added \ equests>=2.31.0\ to \setup.py\ 8. **HTTP error loses context** — error messages now include status code and URL ### 🟢 Low 9. **Inconsistent type annotations** — unified to \Optional[str]\ style 10. **No image size limit** — added 20 MB limit for local and remote images 11. **setup.py formatting** — fixed inconsistent indentation See \BUG_REPORT.md\ for full details on each issue and its fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 14:51:12 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/GeoIntel#8
No description provided.