From 2d1f7512808babceec1bd4414da8a92805d2280f Mon Sep 17 00:00:00 2001 From: Igor Udot Date: Mon, 23 Feb 2026 16:32:42 +0800 Subject: [PATCH 1/5] feat: description_min_skip configuration --- README.md | 1 + src/core/issue_service.py | 6 ++++-- src/core/settings.py | 2 ++ src/main.py | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a07feec..bb92578 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Or you can check this [example](./.github/workflows/example.yml) | `ai-provider` | AI provider to use: 'openai', 'gemini', or 'deepseek' | Auto-detected based on provided keys | | `model` | AI model to use | `gpt-4` for OpenAI, `gemini-2.0-flash` for Gemini, `deepseek-chat` for Deepseek | | `skip-label` | Label to mark processed issues | `titled` | +| `description-len-min-skip` | Minimum description length required to process an issue. Issues with descriptions shorter than this value will be skipped | `40` | | `prompt` | Custom prompt for the AI model | [None](#Prompt and Style) | | `style` | Predefined prompt. To view available prompts, refer to the `styles` folder `https://github.com/horw/issue-title-ai/tree/main/styles` | "summary" | | `verbose` | When enabled, prints detailed information, including input, response, and token usage | false | diff --git a/src/core/issue_service.py b/src/core/issue_service.py index ccba21d..49365e8 100644 --- a/src/core/issue_service.py +++ b/src/core/issue_service.py @@ -9,12 +9,14 @@ def __init__(self, ai_client, github_client, prompt, skip_label, required_labels self.skip_label = skip_label self.required_labels = required_labels - def process_issue(self, issue, auto_update=False, strip_characters="", quiet=False): + def process_issue( + self, issue, auto_update=False, strip_characters="", quiet=False, description_min_skip=40 + ): issue_number = issue.number original_title = issue.title issue_body = issue.body or "" - if len(issue_body) < 40: + if len(issue_body) < description_min_skip: print(f"Issue body too short, skipping: {issue_number}, length: {len(issue_body)}") return { "issue_number": issue_number, diff --git a/src/core/settings.py b/src/core/settings.py index 333fb8c..9f67897 100644 --- a/src/core/settings.py +++ b/src/core/settings.py @@ -30,6 +30,8 @@ def __init__(self): self.prompt = self._retrieve_prompt() self.skip_label = os.environ.get("INPUT_SKIP-LABEL", "titled") + self.description_min_skip = int(os.getenv("INPUT_DESCRIPTION_LEN_MIN_SKIP", 40)) + # Check if this is an issue event trigger self.event_name = os.environ.get("GITHUB_EVENT_NAME") self.event_path = os.environ.get("GITHUB_EVENT_PATH") diff --git a/src/main.py b/src/main.py index 43fe692..78213ea 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ def open_issue_event(config, repo_obj, ai_client, github_client): auto_update=config.auto_update, strip_characters=config.strip_characters, quiet=config.quiet, + description_min_skip=config.description_min_skip, ) return [result] except Exception as e: @@ -65,6 +66,7 @@ def scan_issue_event(config, repo_obj, ai_client, github_client): auto_update=config.auto_update, strip_characters=config.strip_characters, quiet=config.quiet, + description_min_skip=config.description_min_skip, ) results.append(result) From 3823c5791f4e6ed200ee7be727aeab31febc0ab0 Mon Sep 17 00:00:00 2001 From: Igor Udot Date: Mon, 23 Feb 2026 17:57:29 +0800 Subject: [PATCH 2/5] fix: pip version to 24.0 --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 814b233..426abc3 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install pip==24.0 pip install -e ".[dev]" From 0dfe76ecbefb6e6116e736e761631339b1aa2d18 Mon Sep 17 00:00:00 2001 From: Igor Udot Date: Mon, 23 Feb 2026 18:02:28 +0800 Subject: [PATCH 3/5] test: description_min_skip --- tests/test_main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_main.py b/tests/test_main.py index 7244671..b6be71a 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -48,6 +48,7 @@ def mock_config(): config.required_labels = [] config.apply_to_closed = False config.event_data = None + config.description_min_skip = 40 return config From 28004e5076626d40029d34ce2666e875d42cf973 Mon Sep 17 00:00:00 2001 From: Igor Udot Date: Mon, 23 Feb 2026 18:10:55 +0800 Subject: [PATCH 4/5] fix: pre-commit pip-compile hook --- .pre-commit-config.yaml | 2 +- requirements.txt | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5a0206f..46a4983 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: hooks: - id: pip-compile name: compile requirements.txt - entry: bash -c 'pip-compile --output-file=requirements.txt pyproject.toml > /dev/null' + entry: bash -c 'pip-compile --no-header --output-file=requirements.txt pyproject.toml > /dev/null' language: system pass_filenames: false files: requirements.txt|pyproject.toml diff --git a/requirements.txt b/requirements.txt index 40c9101..6347c23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,3 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --output-file=requirements.txt pyproject.toml -# annotated-types==0.7.0 # via pydantic anyio==4.9.0 @@ -112,7 +106,6 @@ tqdm==4.67.1 # openai typing-extensions==4.13.2 # via - # anyio # openai # pydantic # pydantic-core From 6bd959477a1bef6495b1e01404df2658bbd2fc74 Mon Sep 17 00:00:00 2001 From: Igor Udot Date: Mon, 23 Feb 2026 18:14:37 +0800 Subject: [PATCH 5/5] fix: pre-commit pip-compile hook --- .pre-commit-config.yaml | 2 +- requirements.txt | 78 ----------------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46a4983..12d5198 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: hooks: - id: pip-compile name: compile requirements.txt - entry: bash -c 'pip-compile --no-header --output-file=requirements.txt pyproject.toml > /dev/null' + entry: bash -c 'pip-compile --no-annotate --no-header --output-file=requirements.txt pyproject.toml > /dev/null' language: system pass_filenames: false files: requirements.txt|pyproject.toml diff --git a/requirements.txt b/requirements.txt index 6347c23..4e21364 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,118 +1,40 @@ annotated-types==0.7.0 - # via pydantic anyio==4.9.0 - # via - # httpx - # openai cachetools==5.5.2 - # via google-auth certifi==2025.1.31 - # via - # httpcore - # httpx - # requests cffi==1.17.1 - # via - # cryptography - # pynacl charset-normalizer==3.4.1 - # via requests cryptography==44.0.2 - # via pyjwt deprecated==1.2.18 - # via pygithub distro==1.9.0 - # via openai google-ai-generativelanguage==0.4.0 - # via google-generativeai google-api-core[grpc]==2.24.2 - # via - # google-ai-generativelanguage - # google-generativeai google-auth==2.39.0 - # via - # google-api-core - # google-generativeai google-generativeai==0.3.1 - # via issue-title-ai (pyproject.toml) googleapis-common-protos==1.70.0 - # via - # google-api-core - # grpcio-status grpcio==1.72.0rc1 - # via - # google-api-core - # grpcio-status grpcio-status==1.63.0rc1 - # via google-api-core h11==0.14.0 - # via httpcore httpcore==1.0.8 - # via httpx httpx==0.28.1 - # via openai idna==3.10 - # via - # anyio - # httpx - # requests jiter==0.9.0 - # via openai openai==1.75.0 - # via issue-title-ai (pyproject.toml) proto-plus==1.26.1 - # via - # google-ai-generativelanguage - # google-api-core protobuf==4.25.6 - # via - # google-ai-generativelanguage - # google-api-core - # google-generativeai - # googleapis-common-protos - # grpcio-status - # proto-plus pyasn1==0.6.1 - # via - # pyasn1-modules - # rsa pyasn1-modules==0.4.2 - # via google-auth pycparser==2.22 - # via cffi pydantic==2.11.3 - # via openai pydantic-core==2.33.1 - # via pydantic pygithub==1.58.2 - # via issue-title-ai (pyproject.toml) pyjwt[crypto]==2.10.1 - # via pygithub pynacl==1.5.0 - # via pygithub requests==2.32.3 - # via - # google-api-core - # pygithub rsa==4.9.1 - # via google-auth sniffio==1.3.1 - # via - # anyio - # openai tqdm==4.67.1 - # via - # google-generativeai - # openai typing-extensions==4.13.2 - # via - # openai - # pydantic - # pydantic-core - # typing-inspection typing-inspection==0.4.0 - # via pydantic urllib3==2.4.0 - # via requests wrapt==1.17.2 - # via deprecated