Fix/agents repl readline unicode#84
Open
strawberry-swing wants to merge 4 commits intoshareAI-lab:mainfrom
Open
Fix/agents repl readline unicode#84strawberry-swing wants to merge 4 commits intoshareAI-lab:mainfrom
strawberry-swing wants to merge 4 commits intoshareAI-lab:mainfrom
Conversation
…ror) - Add optional readline import with fallback for Windows - Bind arrow keys when using libedit (e.g. Cursor terminal) - Catch UnicodeDecodeError on input and re-prompt (e.g. when deleting CJK) Made-with: Cursor
|
@plum-lizimu is attempting to deploy a commit to the crazyboym's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Changes
Per file: optional readline import at top (try/except, readline = None on failure e.g. Windows).
Files: all agents with an interactive REPL: s01_agent_loop.py through s12_worktree_task_isolation.py and s_full.py.
现在的版本打错中文后删掉再发送就会触发UnicodeDecodeError,且不支持左右移动光标,每次打错字或者想补充都得重新启动程序,体验有点差。用readline包装了一下,体验好很多,且不会影响Windows系统。
另外在s06加入了两行print代码以便用户更好地理解compact的过程:一行打印当前token数,一行打印了手动compact前模型的“focus”,把这个TOOLS中的参数利用了起来,以便用户更好理解模型的思路。