Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

bugfix: Ensure schema is loaded before processing#221

Merged
tempusfrangit merged 4 commits into
mainfrom
runtime-fixes
Sep 18, 2025
Merged

bugfix: Ensure schema is loaded before processing#221
tempusfrangit merged 4 commits into
mainfrom
runtime-fixes

Conversation

@tempusfrangit
Copy link
Copy Markdown
Contributor

Schema wasn't loaded prior to processing the input paths this resulted in a noop nil response. To ensure we always load the schema first we now block on runner ready state before processing. Additionaly a nil doc is considered an error. In the cases we call ProcessInputPaths we can accept that error; in manager we explicitly check for doc being nil and emit an error log.

Schema wasn't loaded prior to processing the input paths this resulted
in a noop nil response. To ensure we always load the schema first we now
block on runner ready state before processing. Additionaly a nil doc is
considered an error. In the cases we call ProcessInputPaths we can
accept that error; in manager we explicitly check for doc being nil and
emit an error log.
Copilot AI review requested due to automatic review settings September 18, 2025 20:25
@tempusfrangit tempusfrangit requested a review from a team as a code owner September 18, 2025 20:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a critical bug where the OpenAPI schema wasn't loaded before processing input paths, causing URL and base64 inputs to be passed through unchanged instead of being converted to local paths. The solution ensures the runner's setup is complete (including schema loading) before prediction processing begins, and adds proper error handling for nil schema cases.

  • Adds a wait mechanism to ensure runner setup completes before predictions are processed
  • Introduces explicit error handling when OpenAPI schema is unavailable
  • Updates ProcessInputPaths to return an error when schema is nil instead of silently skipping processing

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/runner/manager.go Adds blocking wait for runner setup completion before prediction processing
internal/runner/runner.go Adds nil schema check and error logging for input path processing
internal/runner/path.go Changes ProcessInputPaths to return error when schema unavailable
internal/runner/types.go Adds context field to PendingPrediction struct
internal/runner/path_test.go Updates test to expect error when schema is nil
python/tests/runners/path_input_https.py Test predictor for HTTPS path input regression testing
python/tests/procedures/path_test/* Test procedure files for path input testing
internal/tests/*_test.go Comprehensive regression tests for path input processing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread internal/runner/runner.go Outdated
Comment thread internal/runner/manager.go Outdated
Async predictions should not 500. However, since we now known that the
runner failed before we send the prediction request down, we end up
needing to work around the error and still send a 202 *then* let the
webhook indicate failure.

While this behavior is somewhat crazy, it is the behavioral contract we
can revisit in the future.
Copilot AI review requested due to automatic review settings September 18, 2025 21:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread internal/runner/types.go
Comment thread internal/runner/runner.go Outdated
Comment thread internal/runner/manager.go Outdated
Comment thread internal/runner/path.go
Comment thread internal/tests/procedure_schema_test.go Outdated
Comment thread internal/tests/procedure_schema_test.go Outdated
Copilot AI review requested due to automatic review settings September 18, 2025 22:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread internal/runner/types.go
Comment thread internal/runner/runner.go
Copy link
Copy Markdown
Contributor

@michaeldwan michaeldwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tempusfrangit tempusfrangit merged commit 4ce0fe7 into main Sep 18, 2025
23 checks passed
@tempusfrangit tempusfrangit deleted the runtime-fixes branch September 18, 2025 22:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants