docs(agents): record how to install phpstan in remote sessions - #660
Merged
Conversation
Claude Code on the web sessions cannot install phpstan/phpstan: the session proxy answers 403 for every GitHub zipball outside the attached repo, and phpstan/phpstan publishes no `source` to fall back to (dist only). Document the diagnosis and a verified recipe: shallow-clone the release tag over git (which the proxy allows), `git archive` it into composer's dist cache under the key composer computes, then `composer install --prefer-source`. Also record the second blocker hit in the same environment: the image's 99-agent.ini enables the tracing JIT for CLI, and under PHP 8.5.10 it miscompiles the goaop/dissect LALR parser loop, failing all 32 Functional tests. `PHP_INI_SCAN_DIR=":<dir>"` with `opcache.jit=0` reaches the spawned console processes; `php -d` does not. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X2syVMk85L4eCjMRbdAjJQ
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #660 +/- ##
=============================================
+ Coverage 85.40% 96.00% +10.60%
- Complexity 1636 1637 +1
=============================================
Files 99 99
Lines 4509 4510 +1
=============================================
+ Hits 3851 4330 +479
+ Misses 658 180 -478 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Explain what blocks dist downloads (the session proxy gates GitHub zipballs per attached repo, no composer setting can open it) and make the fast fix primary: a packagist mirror that hosts its own dist zips (mirrors.cloud.tencent.com, verified current and byte-identical to the GitHub tags) installs everything from dist in ~30s with no fallbacks, phpstan included. Keep the cache-seeding recipe as the fallback. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X2syVMk85L4eCjMRbdAjJQ
…only The PHP 8.5 JIT test failure is a separate concern and gets its own issue. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X2syVMk85L4eCjMRbdAjJQ
lisachenko
marked this pull request as ready for review
September 3, 2026 11:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every fresh Claude Code on the web session of this repo installs dependencies from source (slow) and then fails
composer installon phpstan/phpstan. This PR records the diagnosis and the verified workarounds intests/AGENTS.md, with a one-line pointer from the rootAGENTS.md.Diagnosis
api.github.comzipballs, codeload and archive URLs only for repositories attached to the session. Every other package's dist download gets403 "GitHub access to this repository is not enabled for this session", with or without a token, so no composer auth setting can open it.sourceper package (a full git clone). Anonymous git reads of public repos pass the proxy, so the install works but takes 70 to 85 seconds with ~80 failed dist attempts."source": null(its composer.json declares an emptysourceblock deliberately; the code lives in phpstan/phpstan-src). No fallback, so the whole install aborts with "Could not authenticate against github.com".Recipes recorded
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer, drop the stale lock,composer install. The mirror hosts its own dist zips, is current with packagist, and its zips are byte-identical to the GitHub tags (phpstan.phar sha256 checked against the git tag and the release asset). Fresh install: ~30 s, 83 archives extracted, 0 fallbacks. Aliyun, Huawei and packagist.jp were tested and do not serve dists.git archiveit into composer's dist cache undersha1(dist url), thencomposer install --prefer-source.Validated from a clean state (no vendor, no lock, empty dist cache) for both fixes: install succeeds and
composer analyzereports no errors.🤖 Generated with Claude Code
https://claude.ai/code/session_01X2syVMk85L4eCjMRbdAjJQ