fix: don't emit unused stdlib imports into vendored runtime bundles - #106
Merged
Conversation
runtime_bundle.render() spliced the same fixed `_chock_`-renamed stdlib import block into every agent's bundle, regardless of which of those names the assembled handler actually referenced. `shutil` is only used by `sessionstart`, extracted for claude_code alone, so every other vendor's compiled runtime carried a dead `import shutil as _chock_shutil` -- flagged by CodeQL in any adopter that compiles the full vendor set (surfaced via chock-catalog#56, adopting this repo's vendor coverage for the first time). Filter the import block per agent against what its handler source actually uses instead of splicing it unconditionally. Runtime goldens regenerated: only the dead import line moved for the nine affected agents (antigravity, codex_cli, cursor, devin, gemini_cli, grok, tabnine, vscode_copilot, windsurf); claude_code's bundle is unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RcphZmVVXoy8Jf2tUtcsC3 Signed-off-by: Open Coder AI <250249270+open-coder-ai@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
open-coder-ai
marked this pull request as ready for review
September 4, 2026 00:32
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.
What
chock.gate.runtime_bundle.render()spliced one fixed_chock_-renamed stdlib import block (os,shlex,shutil,subprocess,datetime,timezone,Path) into every agent's vendored runtime bundle, regardless of which of those names the assembled handler source (guard_runner+ optionallysessionstart) actually referenced.shutilis used only bysessionstart, which is extracted forclaude_codealone — so every other vendor's.chock/bin/<agent>.pycarried a deadimport shutil as _chock_shutil.Surfaced by CodeQL in chock-catalog#56 — the first time that repo's adoption pipeline compiled the full nine-vendor set introduced by agentseam 0.2.1/chock 0.8.0 (previously only
claude_code,cursor,vscode_copilot, andgateexisted there).render()now filters_IMPORTSper agent against what_handler_source(agent)actually references, instead of splicing it unconditionally.Definition of done
chock check→ 0 errors, 0 warnings, 0 infoschock check --only matrixpasses (no behavior change, matrix unchanged)chock sync --repo . --checkcleanchock check --only verifycleanpytest -qgreen (1058 passed, 3 skipped)pytest acceptance/ -c acceptance/pytest.ini --rootdir=acceptancegreenruff check .andruff format --check .clean (on the touched file)Claims
import shutil as _chock_shutilline;claude_codeandgateunchanged).🤖 Generated with Claude Code
https://claude.ai/code/session_01RcphZmVVXoy8Jf2tUtcsC3
Generated by Claude Code