Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
ci(pr-health): check out the commit the workflow runs from (#3887)
gglucass55ce93f3e8ae
diff --git a/.github/workflows/pr-health.yml b/.github/workflows/pr-health.ymlindex 92b618263..bbaea26cd 100644--- a/.github/workflows/pr-health.yml+++ b/.github/workflows/pr-health.yml@@ -27,7 +27,7 @@ jobs:steps:- uses: actions/checkout@v7with:- ref: ${{ github.event.pull_request.base.sha }}+ ref: ${{ github.sha }}- name: Fetch current PR bodyenv:@@ -153,7 +153,7 @@ jobs:steps:- uses: actions/checkout@v7with:- ref: ${{ github.event.pull_request.base.sha }}+ ref: ${{ github.sha }}- name: Ensure maintenance labels existrun: |diff --git a/scripts/tests/test_pr_health_workflow.py b/scripts/tests/test_pr_health_workflow.pyindex 755825c58..818581dd2 100644--- a/scripts/tests/test_pr_health_workflow.py+++ b/scripts/tests/test_pr_health_workflow.py@@ -119,3 +119,14 @@ def test_failed_base_file_comparison_does_not_clear_the_rebase_label() -> None:dispatch = workflow[start : workflow.index("\n fi\n", start)]assert 'elif [[ "$drift" == "current" ]]; then' in dispatchassert "else" not in dispatch+++def test_checkouts_use_the_commit_the_workflow_runs_from() -> None:+ # pull_request_target runs this workflow file from the default branch.+ # Checking out the PR's recorded base.sha instead pairs it with whatever+ # helper scripts existed when the PR was last synced, so a new flag here+ # fails every older PR's run with "unrecognized arguments".+ workflow = Path(".github/workflows/pr-health.yml").read_text(encoding="utf-8")++ assert "pull_request.base.sha" not in workflow+ assert workflow.count("ref: ${{ github.sha }}") == workflow.count("actions/checkout@")