Repository navigation
AI 员工环境变量文本模式按 .env 语法解析,去掉外层引号 - #130
Merged
Merged
Conversation
- 粘贴 KEY="value" 时存的是 value,不再把引号当成值的一部分 - 复用技能环境变量的 parseEnv:支持 export、行尾注释、多行引号值,重复变量名报错 - 文本模式显示时值一律加双引号,含 #、引号、首尾空格的值来回切换不丢 - 解析出错只提示行号,不回显该行原文 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
问题
AI 员工表单的环境变量「文本」模式只按第一个
=切分,粘贴DB_PORT="3306"存进去的值是带引号的"3306"。运行时把它原样注入进程,程序拿到"3306"无法转成整数;主机名带引号则连不上。技能环境变量编辑器(SkillEnvEditor)用的parseEnv早已正确处理引号,两处行为不一致。AI 员工自己的环境变量优先于技能注入的同名变量,所以技能环境组配得对,也会被这里带引号的值覆盖。
改动
EnvVarsEditor文本模式改用@/utils/dotenv的parseEnv:外层引号是语法不是值,支持export、行尾注释、多行引号值,重复变量名报错#、引号、首尾空格的值来回切换不丢skillEditor.envError.*文案,只提示行号,不回显该行原文已保存的带引号值不会自动修正,需要在表格模式重新填写或删除重复项。
测试
EnvVarsEditor.spec.ts:更新文本模式显示断言;新增引号去除与来回切换、报错不回显原文两个用例🤖 Generated with Claude Code