argus-code-review 0.3.0__tar.gz → 0.3.1__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 (159) hide show
  1. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/CHANGELOG.md +13 -1
  2. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/PKG-INFO +2 -2
  3. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/runners.py +12 -8
  4. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/pyproject.toml +15 -6
  5. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_runners_turn_budget.py +5 -4
  6. argus_code_review-0.3.1/tests/test_sdk_bundled_cli_version.py +30 -0
  7. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/.gitignore +0 -0
  8. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/LICENSE +0 -0
  9. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/README.md +0 -0
  10. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/__init__.py +0 -0
  11. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/bench.py +0 -0
  12. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/bench_default.toml +0 -0
  13. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/cli.py +0 -0
  14. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/config.py +0 -0
  15. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/coverage.py +0 -0
  16. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/dotenv_utils.py +0 -0
  17. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/gemini_cache.py +0 -0
  18. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/gemini_runner.py +0 -0
  19. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/github_client.py +0 -0
  20. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/graph.py +0 -0
  21. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/helpers.py +0 -0
  22. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/llm/models.py +0 -0
  23. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/llm/output_models.py +0 -0
  24. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/llm/pricing.py +0 -0
  25. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/llm/usage.py +0 -0
  26. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/models.py +0 -0
  27. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/openai_client.py +0 -0
  28. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/openai_runner.py +0 -0
  29. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/pipeline_models.py +0 -0
  30. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/__init__.py +0 -0
  31. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/actions_scanner.py +0 -0
  32. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/engine.py +0 -0
  33. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/eslint_bundle/.gitignore +0 -0
  34. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/eslint_bundle/README.md +0 -0
  35. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/eslint_bundle/eslint.config.js +0 -0
  36. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/eslint_bundle/package-lock.json +0 -0
  37. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/eslint_bundle/package.json +0 -0
  38. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/js_scanner.py +0 -0
  39. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/migration_scanner.py +0 -0
  40. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/rules/README.md +0 -0
  41. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/sarif.py +0 -0
  42. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/scanner_utils.py +0 -0
  43. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/secrets_scanner.py +0 -0
  44. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/shadow.py +0 -0
  45. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/terraform_scanner.py +0 -0
  46. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/precheck/workflow_lint_scanner.py +0 -0
  47. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/__init__.py +0 -0
  48. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-blocking-validator.md +0 -0
  49. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-coverage-check.md +0 -0
  50. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-cross-cutting.md +0 -0
  51. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-feedback-verifier.md +0 -0
  52. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-lite.md +0 -0
  53. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-planner.md +0 -0
  54. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-preflight-router.md +0 -0
  55. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-prior-art.md +0 -0
  56. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-scope.md +0 -0
  57. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-deployment.md +0 -0
  58. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-frontend.md +0 -0
  59. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-infra.md +0 -0
  60. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-llm-patterns.md +0 -0
  61. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-observability.md +0 -0
  62. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-orchestration.md +0 -0
  63. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-security.md +0 -0
  64. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-slackbot.md +0 -0
  65. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-specialist-sql.md +0 -0
  66. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-subagent.md +0 -0
  67. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-tests-and-docs.md +0 -0
  68. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts/pr-review-writer.md +0 -0
  69. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/prompts_runtime.py +0 -0
  70. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/repo_provision.py +0 -0
  71. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/review_tools.py +0 -0
  72. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/scope.py +0 -0
  73. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/__init__.py +0 -0
  74. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/http.py +0 -0
  75. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/models.py +0 -0
  76. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/precheck.py +0 -0
  77. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/resolver.py +0 -0
  78. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/session.py +0 -0
  79. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/sql.py +0 -0
  80. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/argus/storage/sqlite.py +0 -0
  81. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/008_add_code_reviews.sql +0 -0
  82. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/009_add_reviewer_version.sql +0 -0
  83. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/010_add_review_patterns.sql +0 -0
  84. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/011_add_review_progress_columns.sql +0 -0
  85. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/015_create_agent_runs.sql +0 -0
  86. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/016_add_agent_runs_failure_reason.sql +0 -0
  87. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/017_add_precheck_rules.sql +0 -0
  88. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/schema/018_widen_agent_runs_failure_reason.sql +0 -0
  89. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/__init__.py +0 -0
  90. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/conftest.py +0 -0
  91. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/golden/review_response.schema.json +0 -0
  92. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/__init__.py +0 -0
  93. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/test_backend_contract.py +0 -0
  94. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/test_http.py +0 -0
  95. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/test_models.py +0 -0
  96. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/test_resolver.py +0 -0
  97. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/test_session.py +0 -0
  98. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/test_sql.py +0 -0
  99. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/storage/test_sqlite_backend.py +0 -0
  100. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_actions_scanner.py +0 -0
  101. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_argus_review_local.py +0 -0
  102. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_bench.py +0 -0
  103. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_bench_config_guard.py +0 -0
  104. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_catchup_gate.py +0 -0
  105. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_cli_args.py +0 -0
  106. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_cli_output_contract.py +0 -0
  107. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_cli_post_review.py +0 -0
  108. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_cli_preflight.py +0 -0
  109. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_cli_prompts.py +0 -0
  110. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_config.py +0 -0
  111. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_conftest.py +0 -0
  112. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_gemini_cache.py +0 -0
  113. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_gemini_runner.py +0 -0
  114. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_github_client_checks_signal.py +0 -0
  115. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_github_client_write.py +0 -0
  116. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_fetch_diff.py +0 -0
  117. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_get_llm_temperature.py +0 -0
  118. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_http_guards.py +0 -0
  119. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_precheck.py +0 -0
  120. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_preflight_image_bump.py +0 -0
  121. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_progress.py +0 -0
  122. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_storage_resolution.py +0 -0
  123. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_graph_timeout_surfacing.py +0 -0
  124. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_js_scanner.py +0 -0
  125. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_llm_models.py +0 -0
  126. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_llm_models_override.py +0 -0
  127. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_llm_pricing.py +0 -0
  128. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_migration_scanner.py +0 -0
  129. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_models.py +0 -0
  130. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_multi_round.py +0 -0
  131. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_openai_client.py +0 -0
  132. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_openai_runner.py +0 -0
  133. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_output_models.py +0 -0
  134. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_packaging.py +0 -0
  135. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_plan_review.py +0 -0
  136. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_precheck_engine.py +0 -0
  137. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_precheck_engine_integration.py +0 -0
  138. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_precheck_sarif.py +0 -0
  139. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_precheck_shadow.py +0 -0
  140. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_precheck_shadow_integration.py +0 -0
  141. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_prompts.py +0 -0
  142. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_repo_provision.py +0 -0
  143. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_review_patterns_integration.py +0 -0
  144. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_review_tools.py +0 -0
  145. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_runners_context7.py +0 -0
  146. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_runners_context_usage.py +0 -0
  147. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_runners_helpers.py +0 -0
  148. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_runners_new.py +0 -0
  149. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_scanner_utils.py +0 -0
  150. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_scope.py +0 -0
  151. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_scope_gate.py +0 -0
  152. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_secrets_scanner.py +0 -0
  153. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_specialist_validation.py +0 -0
  154. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_stage_costs.py +0 -0
  155. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_storage_precheck.py +0 -0
  156. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_structured_output_methods.py +0 -0
  157. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_terraform_scanner.py +0 -0
  158. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_terraform_scanner_integration.py +0 -0
  159. {argus_code_review-0.3.0 → argus_code_review-0.3.1}/tests/test_workflow_lint_scanner.py +0 -0
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.1] - 2026-10-19
11
+
12
+ ### Fixed
13
+
14
+ - The cross-cutting reviewer no longer fails every round with `API Error: 400` (TECH-7686). Argus bundled Claude Code 2.1.139 (through `claude-agent-sdk` 0.1.81), and Anthropic's API rejects `claude-opus-5-5` from Claude Code older than 2.1.280 ("version 2.1.280 or newer is required", `claude_code_version_too_old`). That reviewer is the only one that runs opus through the SDK, so it returned no tokens and no findings. `claude-agent-sdk` is now pinned to 0.2.168, which bundles Claude Code 2.1.301. A new test asserts the bundled CLI is at least 2.1.280.
15
+
16
+ ### Changed
17
+
18
+ - `claude-agent-sdk` 0.1.81 to 0.2.168. This adds `jsonschema>=4.20.0` as a transitive dependency and raises the `mcp` floor to 1.23.0; semgrep's exact `mcp==1.23.3` pin in the `prechecks` extra still satisfies it, with little headroom (see the comment in `pyproject.toml`).
19
+ - A test that exercised the SDK's private hook-conversion helper now calls `claude_agent_sdk.types._hooks_to_internal_format`, where that logic moved. It is a private API and should be rechecked on each SDK bump.
20
+
10
21
  ## [0.3.0] - 2026-10-13
11
22
 
12
23
  ### Added
@@ -423,7 +434,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
423
434
  packaged set.
424
435
  - `argus --version`, `argus prompts list`, and `argus prompts export`.
425
436
 
426
- [Unreleased]: https://github.com/redesignhealth/argus-review/compare/v0.3.0...HEAD
437
+ [Unreleased]: https://github.com/redesignhealth/argus-review/compare/v0.3.1...HEAD
438
+ [0.3.1]: https://github.com/redesignhealth/argus-review/compare/v0.3.0...v0.3.1
427
439
  [0.3.0]: https://github.com/redesignhealth/argus-review/compare/v0.2.11...v0.3.0
428
440
  [0.2.11]: https://github.com/redesignhealth/argus-review/compare/v0.2.10...v0.2.11
429
441
  [0.2.10]: https://github.com/redesignhealth/argus-review/compare/v0.2.9...v0.2.10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: argus-code-review
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Self-orchestrated PR review agent using LangGraph + Claude Agent SDK
5
5
  Project-URL: Repository, https://github.com/redesignhealth/argus-review
6
6
  Project-URL: Issues, https://github.com/redesignhealth/argus-review/issues
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Topic :: Software Development :: Quality Assurance
17
17
  Requires-Python: <3.14,>=3.12
18
18
  Requires-Dist: asyncpg>=0.29.0
19
- Requires-Dist: claude-agent-sdk==0.1.81
19
+ Requires-Dist: claude-agent-sdk==0.2.168
20
20
  Requires-Dist: google-genai<2,>=1.55
21
21
  Requires-Dist: httpx>=0.27.0
22
22
  Requires-Dist: langchain-anthropic>=1.2.0
@@ -219,10 +219,12 @@ _TURN_BUDGET_SYSTEM_PROMPT_LINE_CLAUDE = (
219
219
  # Tool-call budget warning thresholds and truthful messages for Claude-path
220
220
  # sessions.
221
221
  #
222
- # In claude-agent-sdk 0.1.81, supported tool-lifecycle hooks that can inject
223
- # feedback via hookSpecificOutput.additionalContext are PostToolUse and
224
- # PostToolUseFailure. PostToolBatch is the exact-per-turn future option in
225
- # Claude Code, but is untyped and unsupported in this SDK version.
222
+ # In claude-agent-sdk 0.2.168, the hook events in the HookEvent literal that
223
+ # ClaudeAgentOptions.hooks is typed to accept, and that can inject feedback via
224
+ # hookSpecificOutput.additionalContext, are PostToolUse and PostToolUseFailure.
225
+ # PostToolBatch would give exact per-turn nudges and has a typed hookSpecificOutput
226
+ # (PostToolBatchHookSpecificOutput), but it is not in the HookEvent literal, so it
227
+ # is not used here.
226
228
  # We attach to PostToolUse and PostToolUseFailure to track combined tool
227
229
  # invocations and inject non-blocking convergence/stop nudges.
228
230
  #
@@ -284,10 +286,12 @@ def _make_tool_budget_nudge_hooks(
284
286
  """Create PostToolUse and PostToolUseFailure hooks that inject non-blocking
285
287
  nudge warnings into Claude-path sessions when tool-call counts cross budget thresholds.
286
288
 
287
- In claude-agent-sdk 0.1.81, supported tool-lifecycle hooks that can inject
288
- feedback via hookSpecificOutput.additionalContext are PostToolUse and
289
- PostToolUseFailure. PostToolBatch is the exact-per-turn future option in
290
- Claude Code, but is untyped and unsupported in this SDK version.
289
+ In claude-agent-sdk 0.2.168, the hook events in the HookEvent literal that
290
+ ClaudeAgentOptions.hooks is typed to accept, and that can inject feedback via
291
+ hookSpecificOutput.additionalContext, are PostToolUse and PostToolUseFailure.
292
+ PostToolBatch would give exact per-turn nudges and has a typed hookSpecificOutput
293
+ (PostToolBatchHookSpecificOutput), but it is not in the HookEvent literal, so it
294
+ is not used here.
291
295
 
292
296
  One callback is shared by both events, closing over combined tool-call count
293
297
  and one-shot flags. Subagent tool calls (bearing agent_id) are skipped.
@@ -20,10 +20,15 @@ classifiers = [
20
20
  ]
21
21
  dependencies = [
22
22
  # Claude Agent SDK for orchestrator + subagent dispatch.
23
- # Pinned to ==0.1.81: regenerating the lock on a sliding
24
- # exclude-newer window would otherwise downgrade to 0.1.75 and
25
- # potentially miss API surface added in 0.1.76+.
26
- "claude-agent-sdk==0.1.81",
23
+ # Pinned exactly: the SDK bundles the Claude Code CLI, and Anthropic's
24
+ # API rejects claude-opus-5-5 from Claude Code older than 2.1.280
25
+ # (claude_code_version_too_old, TECH-7686). 0.2.158 is the first SDK
26
+ # release that bundles CLI 2.1.280 (0.1.81 bundled 2.1.139), but its CLI
27
+ # prints an unrecognized_model warning for claude-sonnet-5-5. 0.2.168
28
+ # bundles CLI 2.1.301, on which both sonnet-5-5 and opus-5-5 were verified
29
+ # clean. Do not lower the pin below a release bundling >= 2.1.280
30
+ # (enforced by tests/test_sdk_bundled_cli_version.py).
31
+ "claude-agent-sdk==0.2.168",
27
32
  # LangGraph for pipeline orchestration
28
33
  "langgraph>=1.0.10,<2",
29
34
  "langgraph-checkpoint-postgres>=2.0.0",
@@ -152,8 +157,12 @@ prechecks = [
152
157
  # transitives jsonschema/importlib-metadata/pywin32 -- to that version for
153
158
  # EVERY install of this package, not just prechecks users. This is provably
154
159
  # safe, not a functional regression: claude-agent-sdk (core, always
155
- # installed) only requires mcp>=1.19.0, and 1.23.3 satisfies that floor, so
156
- # nothing here depends on an mcp feature added after 1.23.3. Investigated
160
+ # installed) requires mcp>=1.23.0,<3 (and jsonschema>=4.20.0) as of 0.2.168,
161
+ # and 1.23.3 satisfies that floor, so nothing here depends on an mcp feature
162
+ # added after 1.23.3. Headroom is thin: semgrep's exact mcp==1.23.3 pin now
163
+ # sits just above the SDK's 1.23.0 floor, so a future SDK bump that raises the
164
+ # mcp floor above 1.23.3 will conflict with the prechecks extra and need the
165
+ # semgrep pin revisited at that point. Investigated
157
166
  # uv's `conflicts` mechanism (declaring dev/prechecks mutually exclusive) as
158
167
  # a way to fork the resolution and keep the newer mcp for non-prechecks
159
168
  # installs -- it has no effect here, because 1.23.3 already satisfies both
@@ -39,7 +39,6 @@ import pytest
39
39
  from claude_agent_sdk import (
40
40
  AssistantMessage,
41
41
  ClaudeAgentOptions,
42
- ClaudeSDKClient,
43
42
  HookMatcher,
44
43
  ResultMessage,
45
44
  ToolResultBlock,
@@ -47,9 +46,10 @@ from claude_agent_sdk import (
47
46
  UserMessage,
48
47
  )
49
48
 
50
- # Pinned internal import: the exact SDK pin (0.1.81) is load-bearing;
49
+ # Pinned internal import: the exact SDK pin (0.2.168) is load-bearing;
51
50
  # this test and internal import must be revisited whenever claude-agent-sdk is bumped.
52
51
  from claude_agent_sdk._internal.query import _convert_hook_output_for_cli
52
+ from claude_agent_sdk.types import _hooks_to_internal_format
53
53
  from claude_agent_sdk.types import (
54
54
  HookContext,
55
55
  HookEvent,
@@ -692,8 +692,9 @@ class TestClaudeAgentSdkHookContract:
692
692
  assert isinstance(hooks["PostToolUse"][0], HookMatcher)
693
693
  assert isinstance(hooks["PostToolUseFailure"][0], HookMatcher)
694
694
 
695
- client = ClaudeSDKClient(options=ClaudeAgentOptions(hooks=hooks))
696
- internal = client._convert_hooks_to_internal_format(hooks)
695
+ # claude-agent-sdk 0.2.x moved this from a ClaudeSDKClient method to a
696
+ # module-level helper in claude_agent_sdk.types (TECH-7686).
697
+ internal = _hooks_to_internal_format(hooks)
697
698
  assert "PostToolUse" in internal
698
699
  assert "PostToolUseFailure" in internal
699
700
  assert len(internal["PostToolUse"]) == 1
@@ -0,0 +1,30 @@
1
+ """Guard: the SDK-bundled Claude Code CLI must be new enough for claude-opus-5-5.
2
+
3
+ Anthropic's API rejects claude-opus-5-5 from Claude Code older than 2.1.280
4
+ (HTTP 400, ``claude_code_version_too_old``). The Claude Agent SDK bundles the
5
+ CLI, so the SDK pin determines it. Pinned SDK 0.2.168 bundles 2.1.301; 2.1.280 is
6
+ the minimum for opus-5-5. See TECH-7686.
7
+ """
8
+
9
+ import re
10
+ import subprocess
11
+ from pathlib import Path
12
+
13
+ import claude_agent_sdk
14
+
15
+ MIN_BUNDLED_CLI = (2, 1, 280)
16
+
17
+
18
+ def test_bundled_claude_cli_supports_opus_5_5() -> None:
19
+ cli = Path(claude_agent_sdk.__file__).parent / "_bundled" / "claude"
20
+ assert cli.exists(), f"bundled Claude Code CLI missing at {cli}"
21
+ out = subprocess.run(
22
+ [str(cli), "--version"], capture_output=True, text=True, timeout=60, check=True
23
+ ).stdout
24
+ match = re.search(r"(\d+)\.(\d+)\.(\d+)", out)
25
+ assert match, f"could not parse CLI version from {out!r}"
26
+ version = tuple(int(g) for g in match.groups())
27
+ assert version >= MIN_BUNDLED_CLI, (
28
+ f"bundled Claude Code {version} is older than {MIN_BUNDLED_CLI}; "
29
+ "claude-opus-5-5 requests will be rejected (TECH-7686)"
30
+ )