Skip to content

aish supports shell prompts#66

Merged
F16shen merged 3 commits intoAI-Shell-Team:mainfrom
jexShain:main
Mar 19, 2026
Merged

aish supports shell prompts#66
F16shen merged 3 commits intoAI-Shell-Team:mainfrom
jexShain:main

Conversation

@jexShain
Copy link
Copy Markdown
Collaborator

@jexShain jexShain commented Mar 19, 2026

Summary

Modify this configuration file to turn on this function
~/.config/aish/config.yaml

enable_scripts: true

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Other

Scope

  • Core shell / PTY
  • AI agent / LLM
  • Skills / Tools
  • Security
  • Configuration
  • CLI / Interface
  • Packaging / Installation
  • CI/CD
  • Documentation

User-visible Changes

Compatibility

  • Backward compatible? (Yes/No)
  • Config changes? (Yes/No - if yes, describe migration)

Testing

 :~/n/x/g/aish|main⚡*?➜➜ make lint                                                                                    
🔍 Running linting...                                                                                                  
uv run --group dev ruff check src/ tests/                                                                              
All checks passed!                                                                                                     
uv run --group dev mypy src/                                                                                           
src/aish/env_manager.py:21: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                     
src/aish/prompts.py:16: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                         
src/aish/interruption.py:71: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                    
src/aish/interruption.py:75: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                    
src/aish/interruption.py:79: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                    
src/aish/interruption.py:80: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                    
src/aish/interruption.py:83: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                    
src/aish/interruption.py:86: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                                                    
src/aish/shell_enhanced/shell_pty_executor.py:228: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                              
src/aish/shell_enhanced/shell_pty_executor.py:229: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]                                                              
src/aish/shell_enhanced/shell_pty_executor.py:272: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/aish/skills/manager.py:66: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/aish/skills/manager.py:67: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Success: no issues found in 110 source files

Checklist

  • Code follows project style
  • Tests added if needed
  • Documentation updated if needed

@github-actions github-actions Bot added dependencies Pull requests that update a dependency file pty PTY or interactive process issue core config tests skills Skills-related issue size: XL trusted-contributor labels Mar 19, 2026
@jexShain jexShain requested a review from F16shen March 19, 2026 02:37
Comment thread src/aish/config.py
Comment thread src/aish/shell.py
Comment thread src/aish/shell.py
Comment thread src/aish/shell.py
Comment thread src/aish/shell_enhanced/shell_command_service.py
Comment thread src/aish/shell_enhanced/shell_input_router.py
Comment thread src/aish/scripts/executor.py
Copy link
Copy Markdown
Collaborator

@F16shen F16shen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这轮 review 里我主要有几项阻塞点:

  1. enable_scripts 目前是默认开启并且会把旧配置自动迁移成开启状态,这会让现有用户无感切到新的 prompt/script 路径,和 PR 描述里的手动启用预期不一致。
  2. 脚本 hot reload 的启动时序有问题,首次启动时如果 scripts 目录还不存在,watcher 会直接退出,默认 prompt 模板也无法在当前会话里生效。
  3. prompt 失败态依赖进程环境里的 ?,但当前 shell 没有看到有地方可靠维护它,这会让 prompt 状态不可信。
  4. handle_script_call()OLDPWD 会被写成新目录而不是旧目录。
  5. 脚本调用优先级高于普通命令,会直接遮蔽同名系统命令。
  6. ScriptExecutor 当前是按行解释脚本,和用户对 shell 脚本语义的预期差异很大,现有测试也还没有覆盖这些高风险场景。

我已经把这些点分别挂到了对应代码行上,建议先把这些基础语义和兼容性问题收敛之后再继续推进。

Comment thread src/aish/shell.py
Comment thread src/aish/shell.py
Comment thread src/aish/shell.py
Comment thread src/aish/shell_enhanced/shell_input_router.py
@F16shen F16shen merged commit de0e313 into AI-Shell-Team:main Mar 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config core dependencies Pull requests that update a dependency file pty PTY or interactive process issue size: XL skills Skills-related issue tests trusted-contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants