Add LINO configuration validation with error messages#1087
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1086
When multiple options are placed on the same line in LINO configuration, the parser creates nested tuples. The previous implementation of parseStringValues only extracted top-level values, silently dropping nested ones. This fix recursively extracts all string values from nested LINO structures, ensuring all configuration options are properly parsed regardless of how they are formatted in the input. Root cause: Options like "--auto-resume-on-limit-reset --tokens-budget-stats" on the same line are parsed as a nested tuple, which was not being flattened. Also includes: - Case study documentation with root cause analysis - Experiment scripts for reproducing and verifying the fix Fixes #1086 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Solution Draft Log (Truncated)This log file contains the complete execution trace of the AI solution draft process. Click to expand solution draft log (676KB, truncated)Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
We need also add unit tests for all LINO logic, if absend, or if present add for all cases, so everything that was working before should keep working. Unit tests should be executed in CI/CD. Also I think you analisys is wrong, and may be needed to be reverted. As We should not treat single line as multiple options, because it may lead to treating options with values as two different options. I think it is better to have error if we have unrecognized characters Ensure all changes are correct, consistent and fully meet the requirements. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-09T21:27:46.206Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Add validation in lenv-reader.lib.mjs to reject multiple values on same line - Add validation to reject unrecognized characters in CLI options (?, @, etc.) - Revert parseStringValues to original (validation happens at lenv-reader level) - Add comprehensive unit tests for LINO logic (test-lino.mjs) - Add validation tests to test-lenv-reader.mjs (8 new tests) - Add test-lino.mjs to CI workflow - Update case study documentation with correct approach Error messages help users identify and fix configuration problems early. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 6ea3af6.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
This pull request adds validation to the LINO configuration parser to detect and reject invalid input with helpful error messages.
Problem
When users configure the Telegram bot with
TELEGRAM_HIVE_OVERRIDESor similar options, certain input errors were silently ignored or caused options to be dropped:--auto-resume-on-limit-reset?(contains?)--option1 --option2(LINO creates nested tuples)These issues caused options to be silently dropped without any user feedback.
Solution
Instead of silently parsing invalid input, the system now:
-) for allowed characters onlyExample Error Messages
Same-line options:
Invalid character:
Changes
src/lenv-reader.lib.mjs: Add validation for nested structures and invalid characterssrc/lino.lib.mjs: Revert parseStringValues to original (validation at lenv-reader level)tests/test-lino.mjs: New comprehensive test suite (28 tests) for LINO parsingtests/test-lenv-reader.mjs: Extended with 8 validation tests.github/workflows/release.yml: Add test-lino.mjs to CIdocs/case-studies/issue-1086/README.md: Updated documentationTesting
Test Plan
Fixes #1086
🤖 Generated with Claude Code