Skip to content

Add AI support for local terminal sessions#419

Merged
binaricat merged 8 commits intomainfrom
codex/local-ai-terminal-support
Mar 20, 2026
Merged

Add AI support for local terminal sessions#419
binaricat merged 8 commits intomainfrom
codex/local-ai-terminal-support

Conversation

@binaricat
Copy link
Copy Markdown
Owner

Summary

  • 为本地终端会话添加 AI agent 支持,使 AI 能够在本地 shell 中执行命令
  • 增加 shell 类型检测(posix/fish/powershell/cmd),确保命令在不同 shell 环境下正确执行
  • 修复本地 AI 会话的元数据处理和 shell 安全性问题

Test plan

  • 验证本地终端中 AI agent 可以正常发起和执行命令
  • 测试不同 shell 类型(bash/zsh/fish/powershell)下的命令执行
  • 确认远程 SSH 会话的 AI 功能未受影响
  • 检查 MCP server 在本地模式下的工具调用正确性

🤖 Generated with Claude Code

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6191e20eea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread electron/bridges/ai/ptyExec.cjs Outdated
const POWERSHELL_SHELLS = new Set(["powershell", "powershell.exe", "pwsh", "pwsh.exe"]);
const CMD_SHELLS = new Set(["cmd", "cmd.exe"]);
const FISH_SHELLS = new Set(["fish"]);
const POSIX_SHELLS = new Set(["sh", "bash", "zsh", "ksh", "dash", "ash"]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

*P2 Badge Treat .exe POSIX shells as supported local shells

detectShellKind only recognizes bare POSIX names (bash, zsh, fish, etc.) and misses common Windows executables like bash.exe/fish.exe. In that case local sessions are classified as unknown, and the new local-shell guard in AI execution paths rejects all commands for those sessions, so users with Git Bash configured by full path get a hard “unsupported local shell” failure even though the shell is usable.

Useful? React with 👍 / 👎.

@binaricat binaricat merged commit 91191d6 into main Mar 20, 2026
@binaricat binaricat deleted the codex/local-ai-terminal-support branch March 20, 2026 09:34
pull bot pushed a commit to CrazyForks/Netcatty that referenced this pull request Mar 20, 2026
* Add AI support for local terminal sessions

* Fix local AI session metadata and shell safety

* Fix local session cloning and multi-exec errors

* Refactor local shell detection helpers

* Fix local shell helper import path

* Fix CJS imports in renderer

* Use ESM local shell helpers in renderer

* Normalize local shell paths and platform metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant