fix(config): throw on invalid/out-of-range port env vars#341
fix(config): throw on invalid/out-of-range port env vars#341xlabtg merged 4 commits intoxlabtg:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#317
Introduce parseEnvPort(name, value) that throws a descriptive error when TELETON_WEBUI_PORT or TELETON_API_PORT is non-numeric or outside the 1–65535 range, aligning them with the existing fail-fast behaviour of TELETON_TG_API_ID and TELETON_BASE_URL. Silently dropping a bad port env was causing silent network misconfiguration in hardened deployments. Closes xlabtg#317
loadConfig silently drops invalid TELETON_WEBUI_PORT/TELETON_API_PORT
Solution summaryDone. Here's a summary of what was implemented: Changes made:
PR: #341 (marked ready for review) This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $1.215618📊 Context and tokens usage:
Total: (48.0K + 2.9M cached) input tokens, 11.5K output tokens, $1.215618 cost 🤖 Models used:
📎 Log file uploaded as Gist (1719KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart triggered (iteration 1)Reason: CI failures detected Starting new session to address the issues. Auto-restart-until-mergeable mode is active. Will continue until PR becomes mergeable. |
🔄 Auto-restart-until-mergeable Log (iteration 1)This log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $0.303026📊 Context and tokens usage:
Total: (24.1K + 554.2K cached) input tokens, 3.1K output tokens, $0.303026 cost 🤖 Models used:
📎 Log file uploaded as Gist (2251KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit b8a0ca9.
Summary
Fixes #317 —
loadConfigsilently dropped invalidTELETON_WEBUI_PORT/TELETON_API_PORTvalues instead of failing fast.parseEnvPort(name, value)that throws a descriptive error when the value is non-numeric or outside the valid 1–65535 range.TELETON_WEBUI_PORT,TELETON_API_PORT) with calls toparseEnvPort, aligning them with the existing fail-fast behaviour ofTELETON_TG_API_IDandTELETON_BASE_URL.parseEnvPortis exported so callers and plugins can reuse it.How to reproduce the issue
Regression tests added
TELETON_WEBUI_PORT=abcInvalid TELETON_WEBUI_PORT … not a valid integerTELETON_WEBUI_PORT=99999Invalid TELETON_WEBUI_PORT … out of valid port rangeTELETON_WEBUI_PORT=80808080TELETON_API_PORT=abcInvalid TELETON_API_PORT … not a valid integerTELETON_API_PORT=99999Invalid TELETON_API_PORT … out of valid port rangeTELETON_API_PORT=77787778All previously existing config loader tests continue to pass.