Skip to content

Add pip fallback and update Claude model defaults#23

Merged
pirate merged 9 commits intomainfrom
claude/update-plugin-config-G2xMm
Apr 3, 2026
Merged

Add pip fallback and update Claude model defaults#23
pirate merged 9 commits intomainfrom
claude/update-plugin-config-G2xMm

Conversation

@pirate
Copy link
Copy Markdown
Member

@pirate pirate commented Apr 2, 2026

Summary

This PR adds a direct pip installation fallback mechanism for the pip plugin and updates Claude model configuration defaults across multiple plugins to use the latest model identifiers.

Key Changes

Pip Plugin Enhancements

  • New _direct_pip_install() function: Implements a fallback installation method that bypasses PipProvider/uv when they fail (e.g., in sandboxed or CI environments)

    • Installs setuptools and wheel as build dependencies
    • Uses --prefer-binary flag to minimize build failures
    • Extracts version information via pip show
    • Returns binary path and version on success
  • Fallback integration in main(): Added two fallback attempts:

    1. When PipProvider raises an exception
    2. When PipProvider succeeds but the binary is not found in the venv
  • Both fallback paths emit proper diagnostic messages and emit binary records before exiting

Claude Model Configuration Updates

  • Updated default model across all Claude plugins from short names (e.g., "sonnet") to full model identifiers:

    • claudecode: "sonnet" → "claude-sonnet-4-6"
    • claudecodecleanup: "sonnet" → "claude-sonnet-4-6"
    • claudecodeextract: "sonnet" → "claude-sonnet-4-6"
    • claudechrome: "sonnet" → "claude-sonnet-4-6"
  • Updated example descriptions to show full model identifiers (claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-5-20251001)

  • Increased default max_turns for better agentic reasoning:

    • claudecode: 10 → 50
    • claudecodecleanup: 25 → 50
    • claudecodeextract: 10 → 50
  • Updated docstrings and test assertions to reflect new defaults

Implementation Details

  • The fallback mechanism gracefully handles missing binaries and extraction failures
  • All subprocess calls include appropriate timeouts (120s for setup, 300s for install, 30s for version check)
  • Fallback only triggers if the venv's pip binary is executable
  • Version extraction is wrapped in exception handling to prevent failures if pip show is unavailable

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D


Open with Devin

Summary by cubic

Switches the pip installer to native abx-pkg>=1.9.23 support for post‑install scripts and release‑age checks, and updates Claude plugin defaults to claude-sonnet-4-6 with max_turns=50. Fixes claudechrome to use config defaults and refreshes model IDs.

  • New Features

    • Pip: use PipProvider/Binary with postinstall_scripts and min_release_age; add --postinstall-scripts and --min-release-age; pin abx-pkg>=1.9.23.
    • Non‑pip providers (apt, brew, cargo, npm, puppeteer, chromewebstore, env): set min_release_age: 0.
    • Claude: default model claude-sonnet-4-6; max_turns=50; update MODEL_MAP to claude-sonnet-4-6/claude-opus-4-6; claudechrome reads defaults from hookConfig; docs/tests updated (incl. cleanup test to allow equal max_turns).
  • Migration

    • Default model is now claude-sonnet-4-6 for claudecode, claudecodecleanup, claudecodeextract, and claudechrome.
    • Default max_turns is now 50 for claudecode, claudecodecleanup, and claudecodeextract. Set model and max_turns in plugin config to keep prior behavior.

Written for commit 635d8ca. Summary will update on new commits.

devin-ai-integration[bot]

This comment was marked as resolved.

cubic-dev-ai[bot]

This comment was marked as resolved.

cubic-dev-ai[bot]

This comment was marked as resolved.

@pirate pirate force-pushed the claude/update-plugin-config-G2xMm branch from 6d05d19 to 1ebf7d4 Compare April 2, 2026 21:58
devin-ai-integration[bot]

This comment was marked as resolved.

@pirate pirate force-pushed the claude/update-plugin-config-G2xMm branch from ffc3c24 to 242d24e Compare April 2, 2026 22:33
cubic-dev-ai[bot]

This comment was marked as resolved.

cubic-dev-ai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@pirate pirate force-pushed the claude/update-plugin-config-G2xMm branch 2 times, most recently from 9a1b953 to 71b69a8 Compare April 3, 2026 07:29
claude added 9 commits April 3, 2026 07:50
…dd pip install fallback

- Change default model from "sonnet" to "claude-sonnet-4-6" across all claude
  plugins (claudecode, claudecodeextract, claudecodecleanup, claudechrome)
- Change default max_turns to 50 across all claude plugins
- Add direct pip fallback in pip hook for when PipProvider/uv fails in
  sandboxed/CI environments (fixes papers-dl install failures)

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D
…DMEs

- Add --postinstall-scripts CLI flag to pip hook that uses direct pip install
  (bypassing uv/PipProvider) to ensure console_scripts entry points are created
- Set postinstall_scripts: true in papersdl config.json required_binaries
- Fix lock scope: move all _direct_pip_install fallbacks inside _locked_pip_venv
- Pass min_version to _direct_pip_install fallback to preserve version contract
- Update all claude plugin READMEs to reflect new model/max_turns defaults

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D
…cripts

abx-pkg>=1.9.23 natively supports postinstall_scripts, min_version, and
min_release_age in Binary() and PipProvider(). Remove the custom
_direct_pip_install fallback and pass these params through directly.

- Remove _direct_pip_install function (~55 lines of dead code)
- Remove all fallback logic from main() (3 separate fallback blocks)
- Pass postinstall_scripts and min_release_age to PipProvider() constructor
- Pass postinstall_scripts and min_release_age to Binary() constructor
- Add --min-release-age CLI option for completeness
- Pin abx-pkg>=1.9.23 in both pyproject.toml and script dependencies

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D
The JS hook was using getEnv() with hardcoded fallbacks instead of
hookConfig (which reads config.json defaults via loadConfig()). This
meant config.json model default changes were ineffective. Also update
MODEL_MAP to use current model IDs (claude-sonnet-4-6, claude-opus-4-6).

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D
…ooks

- Fix click.get_current_context() nullable return in all 9 hooks
  (use silent=True + None guard)
- Fix pip hook overrides type annotation (add type: ignore for
  dict[str, dict[str, str]] -> BinaryOverrides covariance)
- Fix custom hook binary_kwargs possibly unbound
- Fix puppeteer _parse_override_install_args type narrowing
  (isinstance check for proper dict narrowing)
- Add ty:ignore comments for **kwargs unpacking of request_kwargs
  (ty can't verify types through dict unpacking)
- Remove unused SemVer import from npm hook
- Fix claude.yml missing trailing newline

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D
Binary() now defaults min_release_age=7.0 but apt, brew, cargo, npm,
puppeteer, chromewebstore, and env providers either don't support it
or don't need it. Set min_release_age=0 in request_kwargs to disable
the security constraint check for these providers.

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D
Both cleanup and extract now default to max_turns=50, so the claim
that cleanup has a "higher default" is no longer accurate.

https://claude.ai/code/session_017eYK4Gkxy3F4UwHwhy7j9D
@pirate pirate force-pushed the claude/update-plugin-config-G2xMm branch from 71b69a8 to 635d8ca Compare April 3, 2026 07:50
@pirate pirate merged commit 4229d89 into main Apr 3, 2026
4 checks passed
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.

2 participants