Add comprehensive security review and unit tests for entrypoints module - #1
Draft
wuhang2014 with Copilot wants to merge 4 commits into
Draft
Add comprehensive security review and unit tests for entrypoints module#1wuhang2014 with Copilot wants to merge 4 commits into
wuhang2014 with Copilot wants to merge 4 commits into
Conversation
… module Co-authored-by: wuhang2014 <8769248+wuhang2014@users.noreply.github.com>
Co-authored-by: wuhang2014 <8769248+wuhang2014@users.noreply.github.com>
Co-authored-by: wuhang2014 <8769248+wuhang2014@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for module entrypoints verification
Add comprehensive security review and unit tests for entrypoints module
Jan 4, 2026
wuhang2014
pushed a commit
that referenced
this pull request
Mar 17, 2026
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.
Conducted security-focused code review of the entrypoints module and added comprehensive unit test coverage to verify correctness.
Code Review Findings
Identified 8 security/quality issues in the entrypoints module:
High Severity:
chat_utils._extract_audio_from_video_async- accepts arbitrary file paths without validationchat_utils._download_video_sync- downloads from arbitrary URLs without timeout/size limitsomni._normalize_cache_config- no schema validation or depth limitschat_utils._write_temp_file_sync-delete=Falsewith incomplete cleanupstage_utils.append_jsonl- arbitrary file write via unvalidated path parameterMedium Severity:
All findings documented in
CODE_REVIEW_FINDINGS.mdwith code locations and remediation guidance.Test Coverage
Added 114 unit tests across 5 new test files:
test_utils.py- Config loading, dataclass conversion, stage resolutiontest_chat_utils.py- Multimodal parsing, async video/audio extractiontest_client_request_state.py- Request state and queue managementtest_log_utils.py- Metrics aggregation, transfer tracking, orchestrator lifecycletest_openai_protocol.py- OpenAPI request/response validationTests cover:
time.sleep)Example test structure:
Validation
Original prompt
Created from VS Code.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.