Skip to content

fix(runner): fail safe on invalid output size config - #47

Merged
danny-avila merged 1 commit into
LibreChat-AI:mainfrom
fallintoplace:fix/runner-safe-output-size
Sep 2, 2026
Merged

fix(runner): fail safe on invalid output size config#47
danny-avila merged 1 commit into
LibreChat-AI:mainfrom
fallintoplace:fix/runner-safe-output-size

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Parse SANDBOX_OUTPUT_MAX_SIZE with safeInt, using 1024 when the value is invalid.

Why

The current Number(...) conversion turns a typo such as SANDBOX_OUTPUT_MAX_SIZE=banana into NaN. The runner uses this value in comparisons while streaming stdout and stderr. Every comparison with NaN is false, so the configured output cap is effectively disabled and output can keep accumulating in memory.

The existing safeInt helper already handles invalid, non-positive, and fractional values. This change uses that helper for the output limit only. Valid integer settings continue to work as before.

Tests

  • bun test api/src/config.test.ts api/src/validation.test.ts
  • Checked banana, -5, 3.7, and 2048 through the config module.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T02:27:39.502327Z cd0722f Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: cd0722fbb1

ℹ️ 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".

@danny-avila
danny-avila merged commit 733c832 into LibreChat-AI:main Sep 2, 2026
6 checks passed
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