commitwise-review 0.1.3__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/PKG-INFO +1 -1
  2. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/commitwise_review.egg-info/PKG-INFO +1 -1
  3. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/cli/main.py +14 -1
  4. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/pyproject.toml +1 -1
  5. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/tests/test_cli.py +15 -1
  6. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/LICENSE +0 -0
  7. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/README.md +0 -0
  8. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/commitwise_review.egg-info/SOURCES.txt +0 -0
  9. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/commitwise_review.egg-info/dependency_links.txt +0 -0
  10. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/commitwise_review.egg-info/entry_points.txt +0 -0
  11. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/commitwise_review.egg-info/requires.txt +0 -0
  12. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/commitwise_review.egg-info/top_level.txt +0 -0
  13. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/__init__.py +0 -0
  14. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/__main__.py +0 -0
  15. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/analyzers/local.py +0 -0
  16. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/config/settings.py +0 -0
  17. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/git/staged.py +0 -0
  18. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/hooks/install.py +0 -0
  19. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/prompts/review_prompt.py +0 -0
  20. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/gai/providers/reviewer.py +0 -0
  21. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/setup.cfg +0 -0
  22. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/tests/test_hooks.py +0 -0
  23. {commitwise_review-0.1.3 → commitwise_review-0.1.5}/tests/test_reviewer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commitwise-review
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Git staged-change AI review helper
5
5
  Author: Gokulakrishnan
6
6
  Requires-Python: >=3.11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commitwise-review
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Git staged-change AI review helper
5
5
  Author: Gokulakrishnan
6
6
  Requires-Python: >=3.11
@@ -82,6 +82,13 @@ def cmd_init(_: argparse.Namespace) -> int:
82
82
  return 0
83
83
 
84
84
 
85
+ def _normalize_provider_model(provider: str, model: str) -> str:
86
+ if provider == "github":
87
+ if model in {"github/copilot", "github/copilot-1", "github/copilot-2"}:
88
+ return "openai/gpt-5"
89
+ return model
90
+
91
+
85
92
  def _provider_setup_instructions(provider: str) -> str | None:
86
93
  if provider == "github":
87
94
  return (
@@ -103,9 +110,15 @@ def cmd_review(_: argparse.Namespace) -> int:
103
110
  staged_diff = get_staged_diff(cwd)
104
111
  config = load_config()
105
112
  provider = config.get("provider", "github")
106
- model = config.get("model", DEFAULT_PROVIDER_MODELS.get(provider, "openai/gpt-5"))
113
+ model = _normalize_provider_model(
114
+ provider,
115
+ config.get("model", DEFAULT_PROVIDER_MODELS.get(provider, "openai/gpt-5")),
116
+ )
107
117
  token = get_token(provider)
108
118
 
119
+ if provider == "github" and model == "openai/gpt-5":
120
+ print("Using GitHub Models with model openai/gpt-5")
121
+
109
122
  print("Running local analyzers (when available)...")
110
123
  analyzer_reports = run_local_analyzers(cwd)
111
124
  for name, report in analyzer_reports:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "commitwise-review"
7
- version = "0.1.3"
7
+ version = "0.1.5"
8
8
  description = "Git staged-change AI review helper"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -3,7 +3,7 @@ import io
3
3
  import unittest
4
4
  from unittest.mock import patch
5
5
 
6
- from gai.cli.main import cmd_init
6
+ from gai.cli.main import _normalize_provider_model, cmd_init
7
7
 
8
8
 
9
9
  class CliTests(unittest.TestCase):
@@ -23,3 +23,17 @@ class CliTests(unittest.TestCase):
23
23
  )
24
24
  self.assertIn("openai/gpt-5", output)
25
25
  mock_save_config.assert_called_once_with({"provider": "github", "model": "openai/gpt-5"})
26
+
27
+ def test_normalize_github_model_alias(self):
28
+ self.assertEqual(
29
+ _normalize_provider_model("github", "github/copilot"),
30
+ "openai/gpt-5",
31
+ )
32
+ self.assertEqual(
33
+ _normalize_provider_model("github", "github/copilot-1"),
34
+ "openai/gpt-5",
35
+ )
36
+ self.assertEqual(
37
+ _normalize_provider_model("github", "openai/gpt-5"),
38
+ "openai/gpt-5",
39
+ )