Repository navigation
fix(server): keep exception text out of responses, log it instead - #1
Closed
modusensus wants to merge 1 commit into
Closed
modusensus wants to merge 1 commit into
modusensus wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
examples/server.py answered an unexpected failure with
`f"{type(exc).__name__}: {exc}"` on all three surfaces: the /predict 500 detail,
the per-item `error` of /predict/batch, and the exception branch of the /gui
error page. Exception text names paths, libraries and memory sizes -- it
describes the deployment, not the request -- and code scanning reports it as
stack-trace exposure (py/stack-trace-exposure).
laya.serve already answers this way: a fixed "inference failed" to the caller,
the traceback to the log, asserted by
test_inference_failure_is_logged_and_not_leaked in tests/test_serve.py. The
demo now follows the same policy through a logger of its own, which also makes
the GUI's "the server log has the full trace" hint true.
laya/serve.py: the failure log interpolated the request's `model` straight into
the message (py/log-injection). `_resolve_model` has already reduced that value
to a shipped checkpoint name or None; replacing the line breaks keeps the log
line on one entry even if that stops holding, and keeps the checkpoint name
readable, which is the point of logging it at all.
tests/test_example_server_errors.py drives all three surfaces with a raising
router (no weights needed) and asserts the marker text reaches the log and
never a response, that a 4xx still carries its reason, and is wired into
ci.yml alongside the limits regression.
The 4xx paths are untouched: those messages name what the caller has to fix.
modusensus
force-pushed
the
fix/example-server-error-text
branch
from
September 27, 2026 18:07
42430c4 to
8fd1b43
Compare
Owner
Author
|
Scan read: 0 results for the branch (4 on main). The change is up as NandhaKishorM#625; this draft was only to run the security workflow through a pull_request event. |
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.
Draft: runs the security workflow (CodeQL, security-extended) against the error-text fix through a pull_request event before the change goes upstream as a PR. Closed once the scan has been read.