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
fix(ci): stage smoke-import script as host file (broke main post-#387)
chopratejas7fe2d1e5b632
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 9eff4ea52..ae7c56bcc 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -387,6 +387,32 @@ jobs:name: ${{ matrix.wheel_artifact }}path: dist/+ - name: Stage smoke-import script+ # The smoke script lives in a host file rather than an inline+ # heredoc/`-c` invocation. Rationale:+ #+ # 1. The Linux job wraps the smoke check in `bash -ec '<long>'`+ # where the outer single quote preserves whitespace AND+ # forbids any internal single quote (closing it terminates+ # the script). A `<<PY ... PY` heredoc inside the inner bash+ # inherits the YAML indentation, so the closing `PY` is at+ # column 14, never matched (caught post-#387 merge: bash+ # "here-document at line 65 delimited by end-of-file").+ # 2. Switching to `python -c "<f-string>"` solves the heredoc+ # indent problem but reintroduces the single-quote nesting+ # issue (Python f-strings need quote chars).+ # 3. A host-side file dodges both: bash heredoc body lives at+ # YAML `run: |` level (uniform strip), the docker container+ # sees it as a read-only mount, and macOS host runs the+ # same script — no quoting drift between paths.+ run: |+ cat > "${RUNNER_TEMP}/smoke_import.py" <<'PY'+ import sys+ import headroom+ from headroom._core import hello as _rust_hello+ print(f"smoke-import OK: python={sys.version_info[:3]} hello={_rust_hello()}")+ PY+- name: Smoke-import wheel inside container (Linux)if: matrix.image != ''env:@@ -402,6 +428,7 @@ jobs:# easier to debug.docker run --rm \-v "$(pwd)/dist:/wheels:ro" \+ -v "${RUNNER_TEMP}/smoke_import.py:/smoke_import.py:ro" \-e PYTHON_VERSION="$PYTHON_VERSION" \-e WHEEL_TARGET="$WHEEL_TARGET" \-e GLIBC_LABEL="$GLIBC_LABEL" \@@ -469,14 +496,11 @@ jobs:# The actual smoke check — mirrors the proxy# `_check_rust_core` path that fails with exit-78 on- # broken wheels. If this `import` fails the whole- # release is held.- /tmp/venv/bin/python - <<PY- import sys- import headroom- from headroom._core import hello as _rust_hello- print(f"smoke-import OK: python={sys.version_info[:3]} hello={_rust_hello()}")- PY+ # broken wheels. The script is mounted from the host via+ # `-v ${RUNNER_TEMP}/smoke_import.py:/smoke_import.py:ro`;+ # see the "Stage smoke-import script" step above for why+ # an inline heredoc here would not work.+ /tmp/venv/bin/python /smoke_import.py'- name: Smoke-import wheel on macOS host@@ -500,12 +524,9 @@ jobs:"python$PYTHON_VERSION" -m venv /tmp/venv/tmp/venv/bin/pip install --quiet --upgrade pip/tmp/venv/bin/pip install --quiet "$whl"- /tmp/venv/bin/python - <<'PY'- import sys- import headroom- from headroom._core import hello as _rust_hello- print(f"smoke-import OK: python={sys.version_info[:3]} hello={_rust_hello()}")- PY+ # Same staged smoke script as the Linux container path uses,+ # invoked directly on the macOS host (no docker mount needed).+ /tmp/venv/bin/python "${RUNNER_TEMP}/smoke_import.py"publish-pypi:needs: [collect-dist, smoke-import-wheels]