fix: isolate multiline AI bash from shared PTY#190
Conversation
|
Thanks for the pull request. A maintainer will review it when available. Please keep the PR focused, explain the why in the description, and make sure local checks pass before requesting review. Contribution guide: https://github.com/AI-Shell-Team/aish/blob/main/CONTRIBUTING.md |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR makes the PTY session manager more resilient by introducing two complementary safeguards. Multiline bash commands now bypass the shared PTY path to prevent unexpected termination, and when the PTY unexpectedly exits, the shell attempts recovery via restart instead of stopping unconditionally. ChangesPTY Resilience
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
bash_execcould be routed into the shared interactive PTY. If the backend bash exited unexpectedly,aishtreated the backendshell_exitingevent as an outer-shell exit and could drop the whole session.shell_exitingevents by restarting the PTY, and preserve explicitexit/quitbehavior.Change Type
Scope
User-visible Changes
bash_execno longer contaminates the shared interactive PTY.aishsession.exit/quitbehavior is unchanged.Compatibility
Testing
uv run pytest tests/tools/test_bash_output_offload.py tests/shell/runtime/test_shell_pty_core.py -quv run ruff check src/aish/tools/code_exec.py src/aish/shell/runtime/app.py tests/tools/test_bash_output_offload.py tests/shell/runtime/test_shell_pty_core.pyChecklist
Logs
Summary by CodeRabbit
Bug Fixes
Tests