Skip to content

Fix subprocess shell usage, error handling, retry logic, and dependency pinning in custom skills#98

Closed
Copilot wants to merge 1 commit into
sbaidachni/docker_docsfrom
copilot/sub-pr-87-0ec8118e-3492-4038-80ff-2c521b8024ac
Closed

Fix subprocess shell usage, error handling, retry logic, and dependency pinning in custom skills#98
Copilot wants to merge 1 commit into
sbaidachni/docker_docsfrom
copilot/sub-pr-87-0ec8118e-3492-4038-80ff-2c521b8024ac

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Addresses five code review findings in the Azure Functions deployment and custom skills code.

Changes

  • deploy_azure_functions.py: Removed shell=True from both subprocess.run calls (_deploy_functions and _deploy_functions_withslot) — list-form args require shell=False
  • Error handling: Replaced stale requests.exceptions.RequestException catch (left over from a removed REST call) with subprocess.CalledProcessError in both deployment functions
  • VectorEmbed/__init__.py: Replaced over-broad retry_if_exception with retry_if_exception_type(TRANSIENT_OPENAI_ERRORS) targeting only rate limit/connection/timeout/server errors; updated log message from misleading "Rate Limit Exceeded" to "Transient error encountered"
  • requirements.txt: Pinned all 14 dependencies to explicit versions to eliminate supply chain risk from unpinned installs running under managed identity
  • Linting: Split TRANSIENT_OPENAI_ERRORS tuple across lines to fix E501 (line > 120 chars)
# Before: retries on everything, misleading log
@retry(retry=retry_if_exception(lambda e: True), ...)
def _generate_embedding(...):
    ...

# After: targeted retry on transient OpenAI errors only
TRANSIENT_OPENAI_ERRORS = (
    openai.RateLimitError, openai.APIConnectionError,
    openai.APITimeoutError, openai.InternalServerError
)

@retry(retry=retry_if_exception_type(TRANSIENT_OPENAI_ERRORS), ...)
def _generate_embedding(...):
    ...

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update documentation and fix Docker configuration Fix subprocess shell usage, error handling, retry logic, and dependency pinning in custom skills Mar 2, 2026
@sbaidachni sbaidachni closed this Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants