fix: apply pinned LLM installs, pip cache, and enforce tests (#1453) - #1456
Conversation
Completes the remaining acceptance criteria from issue #1453 that the initial Codex attempt (PR #1454) left unfulfilled: Workflow changes: - agents-auto-pilot.yml: replace floating pip install langchain with pip install -r tools/requirements-llm.txt; add id to setup-python step; add actions/cache@v4 keyed on Python version + requirements hash - reusable-agents-verifier.yml: replace floating pip install pydantic langchain-openai langchain-anthropic in both evaluate and compare modes with pip install -r .workflows-lib/tools/requirements-llm.txt; add id to both setup-python steps; add mode-specific actions/cache@v4 Test enforcement: - Remove _skip_if_not_high_privilege() gating so tests run in normal CI - Fix broken regex in _assert_no_floating_langchain (double-escaped backslash-b in raw string was matching literal backslashes) Injection guard test coverage: - Add parametrized tests for non-string reason values from detector - Add parametrized tests for all 5 known reason codes - 1864 tests pass (+8 new, -4 former skips)
Automated Status SummaryHead SHA: 15e3efb
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopePR #1447 addressed issue #1437, but verification failed because the actual workflow files were not updated to use pinned LLM dependency installs and proper pip caching, and the enforcement tests were effectively skipped in normal CI. This follow-up closes the remaining gaps by updating the live GitHub Actions workflows, enabling non-skipped enforcement tests, and hardening Context for AgentRelated Issues/PRsTasksTest Updates (Agent-Executable)
Code Hardening (Agent-Executable)
Workflow Update Snippets (Agent-Executable)
Acceptance criteriaWorkflow Files (Human-Applied)
Test Enforcement
Code Hardening
Documentation Deliverables
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbbaa9410d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🤖 Keepalive Loop StatusPR #1456 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
There was a problem hiding this comment.
Pull request overview
Updates the live GitHub Actions workflows and associated tests to enforce pinned LLM dependency installs (via requirements files) and add pip caching, while strengthening prompt-injection guard test coverage.
Changes:
- Switch LLM dependency installs in workflows from floating
pip install langchain*...topip install -r .../requirements-llm.txt, and addactions/cache@v4pip caching keyed by Python version + requirements hash. - Remove the conditional CI skip so workflow-enforcement tests run in normal CI, and fix the langchain floating-install detection regex.
- Add additional unit tests ensuring
check_prompt_injection()handles non-string/malformed reason values and recognizes all known reason codes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/workflows/test_workflow_llm_installs.py |
Removes high-privilege skip and fixes regex to properly detect floating langchain installs; continues enforcing pinned install + cache presence. |
tests/scripts/test_injection_guard.py |
Adds parametrized tests for malformed/non-string detector reasons and for all known reason codes. |
.github/workflows/reusable-agents-verifier.yml |
Adds setup-python step IDs, pip cache steps, and switches evaluate/compare installs to requirements files. |
.github/workflows/agents-auto-pilot.yml |
Adds setup-python step ID, pip cache step, and replaces floating langchain installs with requirements-based install. |
Address PR #1456 review comments: - Copy tools/requirements-llm.txt to templates/consumer-repo/tools/ - Add tools/requirements-llm.txt to .github/sync-manifest.yml - Update consumer template with id: setup-python, actions/cache@v4, and pip install -r tools/requirements-llm.txt (replacing floating installs) - Fix cache key line length in main workflow (>100 chars)
Automated Status Summary
Scope
PR #1447 addressed issue #1437, but verification failed because the actual workflow files were not updated to use pinned LLM dependency installs and proper pip caching, and the enforcement tests were effectively skipped in normal CI. This follow-up closes the remaining gaps by updating the live GitHub Actions workflows, enabling non-skipped enforcement tests, and hardening
check_prompt_injection()to avoid runtime errors on malformed detector outputs.Context for Agent
Related Issues/PRs
Tasks
Test Updates (Agent-Executable)
tests/workflows/test_workflow_llm_installs.pyso tests run in normal CItests/workflows/test_workflow_llm_installs.pyto verify agents-auto-pilot workflow contains the pinned install step and lacks unpinned langchain commandstests/workflows/test_workflow_llm_installs.pyto verify reusable-agents-verifier workflow contains pinned install steps in both evaluate and compare modestests/workflows/test_workflow_llm_installs.pyto verify both workflows include actions/cache@v4 with correct cache keys containing Python version and requirements hashcheck_prompt_injection()handles malformed detector outputs without raising exceptionscheck_prompt_injection()correctly handles known-good reason code formatsCode Hardening (Agent-Executable)
check_prompt_injection()to validate detector output format before parsing (check prefix/delimiters and guard integer conversion)check_prompt_injection()for unexpected formats (no exception, defined behavior)Workflow Update Snippets (Agent-Executable)
docs/workflow-updates/agents-auto-pilot-changes.ymlwith complete YAML snippet for pip install step and cache configurationdocs/workflow-updates/reusable-agents-verifier-changes.ymlwith complete YAML snippets for evaluate/compare mode pip install steps and cache configurationdocs/workflow-updates/README.mdwith instructions for applying the YAML snippets to protected workflow filesAcceptance criteria
Workflow Files (Human-Applied)
.github/workflows/agents-auto-pilot.ymlcontains a step that executes exactlypip install -r tools/requirements-llm.txt(as a run command in the workflow).github/workflows/agents-auto-pilot.ymldoes NOT contain anypip installcommands that install langchain via an unpinned specifier, including (but not limited to)pip install langchain,pip install langchain*,pip install langchain==(missing version), orpip install git+...langchain....github/workflows/reusable-agents-verifier.ymlincludes a step that executes exactlypip install -r .workflows-lib/tools/requirements-llm.txtin the evaluate mode execution path.github/workflows/reusable-agents-verifier.ymlincludes a step that executes exactlypip install -r .workflows-lib/tools/requirements-llm.txtin the compare mode execution path.github/workflows/reusable-agents-verifier.ymldoes NOT contain anypip installcommands that install langchain via an unpinned specifier in the evaluate or compare execution paths (e.g.,pip install langchain*,pip install langchain,pip install langchain-communitywithout a version pin).github/workflows/agents-auto-pilot.ymlcontains anactions/cache@v4step that caches pip (cache path includes pip cache directory) and uses a cache key that includes BOTH the Python version and${{ hashFiles('tools/requirements-llm.txt') }}.github/workflows/reusable-agents-verifier.ymlcontains anactions/cache@v4step that caches pip (cache path includes pip cache directory) and uses a cache key that includes BOTH the Python version and${{ hashFiles('.workflows-lib/tools/requirements-llm.txt') }}Test Enforcement
tests/workflows/test_workflow_llm_installs.pyis executed under normal CI (i.e., it is not unconditionally skipped) and will fail if the agents-auto-pilot workflow lacks the pinned requirements install steptests/workflows/test_workflow_llm_installs.pyasserts that.github/workflows/agents-auto-pilot.ymlcontainspip install -r tools/requirements-llm.txtAND asserts it does not contain any floatingpip install langchain*/unversioned langchain install commandstests/workflows/test_workflow_llm_installs.pyasserts that.github/workflows/reusable-agents-verifier.ymlcontainspip install -r .workflows-lib/tools/requirements-llm.txtfor BOTH evaluate and compare modes (separate assertions per mode/path, not a single generic check)tests/workflows/test_workflow_llm_installs.pyasserts that BOTH workflows include anactions/cache@v4step and that each cache key includes Python version + the correcthashFiles(...)call for the correct requirements pathCode Hardening
check_prompt_injection()does not raise an exception whendetect_prompt_injectionreturns an unexpected or malformed reason code (e.g., empty string, missing delimiter/prefix, non-integer suffix); instead it follows a defined fallback path (e.g., returns a safe default or logs and continues)check_prompt_injection()continues to correctly handle valid reason code formats by producing the same outcome as before for at least one known-good reason code valuecheck_prompt_injection()behavior with both malformed and known-good detector outputsDocumentation Deliverables
docs/workflow-updates/agents-auto-pilot-changes.ymlexists and contains valid YAML snippet for pip install and cache stepsdocs/workflow-updates/reusable-agents-verifier-changes.ymlexists and contains valid YAML snippets for evaluate/compare mode pip install and cache stepsdocs/workflow-updates/README.mdexists and provides clear instructions for applying the YAML snippets to the protected workflow filesHead SHA: 538b8b6
Latest Runs: ✅ success — Gate
Required: gate: ✅ success